Bash "ask" rules stop prompting under --dangerously-skip-permissions, contradicting the documentation
Status Open
Reported on v2.1.278
Maintainer reply None cached
Activity 1 comment · opened Sep 20, 2026
Expected behavior (per code.claude.com/docs/en/permissions and code.claude.com/docs/en/permission-modes)
- An ask rule wins over an allow rule: "a matching ask rule prompts even when a more specific allow rule also matches the same call".
- Bypass does not override ask: "Claude Code doesn't auto-approve the following in any mode, including
bypassPermissions", with "Tools matched by an explicit ask rule" as the first item in the list. Also: "Allow rules have no effect inbypassPermissions". - There is no documented exception for Bash. The listed exceptions are
EndConversationand organization connectors. - Ask/deny rules match even behind a variable prefix: "A deny or ask rule matches past any leading assignment". The docs also warn that ask/deny rules match the command text and that this "isn't a security boundary around the program".
Observed behavior
- With the rules below loaded and visible in
/permissions(Ask tab, all 21 rules complete and correct), commands that match them run with NO prompt at all. - Inconsistency: on the same day, with the same configuration, a plain
git pushdid pause ("Permission rule Bash(git push*) requires confirmation for this command"), and in one round of testspsqlby full path andDATABASE_URL=... npx prisma migratealso paused. After an edit to the rules file (17:33), nothing paused anymore, not even the controls anchored at the start of the command. - Tested and ruled out: approval cache (
psql --version5 times in a row, no change), mode switch (18permission-modeevents, allbypassPermissions), permission environment variables, managed-settings, invalid rules (claude doctorclean), and incomplete reloading of the rules. - Reproduced in a genuinely new session (new process, new session ID), with no rule edits, with
/permissionsshowing the correct rules. - Anticipated objection: the docs list, in the table under "A Bash rule matches the command text", that
Bash(git push *)does not covergit -C . push origin main, and that a rule doesn't cover "the same program invoked in a different form". That does NOT explain this case, because the rules used here were written to cover exactly those forms, and each test command matches rules in the list: - a)
~/.local/bin/psql --versionmatchesBash(*psql*). (A control without a path,psql --version, matchesBash(psql*)and also did not pause.) - b)
git -C <repo> push remoto-que-nao-existe mainmatchesBash(git -C *)andBash(*git*push*).
So the commands are not a "different form" relative to the rules: they are matched by them directly.
Steps to reproduce
- Start:
claude --dangerously-skip-permissions - A
.claude/settings.local.jsonwith, among others:
```
"ask": ["Bash(git commit*)", "Bash(git push*)", "Bash(npx prisma migrate*)",
"Bash(psql*)", "Bash(rm*)", "Bash(*git*commit*)", "Bash(*git*push*)",
"Bash(*prisma migrate*)", "Bash(*psql*)", "Bash(git -C *)",
"Bash(git -c *)", ...] (21 rules in total)
.claude/settings.json
Note: the project's has a broad allow list (60 rules, including Bash(git ), Bash(git commit) and Bash(npx prisma migrate*)) and defaultMode: "bypassPermissions"`.
- Ask the assistant to run, one at a time:
a) ~/.local/bin/psql --version
b) git -C <repo> push remoto-que-nao-existe main
- Result: neither asks for confirmation. (a) prints
psql (PostgreSQL) 17.11 (Postgres.app); (b) fails withfatal: 'remoto-que-nao-existe' does not appear to be a git repository, exit code 128.
Environment
- Claude Code 2.1.278, macOS (Darwin), zsh
- Flag:
--dangerously-skip-permissions - Rules in
.claude/settings.local.json(ask) and.claude/settings.json(allow), both project-level
Impact
- Ask rules used as a safety net (
git push,prisma migrate,psql,rm) are not reliable. The user now depends only on a behavioral rule in CLAUDE.md.
Questions
- Does ask under
--dangerously-skip-permissionshave an undocumented exception for Bash? - Is the intermittent behavior (paused, then stopped pausing, same syntax) known?
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗