Hooks see the command, not what a script does.
If the agent writes https://t.co/RMNrMxtGlH and runs it, the hook sees bash https://t.co/RMNrMxtGlH. So: deny rules for the obvious, ask rules before running new scripts, and a real sandbox where a mistake would really hurt.
Your agent can read .env as easily as README.md. One cat and your keys are sitting in the transcript.
The free Sudo Supply hooks deny reading .env and stop secret leaks. Claude Code, MIT, open source:
https://t.co/TYwWnYII3b
What happens when your guardrail hook crashes?
If the answer is "the command runs anyway," it's not a guardrail. Break it on purpose: put a syntax error in the hook script, then ask the agent for something harmless. It should get blocked, not waved through.
The AI Agent Guardrails Kit ($29) is hooks plus permission rules for Claude Code. It blocks rm -rf ~, force-pushes and reading .env, and asks first before sudo or recursive deletes.
Guardrails, not a sandbox.
https://t.co/RE0phOYfYH
A guardrails question worth asking: can your agent edit its own guardrails?
If the hook script or settings file is writable by the agent, one "helpful" edit turns them off. Protect the guard files too.
Not everything needs a hard block. "Ask" rules are underrated.
Let the agent run tests and lint freely. Make it stop and ask before sudo, rm -r, or anything touching ~/.ssh.
Friction only where it matters.
Coding agents don't need bad intent to wreck your day. One confident rm -rf in the wrong folder is enough.
I made a free set of Claude Code hooks that blocks the worst commands and stops secret leaks. MIT, open source:
https://t.co/TYwWnYII3b
A line in CLAUDE.md is a request. A deny rule or a PreToolUse hook is a rule.
If something must never happen (rm -rf ~, git push --force, reading .env), put it in your settings, not your prompt.
@mevil_bhojani Agreed on the backup point. Two cheap shell habits that would have stopped this one: set -u so an unset variable errors out instead of expanding to nothing, and always quote paths, as in rm -rf "${DIR:?}/build". The :? makes rm refuse to run when DIR is empty.
@LiveLoveSEO Good start. One catch: Bash deny rules match by prefix, so rm -fr, rm -r -f, or bash -c "rm -rf ..." can get past Bash(rm -rf:*). A PreToolUse hook that parses the whole command catches those. Our free hooks are here if useful: https://t.co/TYwWnYIadD
Shipped: a free terminal starter kit.
zsh + Starship + tmux + Neovim (Tokyo Night), plus one install script with --dry-run, timestamped backups and an uninstall that restores them.
macOS + Ubuntu/Debian. Tested on Debian so far.
https://t.co/QIOfgZckjA
What my $29 agent guardrails kit doesn't do: sandbox your agent, stop a determined workaround, or (yet) have a live Cursor test.
What it does: hooks and deny rules that stop the commands agents usually write, in Claude Code and Cursor.
https://t.co/RE0phOXI99
In zsh, Ctrl-X Ctrl-E opens the command you're typing in your editor. Handy for long one-liners.
It's wired to Neovim in my free terminal starter kit, along with Starship, tmux and an installer that backs up your dotfiles first:
https://t.co/QIOfgZckjA
Gotcha: in Claude Code permission rules, * is a wildcard. So Bash(rm -rf *) in your deny list blocks every rm -rf, including rm -rf node_modules.
My guardrails kit catches a literal * in a hook script instead:
https://t.co/RE0phOYfYH
tmux habit: one named session per project.
tmux new -s api
(detach: prefix, then d)
tmux attach -t api
Your panes are where you left them. In my free terminal kit the prefix is Ctrl-a and `t` attaches to (or creates) a session called main:
https://t.co/QIOfgZckjA
Ran my agent guardrails kit live in Claude Code. I asked the agent to:
read .env: denied
write a fake sk_live key into a file: blocked
git push --force: blocked
Then git reset --hard: stopped by the ask rule.
https://t.co/RE0phOYfYH
Before you run anyone's dotfiles installer: run --dry-run if it has one, and read it if it doesn't. Look for rm -rf on your configs, sudo you didn't expect, curl | sh.
Mine moves old dotfiles to a timestamped backup and never deletes them:
https://t.co/QIOfgZckjA
8/ Kits for core (any stack), Next.js, FastAPI and Go, plus 30 prompts. Python 3.9+, no dependencies. Built with AI assistance and tested by me.
Free MIT core on GitHub:
https://t.co/TYwWnYIadD
Full kit, $29:
https://t.co/RE0phOXI99
1/ Coding agents are fast, sometimes at the wrong thing: git push --force, cat .env, an API key pasted into a test fixture.
I built a guardrails kit for Claude Code and Cursor that puts four layers in the way. Thread:
7/ Limits:
The Cursor config is checked against Cursor's docs but hasn't been run live yet.
These are guardrails, not a sandbox. They stop the commands agents normally write, not a determined workaround. Use a container or VM for isolation.