# What changed in pre-commit

> 9 changes in pre-commit 2 from its official release notes, upgrade guides and advisories: 3 breaking, 2 security. Each one cited. Sources checked 2026-10-27. HTML: https://unstale.sh/npm/pre-commit/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## pre-commit 2

### Breaking changes

- The generated wrapper is now a small bash script that execs the package's hook file via an absolute path; scripts parsing the wrapper must adjust. (2.0.0) — [release notes](https://github.com/observing/pre-commit/blob/HEAD/CHANGELOG.md)
- Node.js 16.13 or newer is now required. (2.0.0) — [release notes](https://github.com/observing/pre-commit/blob/HEAD/CHANGELOG.md)
- Signal-terminated scripts are no longer treated as successful. (2.0.0) — [release notes](https://github.com/observing/pre-commit/blob/HEAD/CHANGELOG.md)

### Security

- Hook file mode is tightened from 0777 to 0755. (2.0.0) — [release notes](https://github.com/observing/pre-commit/blob/HEAD/CHANGELOG.md)
- Gitdir parsing is hardened against missing matches and bad input, and gitdir paths are resolved relative to the directory containing the .git file. (2.0.0) — [release notes](https://github.com/observing/pre-commit/blob/HEAD/CHANGELOG.md)

### Fixes and other changes

- The hook unsets this environment variable so commits triggered from emacs/magit behave like command-line commits. (2.0.0) — [release notes](https://github.com/observing/pre-commit/blob/HEAD/CHANGELOG.md)
- The hook changes to the git root before resolving pre-commit, helping Yarn Plug'n'Play and GUI git clients with an unexpected working directory. (2.0.0) — [release notes](https://github.com/observing/pre-commit/blob/HEAD/CHANGELOG.md)
- If the package is missing, the hook warns and exits 0 instead of throwing a module-not-found stack trace, so commits are not blocked. (2.0.0) — [release notes](https://github.com/observing/pre-commit/blob/HEAD/CHANGELOG.md)
- Submodule installs now write the pre-commit hook under the submodule's git modules directory; linked worktrees are handled correctly too. (2.0.0) — [release notes](https://github.com/observing/pre-commit/blob/HEAD/CHANGELOG.md)
