pypi / prek
prek
What changed in prek 0.3 to 0.5, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
18 breaking7 security71 new APIs and options36 performance48 behavior and defaults8 tooling69 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initprek 0.577 changes
Breaking changes 7
The check now rejects empty files.
The check now rejects trailing data.
Unsupported YAML tags are now rejected.
Group names can no longer start with
@, reserving that prefix for special group selectors.Remove this command; use
prek update, orprek autoupdatefor drop-in compatibility withpre-commit.Remove the top-level command; use
prek util init-template-dir, orprek init-templatedirfor drop-in compatibility withpre-commit.Remove this environment variable; use
PREK_CONCURRENT_HOOKSandPREK_CONCURRENT_BATCHESto control hook and per-hook batch concurrency separately.
Security 2
CA root crates and uv were updated in response to the eMudhra intermediate CA compromise.
PyPI releases now include PEP 740 attestations, which developers can use to verify release provenance.
New APIs and options 20
Adds the builtin hook check-commit-trailers for validating commit trailers.
Adds the builtin hook check-signed-commit for checking signed commits.
The hook adds a
--checkoption.The hook adds a
--checkoption.Project and user configuration can now use
hide_status.Hooks can be configured to include deleted files.
Shell completion generation is exposed for users.
The hook adds a
--checkoption.The hook adds a
--checkoption.Automatic uv installation can now be disabled.
A new builtin hook, check-jsonc, is available for checking JSONC files.
Adds a hook-report option to hide passed, failed, or skipped hooks.
Adds Pixi support for Conda environments.
Adds a command for repository setup.
Support the
{hook_repo}placeholder in a hook'sentry.Explicit
language: pythonopts out of fast-path hooks.Add a source preference alongside the version request to control whether prek tries managed or system toolchains first, or requires one source.
Use this environment variable to control per-hook batch concurrency separately.
Use this environment variable to control hook concurrency separately.
Add a group selector for hooks that are not assigned to a group.
Performance 19
CPU-heavy builtin hooks use blocking file checks.
Reduces hook process launches by using balanced batches.
Unused file input is skipped for always-run hooks.
Bun and Deno version queries are shared across environments.
Cached hook environments are checked concurrently.
Only staged additions are queried for case-conflict checks.
Git queries run concurrently for case-conflict checks.
Untracked files are skipped in destroyed symlink checks.
Git discovery overlaps with worktree status checks.
Git worktree state is reused during hook startup.
Intent-to-add paths are reused when saving unstaged changes.
Lua runtime probes are shared across hook environments.
mise version queries are shared across hook environments.
Site initialization is skipped in Python interpreter probes.
JSON imports are avoided when querying Python interpreters.
Ruby version queries are shared across hook environments.
File reads are batched during shebang checks.
Worker overhead is reduced in XML and pygrep checks.
Builtin hook execution is faster; the end-to-end benchmark reports about 38% improvement over 0.5.3, with some hooks up to 273% faster.
Behavior and default changes 8
prek supports system Rust toolchains without requiring rustup.
Shebang checks now default missing core.fileMode.
Builtin pattern hooks now support look-around regular expressions.
check-yaml allows unknown tags by default, so developers no longer need to configure around them.
Error snippets are disabled in check-yaml diagnostics.
The hook's env setting is now applied during environment creation.
Hooks excluded by skip selectors are now shown.
Unused keys in user settings now trigger a warning.
Tooling 4
Completion generation now supports Nushell.
Wheel and binary builds are now available for ppc64le.
Adds cargo-binstall support for Rust CLI dependencies.
A JSON schema is generated for the prek manifest.
Fixes and other changes 17
Accepts a UTF-8 BOM in JSON checked by the builtin hook.
Preserves unquoted dotted revisions when updating.
File sizes are rounded up.
Staged and unstaged changes are preserved when stash restore encounters conflicts.
Duplicate diffs are avoided after hooks rewrite files.
Protected branch patterns are matched from the start.
Explicit paths are normalized in shebang index checks.
Empty character sets are preserved.
Completion scripts resolve prek using PATH.
Transient rename failures are retried on Windows.
Fixed handling of additional dependency specifiers for Julia.
Fixed YAML flow indentation parsing.
Track explicit config paths as absolute paths.
Expose the git work tree to hooks running outside the git root.
Preserve error locations when deserializing hook configuration.
Resolve hook log files from their config directory.
Isolate local hook environment installation.
prek 0.4106 changes
Breaking changes 9
Removes parallel Ruby gem installation.
Renames auto-update to update.
A concurrency environment variable is added for batches as run concurrency knobs are split.
A concurrency environment variable is added for hooks as run concurrency knobs are split.
Removes support for legacy repository paths.
language_version no longer accepts direct executable paths; use system for a system toolchain or a supported version request instead.
Generated hook scripts no longer preserve --no-progress passed to prek install, so this flag is not baked into installed hooks.
Generated hook scripts no longer preserve -q passed to prek install, so this flag is not baked into installed hooks.
Generated hook scripts no longer preserve -v passed to prek install, so this flag is not baked into installed hooks.
Security 2
Verifies uv release archive checksums.
Managed toolchain downloads are verified before installation.
New APIs and options 25
check-yaml now supports unsafe mode.
Adds the deny-filename-pattern hook.
Runs an explicit command in a configured hook's prepared environment, making that hook's managed binaries available.
Adds the require-filename-pattern hook.
Adds --require-group to select hook group intersections.
A builtin hook fails when a configured pattern is found, providing a native alternative to pygrep that runs over 4x faster in benchmarks. Patterns use Rust regex syntax, which does not support look-around.
Node hooks can now be installed through a git URL.
Adds --glob <PATTERN> to run hooks on tracked files matching a glob; the option can be repeated or combined with --files and --directory.
Hook priorities can use reusable aliases declared in a [priorities] table, making parallel scheduling easier to read and maintain.
A builtin hook ensures every selected file contains a match, providing a native alternative to pygrep that runs over 4x faster in benchmarks. Patterns use Rust regex syntax, which does not support look-around.
requirements-txt-fixer is implemented as a builtin hook.
PHP language support was added.
A freeze option was added to update settings.
Tag filters were added to update configuration.
Adds the default_env configuration option.
This environment variable opts out of Docker --init.
Adds Conda language support for hooks.
Adds coursier language support for hooks.
Adds Perl language support for hooks.
Adds group filters to the list command.
Adds R language support for hooks.
Hooks can be tagged with groups so different workflows can select or exclude hook sets without splitting the config.
Select hooks in a group at run time, allowing a config to support different workflows.
Exclude hooks in a group at run time, allowing a config to support different workflows.
The rustup install profile is now configurable.
Performance 15
Allocations are reused in common filters to improve performance.
Node version queries are cached.
Avoids environment cache scans for skipped hooks.
Tracks builtin hook file changes directly.
Precomputes file tags in parallel.
Skips diffs after hook modifications are already known.
Skips worktree diffs for read-only languages.
Blocking-pool overhead is reduced in file hooks.
Mixed-line-ending scans are faster with memchr2.
Unnecessary submodule updates during hook repository cloning are skipped.
Skips file scans for always-run hooks that do not receive filenames.
Clean worktrees use a cheap dirty check unless a hook changes files, reducing expensive diff work.
Diff checks are skipped for built-in hooks known to be read-only, reducing unnecessary work.
Optimizes meta hook file scans.
Reduces allocations during run filtering.
Behavior and default changes 25
File regexes are matched against path bytes.
Hook aliases are shown in run output.
Hook descriptions are shown in run output.
Output adapts to whether it is running in a terminal.
Aligns fast-path and builtin pre-commit hook behavior.
With --force, prek install bypasses external hooks paths.
Installs uv from the Astral CDN and drops source racing.
Shows builtin hook flags in verbose list output.
The file list is no longer shuffled in verbose output.
try-repo now supports builtin and meta.
Changes the repository identity schema stored in cached hook environments; existing environments are invalidated and prek reinstalls them automatically when needed.
Preserves additional dependency order.
Warns when update repositories are missing.
Subprocess error messages are improved, helping developers understand failures.
Fully filtered remote repositories are no longer cloned.
Hook stream output now shows a small live preview under the running hook in the progress UI, making long-running hooks easier to monitor and failures easier to diagnose.
Sibling projects at the same workspace depth now run in parallel automatically, without requiring users to configure priority values.
Prefers extensions over loose filename tags.
Skips installs for hooks that will not run.
Auto-update cooldown downgrades are prevented.
Tilde is expanded in the --cd argument.
Tilde is expanded in the --config argument.
Tilde is expanded in the --git-dir argument.
Tilde is expanded in the --log-file argument.
Node hooks use a managed npm cache.
Tooling 2
Alpine Docker images are now published.
Files identified as 'mts' and 'cts' are now recognized as TypeScript files.
Fixes and other changes 28
Captured terminal output is sanitized before replay.
check-yaml now accepts non-finite floats.
check-yaml now allows comment-heavy YAML.
Dependency installs are isolated from inherited Git repository state.
Fixes Node hook installation with npm 11.
Uses full object IDs in diff snapshots.
Improves top-level command descriptions, helping developers understand available commands.
Builtin hooks now honor filenames specified in their entry and args.
Hook output order is preserved with a shared pipe.
Identify tags now match across filename parts.
Applying metadata now preserves the system download policy.
Configured repository values are now preserved during updates.
The synthetic GIT_WORK_TREE is now scoped to git commands.
Python discovery order was fixed.
Progress rendering on Windows was fixed.
Validates complete XML documents.
Uses the resolved gem executable.
Fixes local path resolution for try-repo.
Fixes handling of mixed workspace selectors.
Fixes the ordering of collapsed progress rows.
Fixes insertion of progress after collapsed rows.
Ignores the coursier channel from the working repository.
Handles missing blobs in diff snapshots.
Fixes CRLF handling in pretty-format-json.
Fixes restoring stashes involving intent-to-add files.
Stat-only hook rewrites are ignored.
Fixes the pre-push range after a rebase.
Fixes npm config environment overrides for node hooks.
prek 0.374 changes
Breaking changes 2
The schema disallows rev for non-remote repositories.
Renames
prek install-hookstoprek prepare-hooks.
Security 3
Restricts patch directory permissions.
Validates pinned SHAs against fetched upstream refs and detects impostor commits.
Validates the uv binary after downloading it.
New APIs and options 26
Adds a cooldown-days setting for prek auto-update in both user-level global config and project config, allowing a project to override the user default.
Hook configuration now supports
language: dart.Workspace hooks now receive the commit message file.
Skip specified repositories during auto-update.
Exit with a non-zero status when updates are found.
Use glob patterns to limit update candidates to matching tag names.
Hook entries can set shell to sh, bash, pwsh, powershell, or cmd to evaluate snippets with that shell; unset entries keep direct argv execution.
Adds forbid-new-submodules as a builtin hook.
Adds experimental support for the dotnet language.
Adds a check mode that exits non-zero for available updates, stale frozen comments, or pinned SHAs absent from fetched upstream refs, without rewriting the config.
Adds a flag to override the config file's fail-fast setting.
Adds check-illegal-windows-names as a builtin hook.
Adds check-shebang-scripts-are-executable as a builtin hook.
Adds check-vcs-permalinks as a builtin hook.
Adds destroyed-symlinks as a builtin hook.
Adds file-contents-sorter as a builtin hook.
Adds experimental support for deno as a language.
Adds the --all flag to prek uninstall.
Adds pretty-format-json as a builtin hook.
Rust supports package disambiguation through the fourth segment of a cli: Git dependency.
Hook scripts can now use legacy mode.
Use --git-dir to force the target for hook installation.
Requests can use the system proxy.
Add an environment variable for configuring log truncation.
Add an environment variable for configuring maximum concurrency.
prek can now be run as a Python module.
Performance 2
Gems are installed and compiled in parallel.
Tag masks are precomputed to speed up hook type filtering.
Behavior and default changes 15
The --hook-dir option is now optional for hook-impl.
Finished hooks remain visible.
Merge conflict marker detection is improved.
Up-to-date output is hidden in non-verbose mode.
Shows tag names in freeze output and writes frozen SHAs with matching frozen-tag comments.
Displays auto-update results by configuration entry.
Cleans stale patch files during cache garbage collection.
Relaxes the alias-anchor ratio check for check-yaml.
Gem retries can now run in parallel.
The open file limit is adjusted when the process starts.
The --no-progress option is passed through into generated hook scripts.
The --quiet option is passed through into generated hook scripts.
The --verbose option is passed through into generated hook scripts.
File-type mappings are synchronized with pre-commit identify, affecting how file types are identified.
pass_filenames now accepts a positive integer, allowing configuration of the number of filenames passed.
Tooling 2
Ruby can now be downloaded automatically using rv binaries.
Rust cargo install commands use --locked.
Fixes and other changes 24
Hook filters are now respected for message files, so configured filtering applies to those files.
Preserves non-UTF8 filenames obtained from Git.
Ruby hooks put the resolved Ruby's bin directory on
PATHforgeminvocations.prek uses a dedicated Android npm package.
A missing --script-version no longer triggers a shim warning.
Repository keys are stable without breaking cached clones.
The Ruby executable is installed in the gem bin.
Auto-update preserves spacing in frozen comments.
The npm package is reimplemented; the notes do not specify changes to its developer-facing behavior or interface.
Honors repo and worktree core.hooksPath settings.
Canonicalizes CWD and GIT_ROOT paths.
Auto-update keeps rev values and # frozen: comments in sync, repairing stale frozen comments.
Adds quotes for non-string revisions in auto-update output.
Improves error reporting when file patterns fail to parse.
Fixes handling of workspace-relative paths for added files.
Uses
GOTOOLCHAIN=localwhen probing system Go.Selectors can now target hook ids containing colons.
Ensures child output is drained in the PTY subprocess.
Auth-failed repository clones are retried with terminal prompts enabled.
Stage defaulting behavior is aligned with pre-commit.
Hook permissions now respect Git's core.sharedRepository setting.
Fixes the Python __main__.py entry.
The variable is stripped from uv venv and pip install commands.
Invalid Rust toolchains are skipped instead of causing failure.