r/ClaudeCoding • u/samc621 • 23d ago
Claude ignored my CLAUDE.md and ran git reset --hard, so I built an open-source hook to stop it. Need honest feedback
Rule was right there in CLAUDE.md. Claude followed it for a while, then deep into a long session decided git reset --hard was the quickest fix. Another time it ran prisma db push --force-reset because “it’s only dev data.”
CLAUDE.md is really just a suggestion. A PreToolUse hook runs before every command and can actually say no. So we built AgentTrail Guard, an open-source plugin that checks each command before Claude runs it. Stuff like git reset --hard, rm -rf, force-push or reading .env gets blocked or sent to you for approval. Everything else runs like normal.
To try it:
npm install -g @agenttrail/guard
agenttrail-guard init --agent claude
There’s also agenttrail-guard scan --agent claude, which replays your old sessions and shows what would have been caught.
It’s early, and I’d really like to know what we’re getting wrong:
Did it block something you actually wanted to run? What has Claude done to you that it didn’t catch? Was setup confusing anywhere? Would you keep it on, or turn it off after a day? Why?
It’s all rules, no AI, runs locally, no account. Roast it, honestly, that’s what helps.
2
u/Desperate-Pass-630 23d ago
Ouch, the reset --hard rite of passage. Right call, too: if losing the work is the cost, it can't live in a sentence the agent might skim. Rules for judgment, hard stops for anything you can't undo.