What Are Execution Modes?
By default, Claude Code asks for your permission before modifying files or running commands — “Is it okay if I do this?”Execution modes let you control how much approval is required.
A car analogy makes this easy to understand.
Default Mode
Like a GPS that asks “Turn right here?” at every junction. You have to tap OK before it proceeds.
Auto Mode
Like giving a destination and letting the GPS navigate on its own, steering the wheel automatically. Faster, but requires trust.
The mode you choose affects the balance between speed and safety. Let’s walk through each one.
Start with Default Mode, then increase automation as you get comfortable
The key is finding the right balance between safety and speed for you
Default Mode: Confirm Everything
Without any special settings, Claude Code runs in default mode. It always asks for your permission before taking action.
| Action | Auto-executed? | Description |
|---|---|---|
| Read files | ✅ Auto | Reads files without asking |
| Edit/create files | ❌ Asks | You must choose Yes/No before it proceeds |
| Run commands (npm install, etc.) | ❌ Asks | Shows you the command and waits for confirmation |
| Dangerous commands (rm, git push, etc.) | ❌ Always asks | Requires confirmation regardless of mode |
Recommended for
First-time Claude Code users and anyone working on projects with important files. It lets you see what the AI is doing step by step and build intuition.
/plan Mode: Plan First
For complex tasks, jumping straight into execution can lead you down the wrong path. The /plan command tells Claude Code to show you its plan before executing anything.
> /plan
Build me an email automation system.
Fetch emails via Gmail API, classify them, and draft replies.Claude Code will then present a plan like this:
1. Set up Gmail API OAuth authentication
2. Fetch the 50 most recent emails from inbox
3. Classify emails by subject/sender into categories
4. Generate reply drafts for each category
5. Save results as a JSON fileIf the plan looks good, approve it. If it’s off track, request changes. This is a great way to avoid wasted time on large tasks.
Use this when
You need to modify multiple files, start a brand-new project, or handle a complex request where the direction isn’t clear.
Auto-Approve File Edits
Clicking Yes/No every time Claude edits a file can get tedious. Adding the --permission-mode acceptEdits flag auto-approves file edits.
claude --permission-mode acceptEdits| Action | Default Mode | acceptEdits |
|---|---|---|
| Read files | Auto | Auto |
| Edit/create files | Asks | ✅ Auto-approved |
| Run commands | Asks | Asks |
| Dangerous commands | Asks | Asks |
File edits are automatic, but command execution still requires confirmation. A great middle ground for fast coding.
Fully Automatic Mode
This mode auto-approves everything — file edits and command execution. The AI operates with full autonomy.
claude --dangerously-skip-permissions| Action | Default Mode | Fully Automatic |
|---|---|---|
| Read files | Auto | Auto |
| Edit/create files | Asks | ✅ Auto |
| Run commands | Asks | ✅ Auto |
| Dangerous commands | Asks | ✅ Auto (caution!) |
Use with extreme caution
Only use this mode for tasks you fully trust. The AI can execute commands like rm -rf without asking. Never use this in folders containing important files.
The name itself starts with “dangerously” for a reason. Best reserved for simple repetitive tasks or building from scratch in an empty project.
Setting it as the default (no flags needed)
Typing --dangerously-skip-permissions every time is tedious. You can save it in a settings file instead.
/permissionsRunning /permissions lets you configure which tools are allowed individually — Bash, file read/write, browser, etc.
Or you can edit the settings file directly.
// Location: ~/.claude/settings.json
{
"permissions": {
"allow": [
"Bash(npm run *)",
"Bash(node *)",
"Read",
"Write",
"Edit"
]
}
}With this configuration, the specified commands and file operations are auto-approved. For full automation, use claude --dangerously-skip-permissions. To configure per project, save the same format in your project’s .claude/settings.json.
Use per-project settings
If you set full permissions globally (~/.claude/settings.json), it applies to every project — including ones with important files. It’s safer to apply these settings only to dedicated automation foldersvia project-level configuration.
Slash Commands Overview
In Claude Code, typing a command starting with / gives you access to special features. Here are the most commonly used ones.
| Command | Function |
|---|---|
| /plan | Enter plan mode — shows a plan before executing |
| /compact | Summarize conversation — saves tokens so you can keep working longer |
| /clear | Clear conversation history — start fresh on a new topic |
| /model | Change AI model — Haiku (fast) / Sonnet (balanced) / Opus (most capable) |
| /config | Change settings — fine-tune effort level and other options |
| /help | Help — shows the full list of available commands |
Make /compact a habit
As conversations grow longer, they consume more tokens, which can slow responses or cause cutoffs. Typing /compact after each completed task summarizes the conversation and saves tokens.
Keyboard Shortcuts
You can control Claude Code quickly without a mouse. Just remember these four shortcuts.
| Shortcut | Function |
|---|---|
| Esc | Stop current task — immediately halts when the AI goes off track |
| Ctrl+C | Cancel running command — force-stops a long-running process |
| Shift+Tab | Multi-line input mode — write longer prompts with line breaks |
| ↑ (Up arrow) | Recall previous input — reuse a prompt you just typed |
Esc is the most-used shortcut by far. When the AI is heading in the wrong direction, you can stop it immediately and give new instructions.
When to Use Which Mode?
Choosing the right mode for the situation matters. Use this table as a guide.
| Situation | Recommended Mode |
|---|---|
| Just learning | Default Mode |
| Working with important files | Default Mode |
| Designing complex automations | /plan Mode |
| Repetitive coding tasks | --accept-edits |
| Trusted simple tasks | --dangerously-skip-permissions |
| Want to save tokens | Use /compact frequently |
In summary: safety and speed are inversely related.
Safest — confirms everything
Auto-approves file edits — still confirms commands
Fully automatic — fastest but riskiest
Start with Default Mode
Watch what the AI does, build your intuition, and then gradually increase the automation level. Before long, you’ll naturally reach for --accept-edits.
References
- Claude Code Permissions — code.claude.com/docs/en/permissions
- Claude Code Slash Commands — code.claude.com/docs/en/slash-commands
- Claude Code Settings — code.claude.com/docs/en/settings