Claude Code "Don't Ask Again" (2026): What It Saves and the Risks

Short answer: When you pick "Yes, and don't ask again" on a Claude Code Bash prompt, Claude Code saves a permanent allow rule, usually a command prefix such as npm test *, to .claude/settings.local.json at the root of your git repository. The rule applies to every future session in that repository, including subdirectories and worktrees. The risk is that a prefix rule allows more than the one command you saw, so keep rules narrow and review them with /permissions.

Unofficial guide. Antigravity Skills is not affiliated with Anthropic. The official source is the Claude Code permissions documentation. Facts below were checked against it and the settings documentation on November 13, 2026.

Want a second pair of eyes before you trust a command? Our Security Audit Skill makes your agent review code and commands evidence-first and run them only in a sandbox. Each download uses 1 credit, and new accounts get 1 free credit.

What "don't ask again" actually saves

Prompt typeWhat "don't ask again" doesHow long it lasts
Bash commandSaves an allow rule for the command, usually as a prefix with a trailing wildcard (for example npm test *)Permanent for that repository and command
WebFetchSaves an allow rule for that domainPermanent for that repository and domain
File editsAllows edits without askingUntil the session ends; it isn't saved to the file
  • Where it is saved: .claude/settings.local.json at the root of the git repository. In a worktree, Claude Code uses the main checkout's root. Claude Code adds this file to your global git excludes the first time it writes it, so it is not committed by accident.
  • Compound commands: for something like git status && npm test, Claude Code saves a separate rule for each subcommand that needed approval, up to 5 rules.
  • When the option is missing: Claude Code only offers "don't ask again" when the prompt can show you everything the rule would allow.

The risks

  1. A prefix allows more than one command. The prompt might say "don't ask again for: npm test *". That rule also allows any arguments after npm test. The docs note that Bash(git *) "allows every git command", not just the one you approved.
  2. Runners pass anything through. Wrappers like npx, docker exec and devbox run are not stripped before matching, so a rule like Bash(devbox run *) "matches whatever comes after run."
  3. Rules outlive the moment. A rule you approved in a hurry applies to every later session in that repository until you remove it.
  4. Deny rules are not a security boundary. The docs say a deny rule such as Bash(curl *) doesn't stop /usr/bin/curl or sh -c 'curl …'. For real enforcement, Anthropic points to sandboxing.
  5. Network access can leak through Bash. Limiting WebFetch alone doesn't prevent network access. If Bash is allowed, Claude can still use curl or wget.

Safer habits

  • Approve the narrowest rule. Prefer Bash(npm run test *) over Bash(npm *), and avoid approving runners such as npx * or docker exec * permanently.
  • Review your rules regularly. Run /permissions to see every rule and the file it comes from, and remove the ones you no longer need.
  • Use plan mode to explore. In plan mode Claude reads files and runs read-only commands without editing your source.
  • Keep bypass mode in a sandbox. Anthropic says to use bypassPermissions "only in isolated environments like containers or VMs where Claude Code can't cause damage."

How to remove a saved rule

  1. Run /permissions in Claude Code.
  2. Find the rule. The dialog shows which settings file it comes from.
  3. Remove it in the dialog, or delete the line from .claude/settings.local.json. Changes apply from Claude's next tool call, with no restart.

FAQ

Where does Claude Code save "don't ask again"?

In .claude/settings.local.json at the root of your git repository. Outside a git repository and in some other cases, it uses .claude/settings.json instead.

Does "don't ask again" apply to all my projects?

No. Bash and WebFetch rules are saved per repository. They apply to every session in that repository, including subdirectories and worktrees, but not to other projects.

Does "don't ask again" for file edits last forever?

No. For file edits it lasts until the session ends and isn't saved to the settings file.

How do I undo "don't ask again" in Claude Code?

Run /permissions, find the rule and remove it, or delete it from .claude/settings.local.json.

Is "don't ask again" the same as --dangerously-skip-permissions?

No. "Don't ask again" saves one rule for one command prefix. Bypass mode skips permission prompts for nearly everything, and Anthropic recommends it only in isolated containers or VMs.

Sources