Repository navigation
v2.4.6
The hooks-trust release. Heimdall's hooks no longer run scripts from the repo a session happens to be in: with CLAUDE_PLUGIN_ROOT unset they did, so a cloned repo could run its own code on every tool call. Roots now come only from CLAUDE_PLUGIN_ROOT or ~/.heimdall, and the push gate catches git push however it is written. A linter that fails to run is reported as a tool error instead of as findings, and heimdall-stop-lint works with ESLint 9.
2.4.5 was a GitHub-only release and never reached npm; take 2.4.6 instead.
Security
- Hooks never run scripts from the session's repo —
hooks/hooks.jsontook the plugin root fromCLAUDE_PLUGIN_ROOTor, with that unset, from the git toplevel of the current directory, so all 49 hook commands executedbin/<script>out of whatever repo the session was in (andbin/lib/hook-enabled.shwas sourced from it). A cloned repo that shipped a script under a hooked name therefore ran its code on every tool call. Every hook command now takes its root only fromCLAUDE_PLUGIN_ROOTor the install at~/.heimdall, never from the working directory: no path derived from the cwd can be trusted, and a marker inside a repo is forgeable by any repo. The hook-enabled lookup and the caveman and checkpoint copy-paste snippets follow the same rule. When no root resolves, the Bash and Agent prechecks, the credential filter, the credential-read guard and the lint-config guard fail open with oneUNCHECKEDline on stderr (the gates are Heimdall's own repo policy, there is nothing of Heimdall's to run in a foreign repo, the native pre-push hook and CI stay the backstop, and failing closed would block every call), while the Write/Edit stub gate stays fail-closed. Test:test/hooks-no-cwd-exec.test.shruns every hook command in a clone with a planted script for each hooked name; none of them runs. - The push gate catches
git pushin any form —bin/heimdall-precheck-bashmatched only a command line that started withgit push, so its quality-gate check did not seegit -C <dir> push,cd <dir> && git push,make; git push,FOO=1 git pushorsh -c 'git push'. It now matchesgitas a command word after separators, env assignments, wrapper words, subshells andsh -c, with global options such as-C <dir>. Text that only mentions a push,git stash pushandgit pushdstay ungated. Tests:test/heimdall-precheck-bash.test.shcases 17 and 25-29.
Fixed
- A precheck deny says why —
bin/heimdall-precheck-bashwrote its deny verdict to stdout and exited 2, and Claude Code shows only stderr for an exit-2 hook, so a legitimate quality-gate deny (tests not passing, lint not clean, no sweep receipt) appeared as "hook error ... No stderr output". The verdict is now stated on stderr too, asprecheck-agentand the stub gate already did. The same change fixed a latent failure: withCLAUDE_PLUGIN_ROOTunset, the Bash and Agent hooks took the cwd repo as the plugin root and exited 127 on every call in any repo that is not Heimdall's; they now fail open with one stderr line (see Security). - stop-lint works with ESLint 9 and lints only the repo — ESLint 9 removed the
unixformatter, so everyeslint -f unixcall exited 2 and was counted as a lint finding:lint_cleanflipped false (46 phantom findings in one repo) and the push gate blocked although ESLint over the whole repo was clean.bin/heimdall-stop-lintnow reads-f jsonthrough--output-file(core in ESLint 8 and 9, and Node's stderr noise cannot corrupt the report). An ESLint that fails to run (config error, crash, missing interpreter) is a tool error, not findings: reported loudly with its own diagnostics, counted in the receipt'stool_errors, the run marked incomplete andlint_cleanleft as it was, a non-verdict like a timeout, because red would fake findings and green would fake evidence. It also lints only files inside--repo:.claude/worktrees/,.heimdall/,node_modules/and anything outside the repo (the Claude scratchpad,TMPDIR, other checkouts,..escapes) are dropped and the receipt records what was excluded, so stale agent worktrees no longer burn its 60 s budget. Test:test/heimdall-stop-lint.test.sh. - Biome, ruff, shellcheck and tsc failures are tool errors too — a non-zero exit was read as findings for all of them, but the codes differ: shellcheck 2-4 and ruff 2 and 101 are failures, and biome exits 1 for findings and for a config error, so a broken config or flag showed up as phantom findings and turned
lint_cleanred.shellcheck -f json,ruff --output-format jsonandbiome --reporter=jsonare now read from stdout (stderr kept apart); exit 1 with at least one problem in the report is a finding, counted from the report. Anything else (exit 2 or higher, a crash, a bad flag or format, an unreadable report, ruff's E902, biome'sinternalError, a missing binary or interpreter) is a tool error, handled as above.bash -n(exit 126 or 127), the Pythonastcheck (exit 1 without a SyntaxError) andtsc(no file-located diagnostic) draw the same line. Tests: fake binaries per tool (clean, findings, config error, crash, bad flag, silent, missing interpreter) in bothlint_cleanstates, plus the real shellcheck and ruff, intest/heimdall-stop-lint.test.sh. - The zero-footprint test no longer waits on a published release tag — its real-
hmdandnpxcases ran the wrapper against the checkout'shmd, whose--versionresolves from the nearest git tag. In a release's own pre-push sweep the new tag does not exist yet, so thathmdlooked older than the pin and the wrapper fetchedinstall.shfrom the unpublished tag (HTTP 404): the release gate could never go green. Those cases now pin the wrapper to the version the checkout'shmdreports (RUNHMD_TAG) and hand it a tripwire installer (RUNHMD_INSTALL_SCRIPT) that must never be touched; the tree's owninstall.shis served from disk, where a tampered copy is refused under the genuine digest, the genuine one is verified, and a mutant without the digest check goes red. The shipped wrapper is unchanged. Test:test/zero-footprint.test.sh.
Changed
--wait-quietis documented —CLAUDE.mdnow says when to use the opt-in quiet gate of the full sweep: on a shared, busy machine, to start it on a settled box. The wait is relative and bounded (the 15-minute load average belowHMD_QUIET_FACTOR, default 1.5, times the CPU count on 3 consecutive 30 s checks; it gives up afterHMD_QUIET_MAX_WAIT_S, default 1200 s, and the sweep then runs with half the jobs andHMD_TEST_REDUCED_PARALLELISM=1). It also says not to block a sweep on an absolute load threshold, which can stay high for hours and defer the run forever, and to lower--jobson a busy machine instead of waiting.- The old eye-and-H logo assets are removed — the six
hmd-logo-eye-h*files (about 1.8 MB) inlaunch-docs/assets/and theirprovenance.jsonentries are deleted; the README header and the dream bundle already point at the pixel helm. A README published to npm before this release hotlinkshmd-logo-eye-h-mark*.pngfrommain, so its header image stays broken until this release is published.
Full changelog: v2.4.5...v2.4.6
Install/upgrade:
curl -fsSL https://raw.githubusercontent.com/randomittin/heimdall/v2.4.6/install.sh | bashinstall.sh.minisig is the detached minisign signature of this release's install.sh; bin/heimdall-autoupdate verifies it against release/heimdall-signing.pub before applying.