AI for Automation
Mastering Execution Modes

Step 3 / 22

Mastering Execution Modes

From approval mode to full auto

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.

ActionAuto-executed?Description
Read files✅ AutoReads files without asking
Edit/create files❌ AsksYou must choose Yes/No before it proceeds
Run commands (npm install, etc.)❌ AsksShows you the command and waits for confirmation
Dangerous commands (rm, git push, etc.)❌ Always asksRequires 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.

Enter this in Claude Code
> /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:

Example execution plan from Claude
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 file

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

Start with this command
claude --permission-mode acceptEdits
ActionDefault ModeacceptEdits
Read filesAutoAuto
Edit/create filesAsks✅ Auto-approved
Run commandsAsksAsks
Dangerous commandsAsksAsks

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.

Start with this command
claude --dangerously-skip-permissions
ActionDefault ModeFully Automatic
Read filesAutoAuto
Edit/create filesAsks✅ Auto
Run commandsAsks✅ Auto
Dangerous commandsAsks✅ 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.

Enter inside Claude Code
/permissions

Running /permissions lets you configure which tools are allowed individually — Bash, file read/write, browser, etc.

Or you can edit the settings file directly.

Edit settings.json 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.

CommandFunction
/planEnter plan mode — shows a plan before executing
/compactSummarize conversation — saves tokens so you can keep working longer
/clearClear conversation history — start fresh on a new topic
/modelChange AI model — Haiku (fast) / Sonnet (balanced) / Opus (most capable)
/configChange settings — fine-tune effort level and other options
/helpHelp — 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.

ShortcutFunction
EscStop current task — immediately halts when the AI goes off track
Ctrl+CCancel running command — force-stops a long-running process
Shift+TabMulti-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.

SituationRecommended Mode
Just learningDefault Mode
Working with important filesDefault Mode
Designing complex automations/plan Mode
Repetitive coding tasks--accept-edits
Trusted simple tasks--dangerously-skip-permissions
Want to save tokensUse /compact frequently

In summary: safety and speed are inversely related.

1
Default Mode

Safest — confirms everything

2
--accept-edits

Auto-approves file edits — still confirms commands

3
--dangerously

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