Workbranch › Guides
GuideHow to manage permissions in Claude Code
Claude Code asks before it runs commands or edits files, and too many prompts slow you down while too few can be risky. This guide explains the prompts, the permission modes and the rules you can save, so you approve the routine work once and keep the dangerous parts blocked.
Quick answer: answer each prompt with Yes, Yes, and don't ask again or No, and press Shift+Tab to switch modes such as accept edits or plan. To approve routine commands for good, type /permissions or add allow rules like Bash(npm run *) to .claude/settings.json, and add deny rules like Read(./.env) for things Claude must never touch.
This follows Anthropic's Claude Code documentation as of October 2026. New to Claude Code? Start with how to get started with Claude Code.
What Claude Code asks about
| Action | Asks in Manual mode? | "Don't ask again" lasts |
|---|---|---|
| Reading files, searching | No, inside your working directories | Not needed |
| Shell commands | Yes, except a built-in set of read-only ones | Permanently, per repository and command |
| Editing or writing files | Yes | Until the session ends |
| Fetching a web page | Yes, except some documentation sites | Permanently, per repository and domain |
| Web search | Yes | Permanently, per repository |
A prompt shows what Claude wants to do and your options. On most prompts you can move to Yes or No and press Tab to add a comment; with No, the comment reaches Claude as your reason and Claude keeps working with it in mind.
Pick a permission mode
Press Shift+Tab during a session to cycle through modes; the status bar shows which one is on. You can also start in one with claude --permission-mode plan.
| Mode | What it does | Use it when |
|---|---|---|
Manual (default) | Asks the first time each tool is used | You want to see everything |
Accept edits (acceptEdits) | Applies file edits and simple file commands like mkdir or mv in your project without asking | You trust the task and will review the diff |
Plan (plan) | Explores and proposes a plan; no edits until you approve it | Big or unclear changes |
Auto (auto) | Skips routine prompts; a background classifier checks commands and network requests against your request | Longer tasks with fewer interruptions |
Don't ask (dontAsk) | Refuses anything that would prompt, runs only what's pre-approved | Locked-down scripts and CI; not in the Shift+Tab cycle, start it with --permission-mode dontAsk |
Bypass (bypassPermissions) | Skips prompts, including for protected folders such as .git | Only in an isolated container or VM |
Recent versions start interactive terminal and VS Code sessions in auto mode, and it works on all plans, with newer models only. To choose the starting mode yourself, set "defaultMode" under permissions in ~/.claude/settings.json. Auto and bypass set in a project's settings files are ignored, so a repository can't switch them on for you.
Save allow, ask and deny rules
- In a session, type
/permissions. The dialog lists every rule and which settings file it comes from, and lets you add or remove rules. Changes apply from Claude's next action. - Or edit a settings file directly. Shared rules for the team go in
.claude/settings.json(commit it); your own go in.claude/settings.local.jsonor, for every project,~/.claude/settings.json. - Write rules as
ToolorTool(pattern):Bash(npm run *): any npm scriptBash(git commit *): commits, but not other git commandsRead(./.env): the project's.envfileWebFetch(domain:example.com): pages on that sitemcp__github__*: every tool from an MCP server named github
A typical starting point:
{"permissions": {"allow": ["Bash(npm run *)", "Bash(git commit *)"], "deny": ["Bash(git push *)", "Read(./.env)", "Read(./secrets/**)"]}}
Rules are checked in a fixed order: deny first, then ask, then allow. A deny always wins, even over a more specific allow, and an ask rule prompts even if an allow also matches.
Staying safe
- Put the
*after the subcommand.Bash(git log *)allows onlygit log;Bash(git *)allows every git command, including ones that run other programs. - Mind the space.
Bash(ls *)doesn't matchlsof;Bash(ls*)does. - Command rules aren't a wall. A deny for
Bash(rm *)doesn't stopbash -c 'rm …'or/bin/rm. Claude Code does split chained commands, so an allowed command followed by&&and another one still needs every part allowed. For hard limits on files and network, use Claude Code's sandboxing. - Block secrets with Read deny rules. In recent versions a
Readdeny also stops matching image paths you paste into the prompt from being attached, and hides matching names when you @-mention a folder. - Protected files stay protected. Allow rules never pre-approve writes to places like
.git,.claude,.mcp.jsonand shell files such as.zshrc. Outside bypass mode you're asked first, or in auto mode the classifier reviews the write. - Turn risky modes off. Set
permissions.disableBypassPermissionsModeorpermissions.disableAutoModeto"disable"to stop them being used.
If it doesn't work
- An allow rule still prompts: a deny or ask rule from another settings file may match. Open
/permissionsto see each rule's source. - A rule for another folder doesn't apply: Claude only works inside its working directories. Start with
claude --add-dir pathor list the folder inadditionalDirectories. - A path rule in user settings misses your project: paths starting with
/in~/.claude/settings.jsonare relative to~/.claude. Use~/or//for absolute paths. - The prompt has no "don't ask again": That option appears only when the prompt can list all that a saved rule would cover. Approve once, or write the rule yourself.
Sources
- Claude Code user FAQ (Claude Help Center, checked 30 October 2026)
- Configure permissions (Claude Code Docs, checked 30 October 2026)
- Permission modes (Claude Code Docs, checked 30 October 2026)
Frequently asked questions
Can I tell Claude in CLAUDE.md not to run certain commands?
You can, but nothing enforces it. CLAUDE.md guides Claude's choices, while Claude Code itself only applies permission rules, modes and hooks. Use a deny rule for anything that must never happen.
Where does "don't ask again" save my choice?
For commands and web domains it writes a rule to .claude/settings.local.json at the root of the git repository, so it applies to future sessions there. Approvals for file edits last only until the session ends.
Can my company lock these settings?
Yes. Administrators can deploy managed settings that user and project settings can't override, including turning off bypass or auto mode.