Skip to content

Instantly share code, notes, and snippets.

View iftheshoefritz's full-sized avatar

Fritz Meissner iftheshoefritz

  • Cape Town, South Africa
View GitHub Profile
#!/usr/bin/env python3
"""
Claude Code PreToolUse Hook: Compositional Bash Command Approval
PROBLEM
-------
Claude Code's static permission system uses prefix matching:
"Bash(git diff:*)" matches "git diff --staged" but NOT "git -C /path diff"
"Bash(timeout 30 pytest:*)" matches that exact timeout, not "timeout 20 pytest"