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
-
Open your terminal.
-
Run the appropriate installation command for your OS:
macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bashWindows (PowerShell)
irm https://claude.ai/install.ps1 | iex -
Verify installation:
claude --version -
(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
- Start an interactive session:
claude - Follow the on-screen login prompt (first-time use only).
- 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.
-
Inspect built-in rules:
claude auto-mode defaults -
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" ] } } -
Validate your configuration:
claude auto-mode config -
Get AI feedback on custom rules:
claude auto-mode critique
Step 5: Start a Session and Switch to Auto Mode
-
Navigate to your project:
cd /path/to/your-project -
Launch Claude Code with Auto Mode enabled:
claude --enable-auto-mode -
Switch modes during the session:
- Press Shift + Tab (or Alt + M) repeatedly to cycle:
default→acceptEdits→plan→auto. - The current mode appears in the status bar.
- Press Shift + Tab (or Alt + M) repeatedly to cycle:
-
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.mdfile in the root with coding standards, build commands, and forbidden actions. - Use checkpoints: Claude automatically saves states before changes. Rewind with
Esctwice or/rewind. - Combine with hooks: Configure
.claude/settings.jsonfor 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.
- Ensure you launched with
-
Classifier blocks legitimate actions:
- Add explicit rules to
autoMode.alloworenvironment. - Use
claude auto-mode critiquefor suggestions. - Provide clearer task instructions or switch temporarily to
acceptEdits.
- Add explicit rules to
-
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 -cto continue the most recent conversation.
- Run
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.
Continue Reading
More articles connected to the same themes, protocols, and tools.
Referenced Tools
Browse entries that are adjacent to the topics covered in this article.







