You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Show & tell: claude-bulkhead, a Pi extension that blocks rm -rf on an empty $VAR, xargs-split deletes and pkill of other sessions
#12161
claude-bulkhead started as PreToolUse hooks for Claude Code, and as of 0.5.0 the npm package is also a Pi package. The extension runs on Pi's tool_call event for the bash and powershell tools and returns { block: true, reason } for a short list of commands that cannot be undone, so the model gets the reason and the safe form back as the tool result and usually rewrites the command on its own.
pi install npm:claude-bulkhead
What it blocks, each taken from an accident someone reported this autumn:
rm -rf $D/, rm -rf "$BUILD_DIR"/* and rsync -a --delete src/ $R/ when the variable can come out empty (it suggests "${D:?}")
rm -rf "$(cygpath -u 'C:\')" and other paths that resolve to a drive root, home, or a whole app-data folder such as ~/Library/Application Support
find ... | xargs -n1 dirname | xargs rm -rf, where a space in a path makes dirname return a parent (it suggests -print0 | xargs -0)
rm -rf .git on an existing repository
Remove-Item -Recurse (Split-Path $home) in PowerShell, where $home is the automatic variable for the user profile
pkill -f node or killall node when the pattern also matches processes from other agent sessions or desktop apps
git add -A and branch switches in a tree another session is editing, and starting a dev server on a port another session already uses
You can check any command without installing it; nothing is executed:
It reads the command text, so a delete inside a script the agent wrote and then runs is not seen. MIT, no dependencies, Node 18+. Repository: https://github.com/dooly6276/claude-bulkhead
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
claude-bulkhead started as PreToolUse hooks for Claude Code, and as of 0.5.0 the npm package is also a Pi package. The extension runs on Pi's
tool_callevent for thebashandpowershelltools and returns{ block: true, reason }for a short list of commands that cannot be undone, so the model gets the reason and the safe form back as the tool result and usually rewrites the command on its own.What it blocks, each taken from an accident someone reported this autumn:
rm -rf $D/,rm -rf "$BUILD_DIR"/*andrsync -a --delete src/ $R/when the variable can come out empty (it suggests"${D:?}")rm -rf "$(cygpath -u 'C:\')"and other paths that resolve to a drive root, home, or a whole app-data folder such as~/Library/Application Supportfind ... | xargs -n1 dirname | xargs rm -rf, where a space in a path makesdirnamereturn a parent (it suggests-print0 | xargs -0)rm -rf .giton an existing repositoryRemove-Item -Recurse (Split-Path $home)in PowerShell, where$homeis the automatic variable for the user profilepkill -f nodeorkillall nodewhen the pattern also matches processes from other agent sessions or desktop appsgit add -Aand branch switches in a tree another session is editing, and starting a dev server on a port another session already usesYou can check any command without installing it; nothing is executed:
It reads the command text, so a delete inside a script the agent wrote and then runs is not seen. MIT, no dependencies, Node 18+. Repository: https://github.com/dooly6276/claude-bulkhead
All reactions