What this thread does
As of November 19, 2026, fix the rule shape first: write Bash(git diff ) with a space before a trailing , keep :* only at the very end of a pattern, and ensure every &&, ; or | subcommand is allowed; built-in read-only commands can already qualify.
Do first: compare your rule with these shapes
From the official permissions page (Anthropic), Bash rule matching:
| Rule | Matches | Does not match |
|---|---|---|
Bash(ls *) | ls, ls -la | lsof |
Bash(ls*) | ls -la, lsof | |
Bash(ls:*) | same as Bash(ls *) | |
Bash(git:* push) | the colon literally: :* is only recognized at the end | git push |
Bash(* --help *) | npm --help x | npm --help |
- Leading variable assignment. Claude Code strips an assignment of certain known-safe variables, so
Bash(npm test *)matchesNODE_ENV=test npm test. An allow rule does not match past an assignment of any other variable, soFOO=bar npm testprompts. A deny or ask rule does match past any assignment. Adaptation, not from the docs: drop the prefix and set the variable another way, for example the settingsenvblock. - Wrappers.
timeout,time,nice,nohup,stdbuf,command,builtinand zshnoglobare stripped before matching.npx,docker exec,direnv execanddevbox runare not, and a prefix rule cannot approve exec wrappers such aswatchorfindwith actions like-exec. Write the full inner command, such asBash(devbox run npm test). - Compound commands. Every subcommand (
&&,||,;,|,&, newlines) must be allowed, either by a rule or as a built-in read-only command.Bash(safe-cmd *)does not allowsafe-cmd && other-cmd. A trailing&&makes the line unparseable for allow matching. - Ask and deny beat allow. A matching ask rule prompts even when a narrower allow rule matches, and a hook that returns allow does not override it. A separate mod handling
tool.checkcan override a rule or hook in sessions with no managed settings, nomanaged-mcp.jsonfile and no Team/Enterprise login used by the session; inspect installed mods if rule precedence seems broken. This requires v2.1.292 or later; plan mode still prevents a mod from approving a call that is not read-only. Rules, hooks and mods. - Argument patterns are fragile. The docs say
Bash(curl http://github.com/ *)missescurl -X GET ...,https://and redirects. Bash deny rules also match command text, so alternate invocation forms can escape that pattern; use the OS sandbox for a filesystem or network boundary. Permission rules and sandboxing.
Then check where the rule lives
- Project
permissions.allowin.claude/settings.jsonapplies only after workspace trust. Local allow rules are not unconditionally immediate: outside the configuration home, Claude Code holds.claude/settings.local.jsonrules until it can classify the file with git. Tracked files and a symlinked.claudecount as repository-supplied. Use usersettings.jsonfor rules intended to apply in every project. Workspace trust and local settings. - "Yes, and don't ask again" can save rules to
.claude/settings.local.jsonat the repository root, up to five, one per subcommand that needed approval; a rule directed to a trackedsettings.local.jsonlasts only for the session and is not saved. Release notes. cdplusgitinto another directory prompts by design.
What one long GitHub issue shows
Issue 11380 (opened 2025-11-10 by Jkrise) gathers reports of prompts despite allow rules. No single root cause is stated. Commenters ask whether two fixes in the v2.1.76 release notes (Bash(cmd:*) with a quoted #, and the don't-ask-again dialog for compound commands) were the fix; some say it persisted. Single-user reports from the thread, not confirmed by Anthropic:
- An empty
allowedToolsarray in~/.claude.jsonfor the project overrode the rules on macOS; fixing it solved it. - Writes under
.claude/prompted even inbypassPermissionsin one commenter's report; the docs say bypass mode skips prompts for protected paths, so check your version.
An independent write-up by Agent Island Pro on dev.to (posted Sep 7) lists the same causes (:* only at the end, assignments, subcommands, ask beats allow); it restates the official page and is not separate evidence of fixes.
Limits
Rule syntax comes from the permissions reference; the issue fixes are individual reports. Exact matching depends on the installed version.
Not for: proving a permission hook really blocks a command, see test-permission-hook-with-canary-before-trusting; a cd plus git compound prompt only, see claude-code-cd-compound-bash-permission-prompt.
Started from a post by @Jkrise, packaged by the editor. Original post