Claude Code terminal interface showing YOLO auto mode scripting workaround

Claude Code YOLO Mode: Scripting Your Way Past the “Auto Mode Not Available” Wall

👁2views

When Claude Code displays "Auto mode not available for this model," you can replicate its permissive behavior by scripting direct edits to the settings.json file, which controls tool permissions. This approach temporarily grants Claude unrestricted execution rights, bypassing confirmation prompts and restoring uninterrupted workflow during intensive refactoring sessions where constant approval dialogs break concentration.

CloudScale AI SEO - Article Summary
  • 1.
    What it is
    Claude Code YOLO mode is a bash script that directly edits settings.json to replicate Auto mode permissions — covering exactly which fields change, when to enable it, and how to revert cleanly.
  • 2.
    Why it matters
    Bypassing the 'Auto mode not available' wall eliminates per-action approval prompts during trusted tasks like automated refactoring or greenfield scaffolding, letting Claude chain tool calls without interruption.
  • 3.
    Key takeaway
    Enable Claude Code YOLO mode only for well-scoped sessions you already trust — always revert with the built-in restore command when the task is done.

If you have spent any time with Claude Code, you have probably hit the message at least once: “Auto mode not available for this model.” It is one of those friction points that breaks flow at exactly the wrong moment, usually when you are deep in a refactor and want Claude to just get on with it.

This post walks through a small bash script that replicates the permissive behaviour of Auto mode by writing directly to Claude Code’s settings.json. It covers what the script does, when it makes sense to use it, when it does not, and how to get back to your normal configuration cleanly.

1. What is Auto mode actually doing?

Claude Code’s permission model controls which tools Claude can invoke without stopping to ask you. In the default interactive mode, Claude pauses before running shell commands, writing files, or fetching URLs and waits for your approval. Auto mode collapses those prompts so Claude can chain tool calls uninterrupted.

When a model does not surface the Auto mode toggle in the UI, the underlying settings can still be written manually. That is the gap this script fills.

2. The script

Wrap and install it like this:

cat > ~/claude-yolo-mode.sh << 'EOF'
#!/usr/bin/env bash
# ============================================================
# claude-yolo-mode.sh
# Enable / disable Claude Code "no-prompts" mode.
#
# Usage:
#   bash claude-yolo-mode.sh          # enable
#   bash claude-yolo-mode.sh revert   # restore previous settings
#
# What it does:
#   ENABLE  — sets defaultMode=acceptEdits, clears the deny list so
#             Claude can run any tool without asking for approval.
#             A backup of your current settings is saved first.
#
#   REVERT  — restores settings.json from the backup.
#
# Security note: in YOLO mode Claude can read/write/delete files
# and run shell commands without prompting you. Only use this when
# you trust what you're asking Claude to do.
# ============================================================
set -euo pipefail
SETTINGS="$HOME/.claude/settings.json"
BACKUP="$HOME/.claude/settings.json.yolo-backup"
enable_yolo() {
    if [ ! -f "$SETTINGS" ]; then
        echo "  $SETTINGS not found — is Claude Code installed?"
        exit 1
    fi
    if [ -f "$BACKUP" ]; then
        echo "  Backup already exists at $BACKUP"
        echo "  Looks like YOLO mode is already on, or a previous revert failed."
        echo "  Run:  bash claude-yolo-mode.sh revert   to restore first."
        exit 1
    fi
    echo "  Backing up current settings to $BACKUP"
    cp "$SETTINGS" "$BACKUP"
    echo "  Writing YOLO settings..."
    python3 - "$SETTINGS" <<'PYEOF'
import json, sys
path = sys.argv[1]
with open(path) as f:
    d = json.load(f)
if "permissions" not in d:
    d["permissions"] = {}
d["permissions"]["defaultMode"] = "acceptEdits"
d["permissions"]["allow"] = ["Bash", "Edit", "Write", "Read",
                              "WebFetch", "WebSearch", "Bash(*)"]
d["permissions"]["deny"] = []
d["skipAutoPermissionPrompt"] = True
with open(path, "w") as f:
    json.dump(d, f, indent=4)
print("  defaultMode  ->  acceptEdits")
print("  deny list    ->  cleared")
print("  allow list   ->  Bash(*), Edit, Write, Read, WebFetch, WebSearch")
PYEOF
    echo ""
    echo "  YOLO mode ON.  Open a new Claude Code window to pick up the change."
    echo "  When you're done run:  bash claude-yolo-mode.sh revert"
}
revert_yolo() {
    if [ ! -f "$BACKUP" ]; then
        echo "  No backup found at $BACKUP"
        echo "  Either YOLO mode was never enabled, or the backup was already restored."
        exit 1
    fi
    echo "  Restoring settings from backup..."
    cp "$BACKUP" "$SETTINGS"
    rm "$BACKUP"
    echo ""
    echo "  Settings restored.  Open a new Claude Code window to pick up the change."
}
case "${1:-enable}" in
    enable)  enable_yolo ;;
    revert)  revert_yolo ;;
    *)
        echo "Usage: bash claude-yolo-mode.sh [enable|revert]"
        exit 1
        ;;
esac
EOF
chmod +x ~/claude-yolo-mode.sh

Once that is in place, enabling and reverting are single commands:

bash ~/claude-yolo-mode.sh          # enable
bash ~/claude-yolo-mode.sh revert   # restore

3. What the script actually changes

The script touches three fields inside ~/.claude/settings.json:

FieldDefaultYOLO value
permissions.defaultMode"default""acceptEdits"
permissions.allow(your existing list)["Bash", "Edit", "Write", "Read", "WebFetch", "WebSearch", "Bash(*)"]
permissions.deny(your existing list)[]

The acceptEdits mode tells Claude Code to proceed through file writes and edits without pausing. The wildcard Bash(*) entry extends that same permission to arbitrary shell commands. The deny list is emptied so any previously blocked tools are no longer blocked.

Before writing anything, the script copies your current settings.json to settings.json.yolo-backup. If a backup already exists, the script refuses to overwrite it and exits cleanly, which prevents you from silently losing your original configuration on a second run.

4. When this is the right tool

Use this script when you are running Claude Code on a task you have already thought through and you trust the scope of what Claude will do. Some concrete scenarios where it earns its place:

Scaffolding greenfield projects. When you ask Claude to build out a folder structure, write boilerplate, and wire up configuration files, the per-action prompts add noise without adding safety. You know what you asked for.

Automated refactoring passes. Running a rename across a codebase, converting a module pattern, or migrating an API surface are tasks where the mechanical work is well-defined. Approving each file write individually does not meaningfully reduce risk.

Local experimentation environments. Throwaway repos, sandboxed containers, or isolated virtual machines are contexts where file system damage is cheap to recover from. The cost-benefit of prompt interruptions is skewed heavily toward getting the work done.

CI-adjacent scripting. If you are using Claude Code in a non-interactive pipeline context and the model version in use does not expose Auto mode through the UI, this script gives you equivalent behaviour without having to maintain a wrapper.

5. When this is not the right tool

Working in your actual home directory or production repositories. The allow list includes Bash(*), which means unrestricted shell execution. Claude can delete files, overwrite configuration, run network commands, or do anything else your user account is permitted to do. If the task goes sideways, rollback is on you.

When you are uncertain about the prompt. YOLO mode is a trust signal you give to a specific session and a specific task. If you are still refining what you want Claude to do, keep the prompts on. They are a useful forcing function for catching misunderstandings before they become file system changes.

Shared machines or accounts with elevated permissions. If your user account has sudo access, write access to system directories, or credentials to cloud environments, the risk surface expands considerably. Run YOLO mode with the same caution you would apply to running an untrusted shell script.

When you cannot afford the cleanup. The backup mechanism protects your settings.json, not your project files. There is no automatic undo for file deletions or overwrites that Claude makes while in this mode.

6. Reverting cleanly

When you are done with the task, run:

bash ~/claude-yolo-mode.sh revert

This copies settings.json.yolo-backup back over settings.json and removes the backup file. Open a new Claude Code window and the previous permission model is restored.

If something goes wrong and the backup is missing, you can manually restore safe defaults by editing ~/.claude/settings.json directly and setting permissions.defaultMode back to "default", clearing the allow list to its previous state, and removing the skipAutoPermissionPrompt key.

7. The broader point

Claude Code’s permission model exists for good reasons. Most of the time, the prompts are the right behaviour. This script is a precision tool for sessions where you have already done the reasoning and want the model to execute without friction.

The name is a joke, but the backup mechanism is not. The script will not let you enable YOLO mode twice without reverting first, and it will not silently destroy your configuration. Use it deliberately, revert it when the task is done, and it is a genuinely useful part of the Claude Code workflow.