Skip to content

fix(hooks): make bash-guard's docs block and warnings take effect - #37

Merged
smypmsa merged 1 commit into
mainfrom
fix/bash-guard-exit-codes
Nov 9, 2026
Merged

smypmsa merged 1 commit into
mainfrom
fix/bash-guard-exit-codes

Conversation

@smypmsa

@smypmsa smypmsa commented Nov 9, 2026

Copy link
Copy Markdown
Member

Claude Code treats a hook's exit 1 as a non-blocking error and never shows Claude stderr from a hook that exits 0. So bash-guard.py's docs/*.md block didn't block, and its transaction and mainnet warnings never reached Claude.

  • The git add docs/*.md block exits 2.
  • Warnings go back as JSON additionalContext; the command still runs.
  • test-hooks.sh checks stdout and stderr, and covers both cases. CLAUDE.md describes the hook as it now behaves.

Closes #25

Claude Code treats exit 1 as a non-blocking error and ignores stderr on
exit 0, so the docs/*.md block let the command run and Claude never saw the
transaction warnings. The block now exits 2 and the warnings go back as
additionalContext.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@smypmsa
smypmsa merged commit bbc5641 into main Nov 9, 2026
7 checks passed
@smypmsa
smypmsa deleted the fix/bash-guard-exit-codes branch November 9, 2026 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bash-guard.py: the docs/*.md block exits 1, so Claude Code runs the command anyway

1 participant