Pretooluse Gate Guard
Path:
loom-builder/.claude/hooks/pretooluse_gate_guard.pyRelative: .claude/hooks/pretooluse_gate_guard.pySubproject: loom-builderCategory: otherLines: 105Bytes: 3,779Imports: 5Exports: 4
Content Preview
- #!/usr/bin/env python3
- """pretooluse_gate_guard.py — Claude Code PreToolUse hook enforcing N15.
- Blocks Edit/Write/MultiEdit/NotebookEdit targeting a MANIFESTED file under
- gates/v*/ , and Bash commands that would mutate one. New files in new version
- dirs are always allowed — that's the sanctioned flow.
- Mechanism: prints hookSpecificOutput.permissionDecision="deny" and exits 0.
- JSON deny is used instead of bare exit-2 because exit 2 has a known
- unreliability with Write/Edit blocking (anthropics/