17% smaller, up to 31% faster
Compared with v1.53.0, the published x86_64-unknown-linux-gnu release is substantially leaner and faster:
| Measurement | v1.53.0 | v1.54.0 | Improvement |
|---|---|---|---|
| Compressed archive | 8.19 MB | 7.06 MB | 13.8% smaller |
| Extracted binary | 22.01 MB | 18.27 MB | 17.0% smaller |
Startup (--version)
| 2.21 ms | 1.52 ms | 31.2% faster |
| Builtins loading | 2.31 ms | 1.62 ms | 29.8% faster |
| Config validation | 3.69 ms | 2.94 ms | 20.3% faster |
Representative check --all
| 14.62 ms | 13.47 ms | 7.8% faster |
Measurements use the published release binaries with hermetic state, warm caches, shell overhead excluded, and execution pinned to one CPU. Real hook runs dominated by external linters will see a smaller overall percentage.
This release adds an opt-in way to focus detailed check diagnostics on only the files that actually failed, teaches hk's usage spec to declare each command's effect on the world, and speeds up the mixed-line-ending and check-merge-conflict builtins along with a new PGO/BOLT-optimized Linux release binary. It also fixes noise and false errors in a couple of builtins.
Added
-
Focus checks on failing files (@jdx) #1123. A new opt-in
check_failed_filesstep setting runs a file-listing command (check_list_filesorcheck_diff) over the whole job first, then runs the detailedcheckonly on the paths it reports as failing. This keeps a checker's full diagnostics available without passing every file in a large repository to the second invocation. When enabled, hk requirescheckplus at least one ofcheck_diff/check_list_files(validated athk validatetime), keeps the listing failure authoritative if the focused check unexpectedly succeeds, and still applies automatic argument-limit batching to the narrowed file set. Addresses discussion #1122.["my-linter"] { glob = List("**/*.py") check_list_files = "my-linter --list-failing-files {{files}}" check = "my-linter check {{files}}" fix = "my-linter fix {{files}}" check_failed_files = true }
-
Command effect declarations (@jdx) #1121. Every hk command's usage spec now declares whether it only reads state, modifies it, or is destructive (e.g.
uninstall, which removes files from.git/hooks).check,fix,run, andtestare deliberately left unclassified because they execute arbitrary steps fromhk.pkl— hk cannot promise what those do. Command reference pages now show an Effect line for each command.
Fixed
-
tombi-formatno longer prints noise on clean runs (@jdx) #1117.tombi formatprinted a "file did not need formatting" summary to stderr even when nothing changed, which hk surfaced after an otherwise clean run. hk now passes--quietto both the check and fix commands, suppressing only the summary while still showing the diff and error on failure. Fixes discussion #1116. -
oxlintno longer errors on unmatched patterns (@CallumKerson) #1119. Theoxlintbuiltin now tolerates glob patterns that match no files, matching the behavior already used for thebiomebuiltin.
Performance
-
Faster
mixed-line-endingandcheck-merge-conflict(@astei) #1115. Both builtins now use thememchrcrate for fast byte scanning instead of iterating byte-by-byte, with themixed-line-endingfix path doing block copies instead of a per-byte rewrite. Benchmarks show up to ~2.5x faster checks and ~2.2x faster fixes on large files, with neutral-to-positive impact on small ones. -
PGO/BOLT-optimized Linux binary (@jdx) #1136. The
x86_64-unknown-linux-gnurelease artifact is now built through a profile-guided optimization and BOLT layout pipeline trained on representative Pkl/Git/check workloads. Alongside this, the release binary is stripped and slimmed (narrower Tokio/xx features,panic = "abort"), and the Tokio runtime now caps worker threads at 16.
New Contributors
Full Changelog: v1.53.0...v1.54.0
💚 Sponsor hk
hk is maintained by @jdx, an open source developer for entire.io, the title sponsor of the jdx.dev open source tools including mise, aube, and more. Work on hk is funded by sponsorships.
If hk has sped up your pre-commit loop or made linting feel less painful, please consider sponsoring at jdx.dev. Sponsorships are what keep hk moving and the project independent.
AI-assisted — Tool: Codex; model: openai/gpt-5; version: unavailable.