How to allow Claude Code to run all commands: permission modes, allow rules and skip permissions
How do I stop Claude Code asking for permission every time?
Press Shift+Tab to cycle permission modes, start with claude --permission-mode <mode>, or pre-approve specific commands with permissions.allow rules such as Bash(npm run *) in .claude/settings.json. Auto mode runs without routine prompts while a classifier reviews actions; --dangerously-skip-permissions is meant only for containers or VMs.
Also in: 简体中文 · 日本語 · 한국어 · Español · Português (Brasil)
Compare: allow all commands in every AI coding agent →
Permission modes
- default (labeled Manual): prompts on first use of each tool.
- acceptEdits: auto-accepts file edits and common filesystem commands such as mkdir, touch, mv and cp in your working directories.
- plan: explores and runs read-only commands but doesn't edit your source files.
- auto: no routine prompts; a background classifier checks shell commands and network requests against your request. It is the built-in starting mode from v2.1.283.
- dontAsk: denies anything that would prompt, except tools you pre-approved.
- bypassPermissions: skips prompts, including writes to protected paths like .git and .claude. Only for isolated containers or VMs.
Switch modes
- During a session: press Shift+Tab to cycle default → acceptEdits → plan (and other enabled modes).
- For one session: claude --permission-mode plan (or default, acceptEdits, auto, dontAsk).
- As a default: set permissions.defaultMode in ~/.claude/settings.json.
Pre-approve exact commands instead
Allow rules are safer than skipping all checks. Put the * after the subcommand: Bash(git log *) allows only git log, while Bash(git *) allows every git command. Deny rules always win.
.claude/settings.json
{
"permissions": {
"allow": ["Bash(npm run *)", "Bash(git commit *)"],
"deny": ["Bash(git push *)"]
}
}Use /permissions inside Claude Code to see every rule and which settings file it comes from.
Fully unattended runs
Only inside a container or VM, as a non-root user
claude -p "run the test suite and fix failures" --dangerously-skip-permissions
Allowed tools: --allowedTools and permissions.allow
--allowedTools (also spelled --allowed-tools) lists tools that run without a prompt for one session. It takes the same rule syntax as permissions.allow in settings.json. --disallowedTools adds deny rules, and a bare tool name such as Edit removes that tool from the session.
One session with git read commands pre-approved
claude --allowedTools "Bash(git log *)" "Bash(git diff *)" "Read"
- Rules are checked deny first, then ask, then allow. A broad deny such as Bash(aws *) blocks a call even when a narrower allow rule also matches.
- Bash rules understand shell operators: Bash(safe-cmd *) does not approve safe-cmd && other-cmd. Each subcommand has to match on its own.
- Bash(ls:*) is the same as Bash(ls *). The :* form only works at the end of a pattern.
- MCP tools: mcp__puppeteer allows every tool from the puppeteer server and mcp__puppeteer__puppeteer_navigate allows one tool. Allow globs need a literal server name, so an allow rule of mcp__* is skipped with a warning.
- Web fetches: WebFetch(domain:example.com) matches example.com only. Add WebFetch(domain:*.example.com) to cover subdomains.
- To limit which built-in tools exist at all, use --tools "Bash,Edit,Read" instead of an allow list.
Sources
More Claude Code guides
- Claude Code permissions: allow, ask and deny rules, rule syntax and allowed tools
- Claude Code telemetry and data retention: what is sent and how to turn it off
- CLAUDE.md: where it goes, how it loads, and how it works with AGENTS.md
- Claude Code hooks: all events, exit codes, PreToolUse and PermissionRequest JSON, examples
- Claude Code subagents: create one, limit its tools, and call it
- Add MCP servers to Claude Code (claude mcp add, .mcp.json, scopes)
- Claude Code custom slash commands and skills (SKILL.md)
- Claude Code settings.json: file locations, precedence, and key settings
- Claude Code plugins and marketplaces: install, create, and share
- Claude Code headless mode: claude -p, --output-format json, --bare and CI flags
- Claude Code statusline: custom status bar in settings.json with context %, cost and git branch
- Claude Code /model: switch models, aliases (opus, sonnet, haiku, opusplan), ANTHROPIC_MODEL and effort
- Claude Code /cost and /usage: check token spend, usage limits and reduce costs
- Claude Code VS Code extension: install, shortcuts, settings and /ide (works in Cursor too)
- MCP 2026-07-28 Migration Guide: Stateless Protocol, No Sessions, server/discover, MRTR, and SDK v2 Upgrade
- Subagents and Custom Agents Compared: Claude Code vs Codex vs Cursor vs Gemini CLI vs GitHub Copilot (2026)
- Allow all commands in any AI coding agent: Cursor, Claude Code, Codex, Gemini CLI, Copilot CLI and 7 more (2026)
- How to deploy a remote MCP server (Streamable HTTP): Cloudflare Workers, Vercel, Railway and more (2026)
- Claude Code sandbox: /sandbox, sandbox.enabled, allowedDomains, excludedCommands and strict mode
Reviewed Oct 23, 2026. Settings change often; the linked vendor docs are the source of truth.
Built an MCP server? Get it listed everywhere →
Shipping an Android app? Google Play needs 12 testers for 14 days first. Get them with Tester Exchange →