A Claude Code mod that holds a destructive command and shows you what it would destroy — before it runs.
An animation drawn from the mod's own pane and dialog. A recording from a real session is below.
One bad rm -rf, one force push to the wrong branch, one git reset --hard — and hours of
work are gone. Claude Code's permission prompt tells you what command is about to run.
Tripwire tells you what it would take with it, then waits for your answer.
╭──────────────────────────────────────────────────────────╮
│ ◆ tripwire · Recursive delete │
│ rm -rf build │
│ 17 paths · 56K would be deleted │
│ build │
│ build/index.html │
│ build/chunks │
│ build/chunks/list.js.map │
│ … │
│ Answer in Claude's dialog · Cancel is the default │
╰──────────────────────────────────────────────────────────╯
tripwire · 17 paths · 56K would be deleted
rm -rf build
1: Cancel 2: Proceed
Inside Claude Code:
/plugin marketplace add flaviorg/tripwire
/plugin install tripwire@tripwire
Then start a new session, or run /reload-plugins. Tripwire is also listed in my
claude-mods marketplace with my other mods.
| Command | What the pane shows | |
|---|---|---|
| ● | rm -r / rm -rf / rm with a glob |
How many paths and how much disk space, with the first 30 paths |
| ● | git push --force, -f, --force-with-lease |
The remote commits that would be overwritten |
| ● | git reset --hard |
The changed files that would be discarded |
| ● | git checkout -- ., git restore . |
The changed files that would be discarded |
| ○ | git clean -f |
What git clean -n would remove |
| ○ | git branch -D |
The unmerged commits on that branch |
| ● | DROP TABLE / DROP DATABASE / TRUNCATE |
The statement |
| ○ | chmod -R 777 |
The path |
● high severity · ○ medium. Commands are checked segment by segment, so
cd app && sudo rm -rf build is caught and measured inside app/.
- A
tool.callhook sees every Bash command before it runs. Safe commands pass straight through — no delay, no prompt. - A hit runs at most two read-only commands (
find,du,git log,git status,git clean -n) with a 2-second timeout each to measure the damage. - The pane opens with the blast list, and Claude's question dialog asks Cancel / Proceed. Cancel is first and is the default.
- Proceed lets the command continue to Claude Code's normal permission check.
Anything else — Cancel, a typed answer, a dismissed dialog, a headless
claude -prun — denies it, and Claude reads why. - If tripwire itself fails before deciding, the command is denied. It fails closed.
Tripwire is a safety net, not a permission system: keep your normal permissions on.
| Command | What it does |
|---|---|
/tripwire |
Lists the rules and every command held in this session, with your decision |
Set them with /plugin configure tripwire@tripwire:
| Option | Values | Default | What it does |
|---|---|---|---|
mode |
ask, deny, off |
ask |
deny refuses hits without asking; off disables the guard |
extraPatterns |
comma-separated regexes | (empty) | Extra commands to hold, e.g. terraform destroy,kubectl delete |
allowPaths |
comma-separated folder names | (empty) | Folders rm -rf may delete without a hold, e.g. dist,build,.cache |
Tripwire reads no files of yours and makes no network requests. On a hit it runs read-only
find, du and git commands in your working directory. You can confirm this before
installing:
claude plugin validate ./tripwireThe calls: line lists every mods API call it makes.
Tested with Claude Code 2.1.296 in the terminal and the Desktop app's Code tab. Mods need
Claude Code 2.1.287 or later. In claude -p runs nobody can answer the dialog, so a hit is
denied.
claude plugin validate --strict . # manifest, hooks and calls
claude plugin test . # 26 tests, no session or sign-in needed
claude --plugin-dir . # try it in a session; edits hot-reloadInspired by Anthropic's blast-radius sample mod; written from scratch against the public
mods API.
MIT © flaviorg
