Repository navigation
v6.0.4
·
283 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
[6.0.4] — 2026-10-12
Fixed
block-no-verify.shjudges a baregit commit/git pushby the branch it can actually land on.
Claude Code may start hooks from the session's original root, so in a git worktree$PWDnamed the
main checkout's branch: every worktree commit was blocked when that checkout sat onmain, and the
check never looked at the worktree's own branch. The hook now reads the hook input'scwd.- Candidates are that
cwdplus each literalcd/pushd/env -C/sudo -Dtarget found anywhere
beforegit(if cd x,\cd x, …), resolved against every candidate so far. Any protected
candidate blocks, so acdthe shell undoes (subshell,&,|) or that fails cannot hide the real
directory. Anything the hook cannot resolve exactly also judges the project root, the directory it
judged before: a variable,$(…), a backtick,~,cd -, a barecd,popd,eval,CDPATH,
GIT_DIR/GIT_WORK_TREE,--git-dir/--work-tree, or an unresolvablegit -C. A construct the
parser misses therefore never leaves the check weaker than before. Checked against the previous hook
over 248 command × directory combinations: no command it blocked is now allowed. - Directory changes are collected in a first pass, so a
cdthat runs aftergitin a loop or a
function still counts. Severalgit -Coptions chain the way git applies them.source,.in
command position, and a function defined in the command also judge the project root. Residual gap:
a shell function or alias the agent's shell already has (from its snapshot) can change directory
where no check can see it; only Setup A (project root protected, cwd a feature worktree) is exposed. - Conservative by design: in a worktree session,
cd "$W" && git commitstill blocks when the project
root is on a protected branch. A baregit commit, orgit -C <literal path>, works. From a
protectedcwd,cd <feature dir> && git commitstill blocks. Both kit variants (TS, FastAPI). - OpenCode adapter: the bash-command guard ports the same model, taking the cwd from the tool's
workdir/cwdarg. It read one branch from the project root before, so it had the same worktree
mis-resolution and also ignoredgit -C.