I've been adding "never do this" rules to Claude Code for months. I had never checked whether any of them actually worked. Three of the seven I tested didn't, and nothing told me.
Every time I hand more work to an agent, I add another deny rule. "Don't push with --force." "Don't read .env." I wrote them, so I assumed they worked.
Then a line in the notes for a recent Claude Code update (2.1.332) stopped me. Roughly: if you try to add a rule through /permissions that would be skipped at the next startup, Claude Code now refuses and tells you why. Skipped? Most of my rules didn't come from /permissions. I wrote them by hand in settings.json, or asked Claude to write them, and they're already sitting in my projects.
So I wrote seven deny rules on purpose, mixing common styles with common mistakes. Three were skipped without stopping anything: the session started, the exit code was 0, and every other rule still applied. One command per project shows you every skipped rule.
Three of my seven deny rules were silently skipped
In a throwaway folder I made a .claude/settings.json with seven deny rules:
{
"permissions": {
"deny": [
"rm -rf",
"Bash(rm -rf:*)",
"Bash(curl:*)",
"bash(curl:*)",
"WebFetch(evil.example.com)",
"WebFetch(domain:evil.example.com)",
"Read(./.env)"
]
}
}
Then I started Claude Code in that folder. It started fine and answered fine. Exit code 0. Nothing looked off.
But stderr said this (paths shortened):
These settings entries were skipped; the rest of each source is in effect:
.claude/settings.json (permissions.deny): Invalid permission rule "rm -rf" was skipped: Tool names must start with uppercase. Use "Rm -rf"
.claude/settings.json (permissions.deny): Invalid permission rule "bash(curl:*)" was skipped: Tool names must start with uppercase. Use "Bash"
.claude/settings.json (permissions.deny): Invalid permission rule "WebFetch(evil.example.com)" was skipped: WebFetch permissions must use "domain:" prefix. Use "domain:hostname" format
Three of seven, gone:
-
rm -rfhas no tool name. Claude Code reads the whole thing as a tool called "rm -rf". Funny detail: the hint saysUse "Rm -rf", which is just as wrong. What you actually want isBash(rm -rf:*). -
bash(curl:*): tool names are case-sensitive. It'sBash. -
WebFetch(evil.example.com): WebFetch rules need thedomain:prefix, soWebFetch(domain:evil.example.com).
So the version of me who wrote bash(curl:*) thought curl was blocked, and it wasn't blocked at all.
What scares me is how quiet it is. The other rules keep working, so everything behaves normally. There's no moment where you'd notice. In a real setup the stderr line scrolls by once at startup, if you even see it.
If you've ever written settings by hand, this is worth a minute. I've been surprised by this kind of quiet config problem before. This one was about an API key that ended up in plain text:
One command shows every skipped rule
Run this in the project folder:
claude -p "ok" --allowedTools Read < /dev/null 2>&1 | grep "was skipped"
- No output: every rule Claude Code loads for that project is in effect.
- Output: each line tells you which rule was skipped, why, and (usually) how to write it.
The < /dev/null matters. Without it, claude -p waits about three seconds for stdin before it runs. --allowedTools Read keeps the test run read-only, so you're not handing a fresh session any power just to check its settings.
It reports on the settings Claude Code loads for that folder, so run it once in each project you care about.
I ran it on three of my side projects, which had 71, 9 and 34 rules. Zero skipped. I was relieved. But I want to be honest about what changed: before, my confidence was "probably fine". After, it was "checked".
Claude found the same three, plus one thing I missed
I also tried the lazy route: asking Claude Code to read the broken test file and find the mistakes, without changing anything.
It found the same three rules, explained each one, and gave the correct form. It said the other four were written correctly. It even added a fair warning I hadn't thought about: Bash(curl:*) only blocks commands that start with curl, so a command that calls curl some other way can slip past. Same result as the command, plus one useful extra.
The prompt is at the end. The command is still what I'd trust first, because it shows what Claude Code actually loaded. The prompt is nice when you want explanations, or want to tidy up while you're there.
Three mistakes cause the skipped rules
If you'd rather eyeball your settings, these are the patterns that got skipped for me:
-
No tool name.
rm -rf,git push --force. Wrap it:Bash(rm -rf:*). -
Lowercase tool name.
bash(...),read(...),webfetch(...). UseBash,Read,WebFetch. -
WebFetch without
domain:.WebFetch(example.com)becomesWebFetch(domain:example.com).
Rules written by an AI deserve the same check. Mine came out right, but I can see how a model would happily write bash(curl:*). It looks perfectly reasonable.
What I'd keep from all this:
- A malformed permission rule is skipped silently. The rest keep working, so you won't notice
- The usual mistakes: no tool name, a lowercase tool name, WebFetch without
domain: - One command per project tells you. Write a rule, then check that it took effect
Over to you: what's the one deny rule you'd never run an agent without? Tell me in the comments. I'm curious what other people consider non-negotiable.
If you'd rather have Claude check it for you, paste this in your project. It only reads:
Read .claude/settings.json in this project and check every rule under "permissions".
Find any rule Claude Code will silently skip because of how it is written. Do not change any files.
One line per problem: rule | why it is skipped | correct form.
Related: deny rules cover what the agent does. Skills are a second door, because they can run commands before Claude even reads them. I wrote about gating those here:
If you want that gate set up for you, it's a $9 skill: skill-gate on Gumroad.
🎁 New here? Start with my free skill: mcp-key-check finds the API keys your MCP setup left in plain text and prints the commands to fix them. Pay what you want, $0 is fine.
If this was useful, a ❤️ and a follow would mean a lot. I write about what actually happens when I put AI to work on my side projects.
The experiments and numbers in this post come from my own projects. I wrote it with the help of AI (Claude).
Top comments (5)
Your seven-rule file gave me the same three skipped lines on Claude Code 2.1.337, with
--model haikuadded. My own settings printed none, across 25 deny and 60 ask rules at user level and the allow lists in two repos.The deny rule I'd keep is force push, as four rules:
--forceor-f, right after push or at the very end. In a scratch repo with a local remote, two headless runs in bypassPermissions mode blockedgit push --force origin workandgit push origin work --force. Both rangit push origin --force work,git push --force-with-lease origin workandgit push origin +workunblocked, though there was nothing new to push.The scary part is that everything looked fine: exit code 0, session started, and three deny rules were silently gone. Testing a deliberately broken set like this is a good habit, and the stderr listing of skipped entries is worth grepping for. It also makes the remaining human-in-the-loop prompts matter more; Kiteline (open-source, GitHub hon6/kiteline) shows each permission request with its exact command on a phone, which at least keeps what's actually being asked visible.
Your one-command check is the part I'm keeping — but there's a gap it doesn't close, and jacksonxly's force-push test just above shows it. The skip check only catches rules Claude Code refuses to load. Bash(curl:*) loads fine and still lets curl through whenever curl isn't the first word, and your own Claude check caught exactly that. Same story with force push: jacksonxly's four rules cover --force and -f in two positions, yet --force in the middle, --force-with-lease and +work all went through unblocked. So 'zero skipped' across your 71, 9 and 34-rule projects tells me the rules parse, not that they enforce. The second check that matters is the negative test in a scratch repo: actually try the forbidden thing and watch it get blocked. I'm running both checks on my own settings today — skip-check first, then one forbidden command per rule that guards something destructive. Of the three rules that were skipped in your test file, which one had been sitting in your real settings the longest before you caught it?
The exit code 0 detail is the part that stayed with me — three rules silently gone while everything else behaved normally. That is why I try not to trust a guard just because I wrote it down. In my own small setup, Claude Code does the building, and then I ask ChatGPT to look at only the finished work, not to re-solve the task from scratch, so the second look judges what actually happened. Your one-command check feels like the same idea in a smaller form: ask the tool to show what it really loaded. Do you re-run that check after editing a rule, or only when you set up a new project?
exit code 0 and three rules just... not there?? that's the scary kind lol. my rule is no writes to generated files btw, an agent edited generated output on me once, still not over it xD checking my settings tonight, thanks for the command :D