Back to Blog
BlogMarch 25, 20262

How to Use Claude Code Auto Mode: Complete Step-by-Step Tutorial

How to Use Claude Code Auto Mode: Complete Step-by-Step Tutorial

Prerequisites

Before using Claude Code Auto Mode, ensure you have the following:

  • Claude subscription: Team plan (required for the research preview) or Enterprise plan (rolling out shortly). Auto Mode is not available on Pro, Max, or free accounts.
  • Claude model: Claude Sonnet 4.6 or Opus 4.6 (required for Auto Mode).
  • Claude Code installed: Latest version of the CLI, Desktop app, or VS Code extension.
  • Project directory: A local codebase you want to work on.
  • Terminal access: For CLI usage (recommended for full control).

Note: Auto Mode is currently a research preview. Admins can disable it organization-wide via managed settings.

Step 1: Install Claude Code

  1. Open your terminal.

  2. Run the appropriate installation command for your OS:

    macOS / Linux / WSL

    curl -fsSL https://claude.ai/install.sh | bash
    

    Windows (PowerShell)

    irm https://claude.ai/install.ps1 | iex
    
  3. Verify installation:

    claude --version
    
  4. (Optional) For Homebrew on macOS:

    brew install --cask claude-code
    

After installation, Claude Code will auto-update in the background.

Step 2: Log In to Claude Code

  1. Start an interactive session:
    claude
    
  2. Follow the on-screen login prompt (first-time use only).
  3. Use a Team or Enterprise account.

Once logged in, credentials are stored securely.

Step 3: Enable Auto Mode

Auto Mode must be explicitly unlocked before it appears in the mode cycle.

CLI Method (Recommended)

Launch with the enable flag:

claude --enable-auto-mode

Or start with Auto Mode directly:

claude --enable-auto-mode --permission-mode auto

Settings File Method

Create or edit ~/.claude/settings.json (user-level) or .claude/settings.local.json (project-level):

{
  "defaultMode": "auto"
}

Important: The --enable-auto-mode flag is still required at startup for the mode to appear in the Shift+Tab cycle.

Desktop / VS Code Extension

  • Open Claude Code settings.
  • Toggle Auto Mode on (appears only after enabling via CLI flag or admin settings).

Step 4: Configure the Auto Mode Classifier (Recommended)

Auto Mode uses a background classifier to approve safe actions. Customize it for your environment.

  1. Inspect built-in rules:

    claude auto-mode defaults
    
  2. Copy the output and create/edit your settings file with trusted infrastructure:

    {
      "autoMode": {
        "environment": [
          "Organization: Acme Corp. Primary use: software development",
          "Source control: github.com/acme-corp and all repos",
          "Cloud buckets: s3://acme-build-artifacts"
        ],
        "allow": [
          "Deploying to staging is allowed: isolated environment"
        ],
        "soft_deny": [
          "Never run database migrations outside the official CLI"
        ]
      }
    }
    
  3. Validate your configuration:

    claude auto-mode config
    
  4. Get AI feedback on custom rules:

    claude auto-mode critique
    

Step 5: Start a Session and Switch to Auto Mode

  1. Navigate to your project:

    cd /path/to/your-project
    
  2. Launch Claude Code with Auto Mode enabled:

    claude --enable-auto-mode
    
  3. Switch modes during the session:

    • Press Shift + Tab (or Alt + M) repeatedly to cycle: defaultacceptEditsplanauto.
    • The current mode appears in the status bar.
  4. Give Claude a task. Example:

    Refactor the authentication module, add unit tests, and run the full test suite.
    

Auto Mode will now automatically approve low-risk tool calls (file reads, targeted edits, standard builds/tests) while the classifier blocks anything risky.

Step 6: Best Practices for Effective Use

  • Start in Plan Mode first: Switch to plan (Shift+Tab twice), review Claude’s plan, then switch to Auto Mode.
  • Add project context: Create a CLAUDE.md file in the root with coding standards, build commands, and forbidden actions.
  • Use checkpoints: Claude automatically saves states before changes. Rewind with Esc twice or /rewind.
  • Combine with hooks: Configure .claude/settings.json for auto-linting or tests after edits.
  • Monitor progress: Use verbose mode (Ctrl + R) to see full reasoning.

Common Issues & Troubleshooting

  • Auto Mode not appearing in cycle:

    • Ensure you launched with --enable-auto-mode.
    • Confirm you’re on Team/Enterprise with Sonnet 4.6 or Opus 4.6.
    • Check admin settings if in an organization.
  • Classifier blocks legitimate actions:

    • Add explicit rules to autoMode.allow or environment.
    • Use claude auto-mode critique for suggestions.
    • Provide clearer task instructions or switch temporarily to acceptEdits.
  • Higher latency or token usage:

    • Expected due to the background classifier. Use for longer sessions only.
  • Permission errors on protected paths:

    • .git, .claude, etc., still prompt in most modes. Use isolated environments (Docker/VM) for full autonomy.
  • Session exits unexpectedly:

    • Run claude -c to continue the most recent conversation.

Next Steps

  • Explore Plan Mode for complex refactoring before switching to Auto Mode.
  • Set up custom commands and hooks for repeatable workflows.
  • Try sub-agents for parallel tasks (e.g., frontend + backend).
  • Integrate with CI/CD via GitHub Actions for fully automated pipelines.
  • Experiment in a throwaway Git branch or Docker container for safety.

With Auto Mode enabled and properly configured, you can run hour-long autonomous coding sessions with dramatically fewer interruptions while maintaining strong safety guardrails. Start with a simple task today and gradually expand your trusted environment rules as you gain confidence.

Share this article