Workbranch › Guides

Guide

How 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.

Updated 30 October 2026

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

ActionAsks in Manual mode?"Don't ask again" lasts
Reading files, searchingNo, inside your working directoriesNot needed
Shell commandsYes, except a built-in set of read-only onesPermanently, per repository and command
Editing or writing filesYesUntil the session ends
Fetching a web pageYes, except some documentation sitesPermanently, per repository and domain
Web searchYesPermanently, 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.

ModeWhat it doesUse it when
Manual (default)Asks the first time each tool is usedYou want to see everything
Accept edits (acceptEdits)Applies file edits and simple file commands like mkdir or mv in your project without askingYou trust the task and will review the diff
Plan (plan)Explores and proposes a plan; no edits until you approve itBig or unclear changes
Auto (auto)Skips routine prompts; a background classifier checks commands and network requests against your requestLonger tasks with fewer interruptions
Don't ask (dontAsk)Refuses anything that would prompt, runs only what's pre-approvedLocked-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 .gitOnly 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

  1. 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.
  2. 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.json or, for every project, ~/.claude/settings.json.
  3. Write rules as Tool or Tool(pattern):
    • Bash(npm run *): any npm script
    • Bash(git commit *): commits, but not other git commands
    • Read(./.env): the project's .env file
    • WebFetch(domain:example.com): pages on that site
    • mcp__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

If it doesn't work

Sources

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.