pypi / pre-commit
pre-commit
What changed in pre-commit 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
1 breaking3 new APIs and options1 performance1 behavior and defaults10 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpre-commit 416 changes
Breaking changes 1
Requires the --hook-type option.
New APIs and options 3
Adds the pre-commit hazmat command.
Adds
unsupportedandunsupported_scriptas aliases forsystemandscript; the existing values will eventually be deprecated.Adds --fail-fast to stop running hooks after the first failure.
Performance 1
Improve the performance of the commit existence check in pre-push.
Behavior and default changes 1
Allows --hook-dir to be omitted for easier usage with git 2.54+ hooks.
Fixes and other changes 10
Fixes
language: nodehooks during commits with-aor inside a submodule.Fixes node-language hooks containing a build script when used with npm 11.x.
Set JULIA_DEPOT_PATH for language: julia hooks.
Install hooks configured with language: node via git to fix npm 12.x compatibility.
Mistyped --repo values now produce an error when running pre-commit autoupdate.
Avoid duplicating conflicted filenames when running all files.
Fixes local hooks configured with language: python so they work without additional_dependencies.
Adds support for detecting docker-in-docker when using cgroups v2.
Handles Docker returning
SecurityOptions: null.Improves the error context reported for invalid
stages.