Releases: jdx/hk
v1.39.0: New builtins, corporate proxy support, and critical stash fixes
This release adds four new builtin linter/formatter configurations, introduces corporate proxy support for Pkl config loading, and fixes several important correctness issues -- most notably binary file corruption during the stash/unstash cycle and broken hooks in git worktrees.
Highlights
- Binary file preservation in stash: Binary files (images, compiled assets, etc.) were silently corrupted to 0 bytes when hk stashed and unstashed changes during pre-commit hooks with partial staging. This is now fixed with binary-safe blob handling.
- Git worktree support: The
commit-msgandprepare-commit-msghooks now resolve file paths correctly in git worktrees, where.gitis a file pointing to the main repo rather than a directory. - Four new builtins:
just_format,knip,knip_strict, andcontextlintjoin the growing library of built-in linter configurations. - Corporate proxy support: The new
HK_PKL_CA_CERTIFICATESenv var lets hk work behind SSL-intercepting proxies without manual workarounds.
Added
-
just_formatbuiltin: Format Justfiles usingjust --fmt. Matches**/justfileand**/*.justglobs. (@matdibu) #729 -
knipandknip_strictbuiltins: Find unused files, dependencies, and exports in JavaScript/TypeScript projects using Knip. Theknip_strictvariant enables--strict(implies--production) for stricter analysis. (@hituzi-no-sippo) #713 -
contextlintbuiltin: Rule-based linting for structured Markdown documents using contextlint. Automatically detected viacontextlint.config.json. (@hituzi-no-sippo) #747 -
HK_PKL_CA_CERTIFICATESenv var: Pass a custom CA certificates file to Pkl via--ca-certificates, enabling hk to work in corporate environments with SSL-intercepting proxies. (@jdx) #760export HK_PKL_CA_CERTIFICATES=/path/to/ca-bundle.pem
Fixed
-
Binary files preserved during stash/unstash: Binary files (PNG, JPG, etc.) were silently corrupted to 0 bytes during the stash/unstash cycle when committing with partial staged changes. The root cause was that
git_read_raw()converted blob output to a UTF-8 string, which fails silently for binary content. Binary files are now detected and restored directly from raw bytes, bypassing the text merge path. (@jdx) #759 -
Commit message hooks work in git worktrees: In git worktrees,
.gitis a file (not a directory), so the.git/COMMIT_EDITMSGpath passed by git tocommit-msgandprepare-commit-msghooks would fail with "Not a directory". hk now resolves these paths through the actual git directory. (@jdx) #761 -
Batch splitting honored in workspace jobs: When both
workspace_indicatorandbatch = truewere set, the batch splitting logic was bypassed entirely, producing one large job per workspace. Files are now properly chunked into parallel jobs within each workspace. (@jdx) #757 -
trailing-whitespace --fixhandles CRLF correctly: The fix and check modes usedBufReader::lines()which silently strips\rfrom CRLF line endings, making carriage returns invisible to detection. This is now consistent with--diffmode, which already handled CRLF correctly. (@jdx) #758 -
Regex patterns no longer break config cache:
Regex()file patterns caused "failed to parse cache file" warnings on subsequent runs because the serde discriminator field was skipped during serialization. (@jdx) #740 -
nixfmtgracefully skips on Windows: Since nixfmt doesn't support Windows, the builtin now cleanly no-ops on that platform instead of failing. (@azais-corentin) #741
New Contributors
- @azais-corentin made their first contribution in #741
Full Changelog: v1.38.0...v1.39.0
v1.38.0: Fail on fix, cleaner builtins
A small release that adds a new fail_on_fix hook option for workflows that want fixes applied but commits blocked, along with correctness improvements to several built-in linter configurations.
Added
-
fail_on_fixhook option: Hooks can now setfail_on_fix = trueto fail when fix commands actually modify files. This is designed forstage = falsepre-commit workflows where you want fixers to apply changes but block the commit so you can review and stage them manually. Defaults tofalseto preserve existing behavior. (@jdx) #725hooks { ["pre-commit"] { fix = true stage = false fail_on_fix = true steps = linters } }
Fixed
- Cleaner builtin linter configs: Removed redundant
checkcommands fromblack,ruff_format, andtaplo_formatbuiltins wherecheck_diffalready covers all issues. Removedcheck_difffrom theruffbuiltin becauseruff check --diffcan exit 0 even when non-fixable issues exist, which caused hk to incorrectly skip the fix step. Thanks @nkakouros! #726
Full Changelog: v1.37.0...v1.38.0
v1.37.0: Smarter Config, Hook-Level Env, and Better Fix/Check Semantics
This release overhauls global configuration handling, adds hook-level environment variables, and fixes several correctness issues in check/fix workflows.
Highlights
Overhauled global config (hkrc) -- The global user configuration has been significantly reworked. hk now supports the full Config.pkl format in hkrc files (not just UserConfig.pkl), fixing a panic when using the documented example with hooks and steps. The recommended config location is now ~/.config/hk/config.pkl, with clear "project wins" merge semantics. The legacy .hkrc.pkl paths and --hkrc flag are deprecated and will be removed in v2. Thanks @ivy! #710
Hook-level env support -- Hooks can now define environment variables that are automatically passed to all their steps, reducing duplication when multiple steps need the same variables. Step-level env takes precedence over hook-level env. #709
check_diff correctness in check mode -- Previously, steps with check_diff defined would always run the diff command first, even in check mode. This could hide non-auto-fixable errors when the diff command exited 0. The diff-first shortcut is now gated to fix mode only. Thanks @nkakouros! #717
Added
-
Hook-level
env: Define environment variables once per hook instead of repeating them on every step. Step-level env takes precedence when both define the same variable. (@jdx) #709hooks { ["pre-push"] { env { ["HK_PROFILES"] = "types" } steps = linters } }
-
Go-style diff parsing: hk now correctly handles unified diffs where the
---line has a.origsuffix (common with Go tools likegofmt -d). (@jdx, co-authored by @thejcannon) #704 -
XDG config directory support: Global configuration can now be placed at
~/.config/hk/config.pkl(or a custom path viaHK_CONFIG_DIR). (@ivy) #710 -
Config precedence documentation: A clear precedence table and hkrc merge semantics are now documented, covering built-in defaults through CLI flags. (@ivy) #701 #710
Fixed
-
end-of-file-fixer now enforces that files end with exactly one trailing newline, matching pre-commit-hooks behavior. Previously it would add a missing newline but leave multiple trailing newlines untouched. (@jdx) #708
-
pre-commit with stash no longer passes untracked files to linters as input. Untracked files were incorrectly included in the unstaged files set, causing them to be processed during
hk run pre-commit. Thanks @nkakouros! #716 -
check_diff in check mode no longer silently swallows errors. When a step defines
check_diff, hk previously ran the diff command first in all modes. If the diff command exited 0 (no auto-fixable issues), non-auto-fixable violations detected by the regularcheckcommand were hidden. The diff-first shortcut is now only used in fix mode. Thanks @nkakouros! #717 -
hkrc format support: Global config files can now use the full
Config.pklformat with hooks containing steps that havecheck,fix, andglobfields. Previously this caused a panic because hk always deserialized hkrc asUserConfig. (@ivy) #710 -
hkrc discovery path: Default hkrc discovery now correctly checks
~/.hkrc.pkland~/.config/hk/config.pkl, instead of only looking for.hkrc.pklrelative to the current directory. (@ivy) #710 -
--allflag documentation now correctly describes what the flag does. Thanks @nkakouros! #715
Deprecated
.hkrc.pkland--hkrcflag are deprecated and will be removed in hk v2. Use~/.config/hk/config.pklfor global configuration orhk.local.pklin the project root for per-project overrides. Deprecation warnings are shown when legacy paths are used. #710
New Contributors
- @ivy made their first contribution in #701
- @nkakouros made their first contribution in #716
Full Changelog: v1.36.0...v1.37.0
v1.36.0 - Nix and Format Friends
This release expands hk's built-in linter library with several new tools, particularly for Nix and infrastructure-as-code workflows, along with a handful of useful fixes.
Highlights
New --pr flag for checking PR-changed files — You can now run hk check --pr to automatically check only the files that have changed in your current pull request compared to the base branch. This makes it easy to run targeted checks during code review without processing your entire codebase. #660
New tmpdir step option — Steps can now specify tmpdir = true to run in an isolated temporary directory, useful for tools that need a clean working environment. Thanks @thejcannon! #663
ty builtin — Added support for ty, Astral's new Python type checker. Thanks @joonas! #566
New Built-in Linters
Thanks to @matdibu for contributing five new builtins:
- cmake_format — Format CMake files #672
- deadnix — Find unused code in Nix files #670
- hclfmt — Format HCL/Terraform files #675
- nil — Nix language server for diagnostics #669
- nixf_diagnose — Additional Nix diagnostics #671
The ruff_format and tombi builtins now use --quiet mode for cleaner output. #667 #676
Bug Fixes
- typos now respects exclusions when using
--force-exclude— Thanks @CallumKerson! #659 - check-case-conflict no longer reports false positives from duplicate file entries — Thanks @safinn! #678
- yamllint now runs in strict mode for more reliable error detection #673
- Fixed ignore patterns not being respected when recursing into directories — Thanks @thejcannon! #661
- Fixed Nix flake builds when git submodules are included — Thanks @jeffutter! #681
New Contributors
Welcome to our new contributors! 🎉
Full documentation: https://hk.jdx.dev/
Changelog
1.36.0 - 2026-02-09
🚀 Features
- (cmake_format) init by @matdibu in #672
- (deadnix) init by @matdibu in #670
- (hclfmt) init by @matdibu in #675
- (nil) init by @matdibu in #669
- (nixf_diagnose) init by @matdibu in #671
- (ruff_format) use
--quietby @matdibu in #667 - (tombi) use
--quietby @matdibu in #676 - add ty builtin by @joonas in #566
- add --pr shortcut flag for checking PR-changed files by @jdx in #660
- add tmpdir step test option by @thejcannon in #663
🐛 Bug Fixes
- (bultins) respect typos exclusions with --force-exclude by @CallumKerson in #659
- (docs) escape angle brackets in --pr flag description by @jdx in #666
- (docs) use valid
tags instead of
in sea shanty by @jdx in 12e17f8 - (go_fumpt) comment out broken check by @matdibu in #668
- (yamllint) enable strict mode by @matdibu in #673
- respect ignore when recursing by @thejcannon in #661
- Deduplicate files in check-case-conflict to prevent false positives by @safinn in #678
- Fix building of nix flake wiwth the inclusion of git subomdules by @jeffutter in #681
🛡️ Security
- add tone calibration to release notes prompt by @jdx in #679
- add opengraph meta tags by @jdx in #685
🔍 Other Changes
- Use tmpdir for the tests by @thejcannon in #677
📦️ Dependency Updates
- lock file maintenance by @renovate[bot] in #658
- update anthropics/claude-code-action digest to b113f49 by @renovate[bot] in #684
- update actions/checkout digest to de0fac2 by @renovate[bot] in #683
New Contributors
- @jeffutter made their first contribution in #681
- @matdibu made their first contribution in #673
- @safinn made their first contribution in #678
- @CallumKerson made their first contribution in #659
v1.35.0 - Poetic Precision
This release brings a more intuitive setup experience and some delightful quality-of-life improvements. The hk init command now auto-detects your project's tools and offers an interactive mode, making it easier than ever to get started. We've also added git worktree support for developers working across multiple branches simultaneously.
Highlights
Smarter Initialization (#656)
The hk init command has been significantly enhanced with auto-detection capabilities. It now scans your project to identify which linters and formatters you're using and can automatically configure them for you. An interactive mode lets you review and customize the detected configuration before committing to it.
Git Worktree Support (#651)
For developers who use git worktrees to work on multiple branches simultaneously, hk now properly supports this workflow. Hooks and configuration are correctly resolved regardless of which worktree you're working in.
Helpful Typo Suggestions (#654)
Made a typo in a command or step name? hk now offers "did you mean?" suggestions, helping you quickly recover from common mistakes without having to look up the correct spelling.
Haiku-Named Stash Backups (#655)
Stash patch backups now use memorable haiku-style names instead of cryptic identifiers. This makes it much easier to identify and manage your stashed changes when you need to recover them.
Internal Improvements
- Migrated to xx utilities and removed unused dependencies, keeping the binary lean (#653)
For full documentation, visit hk.jdx.dev.
v1.34.0 - Windows of Opportunity
This release brings official Windows support to hk, expanding the tool's reach to developers on all major platforms. Whether you're running Windows, macOS, or Linux, hk now has you covered with tested, reliable git hook management and project linting.
We've also fixed an important networking issue that was affecting users in corporate environments with custom certificate authorities, ensuring HTTPS requests now properly use your system's trusted certificates.
Highlights
Windows Support (#648)
hk now includes Windows in its CI testing matrix, bringing first-class support for Windows developers. This means you can confidently use hk across your entire team regardless of operating system, making it easier to enforce consistent code quality standards in mixed-platform environments.
Bug Fixes
System CA Certificates for HTTPS (#650)
HTTPS requests now properly use your system's CA certificates instead of a bundled certificate store. This fix is particularly important for users behind corporate proxies or in environments with custom certificate authorities—hk will now respect your system's trusted certificates, eliminating connection failures when downloading tools or fetching remote configurations. Thanks to @lobaorn-bitso for this contribution!
Documentation
- Clarified that the
fix:commit type is specifically for CLI bug fixes, not for CI, docs, or infrastructure changes (#649)
For full documentation, visit hk.jdx.dev.
Changelog
1.34.0 - 2026-01-27
🚀 Features
🐛 Bug Fixes
- use system CA certificates for HTTPS requests by @lobaorn-bitso in #650
📚 Documentation
New Contributors
- @lobaorn-bitso made their first contribution in #650
v1.32.0
This release brings a refreshed look to the hk documentation site with a new fishing hook logo, electric blue color scheme, and nautical-themed feature descriptions. We've also fixed an issue that caused commands like hk completion bash to fail when run in directories with invalid configuration files.
Highlights
- New branding and documentation refresh - The documentation site has been completely updated with a new fishing hook logo, electric blue color scheme, and improved homepage layout. The "Why Choose HK?" section now features nautical-themed descriptions that match the hook branding, with titles like "Shipshape," "Tackle Box," and "All Hands on Deck." Three new feature cards highlight Pkl Configuration, Mise Integration, and Parallel Execution. (#616, #617) by @jdx
Bug Fixes
- Fixed completion and version commands in invalid config directories - Commands that don't need configuration (
hk completion,hk usage,hk --version) now work even when run in a directory with an invalidhk.pklfile. This fixes Homebrew bottle test failures and improves the experience when setting up shell completions. (#615) by @jdx
v1.31.0
1.31.0 - 2026-01-19
🚀 Features
- (asciidoctor) add asciidoctor config to hk builtin config by @hituzi-no-sippo in #604
🐛 Bug Fixes
- glob syntax for linters in getting_started.md by @makp0 in #593
- docs builtins generation by @makp0 in #606
- make pkl:dist task executable by @joonas in #607
- prevent docs build from silently failing when pkl:gen is skipped by @jdx in #609
- add ci-nogit to final job dependencies by @jdx in #611
🚜 Refactor
- break up step.rs into modular components by @jdx in #610
- move LLM release notes to GitHub release workflow by @jdx in #608
New Contributors
v1.29.0
Release Summary
Version 1.29.0 brings significant improvements to hk's linting capabilities with 10 new built-in linters and enhanced support for Lua and Protocol Buffer development. The release also introduces smarter fix application using git apply for better handling of diff-based fixes, making the auto-fix workflow more reliable across different tools.
This release showcases the power of community contributions, with most new features coming from external contributors, particularly @hituzi-no-sippo who added extensive linting support for various ecosystems.
Highlights
Expanded Linting Coverage
We've added 10 new built-in linters to help you maintain code quality across more languages and tools:
- GitHub Actions:
ghalintfor linting GitHub Actions workflows (@hituzi-no-sippo, #551) - GitHub Actions Security:
zizmorfor security scanning of GitHub Actions (@hituzi-no-sippo, #550) - GitHub Actions Optimization:
pinactto pin GitHub Actions to specific commits (@hituzi-no-sippo, #552) - Documentation:
valefor prose linting (@hituzi-no-sippo, #554) - YAML:
rumdlandrylfor YAML validation (@hituzi-no-sippo, #541, #543) - Lua:
selenefor Lua code analysis (@hituzi-no-sippo, #544) - Protocol Buffers:
buf_lintandbuf_formatfor Protobuf files (@joonas, #562, #565) - EditorConfig:
editorconfig-checkerto enforce EditorConfig rules (@hituzi-no-sippo, #557)
Better Language Support
- Added Lua file type support, enabling all Lua-specific linters to work seamlessly (@hituzi-no-sippo, #558)
- Added Pkl configuration language file type support (@hituzi-no-sippo, #571)
Improved Fix Application
The check_diff command output is now applied directly using git apply, providing more reliable fixes when tools output unified diffs. This particularly improves the experience with formatters like stylua (@jdx, #561).
Enhancements
- Rust Development: Added
cargo fixsupport to thecargo_checkbuiltin, allowing automatic fixes for compiler warnings (@thejcannon, #555) - Lua Formatting:
styluanow usescheck_diffmode for better performance and reliability (@hituzi-no-sippo, #563)
Bug Fixes
- Fixed
rubocopfix command to work correctly (@hituzi-no-sippo, #572) - Fixed
jqbuiltin and removed its non-functional check command (@thejcannon, #533, #549) - Added missing
check_list_filessupport tocargo_fmtbuiltin (@thejcannon, #542) - Resolved configuration key inconsistencies between
settings.tomlandConfig.pkl(@thejcannon, #539) - Fixed task file regex commands (@thejcannon, #534)
v1.28.0
The v1.28.0 release brings performance improvements through smarter configuration caching and fixes several important bugs. Configuration handling has also been simplified to make hk easier to use and maintain.
Highlights
Faster Performance with Config Caching - hk now caches configuration based on active imports (#531), significantly speeding up repeated runs. This is especially noticeable in larger projects with complex configurations. Thanks to @thejcannon for this optimization!
Simplified Configuration - The Pkl configuration system has been streamlined (#517), particularly around regex handling. The deprecated Types.pkl file can now be removed from your projects. This makes writing and maintaining hk configurations more straightforward. See the configuration docs for the updated approach.
Bug Fixes
yq Format Checking - The yq builtin now properly validates YAML formatting by using diff comparisons (#507). Previously, format checks could miss certain style inconsistencies. Your YAML files will now be checked more thoroughly for proper formatting. Thanks @thejcannon!
Workspace Testing - Fixed an issue where hk test didn't work correctly with the workspace_indicator setting (#532). Multi-workspace projects can now run tests reliably. Credit to @thejcannon for the fix!
New Contributors
Welcome to @muzimuzhi who made their first contribution in #520!