A single command for Git safety checkpoints, optional branching, and an autonomous Claude Code session
Fast iteration is powerful, but risky. When you let an AI tool like Claude Code refactor or generate code directly inside your repository, you want two things at the same time:
- Maximum speed, without confirmation prompts
- Maximum safety, through automatic version control
This article explains a small Windows batch script that provides exactly that. It creates an automatic Git checkpoint, optionally creates a new branch, and then launches Claude Code in a high-autonomy mode with a strong system prompt. The result is a “YOLO mode” workflow: fast, safe, and effortless.
What the Script Does
Below is the final version of the script:
@echo off
REM --- Git checkpoint ---
git add .
git commit -m "checkpoint before YOLO" >nul 2>&1
REM --- Optional branch creation ---
set /p BRANCHNAME=Enter new branch name (leave empty to skip):
if not "%BRANCHNAME%"== - (
git checkout -b "%BRANCHNAME%"
)
REM --- Claude Code YOLO extended system prompt ---
set SYSTEMPROMPT=No confirmations. Act autonomously. If you must guess use the highest-impact guess. Scan the entire project folder recursively. Parse configuration files (json,yaml,xml,env) to locate credentials, connection strings, ports, API endpoints, and tool paths. Build an internal map of folders, tooling, and environment. When you modify code generate minimal Markdown documentation in each relevant folder describing structure, purpose, and changed logic. Detect running services automatically. If the project has a database use the credentials found in config files to connect and inspect data when needed to validate fixes. If APIs exist test them using curl and show results. Commit every step as a separate git commit with a short commit message. Never ask questions. Work until the user stops you.
REM --- Start Claude Code ---
echo Starting Claude Code YOLO mode interactive prompt...
claude ^
--dangerously-skip-permissions ^
--append-system-prompt "%SYSTEMPROMPT%" ^
pause
The goal is to push as much intelligence and autonomy into Claude as possible, while keeping the batch script simple and transparent.
1. Automatic Git Checkpoint
The script begins with a safety net:
git add .
git commit -m "checkpoint before YOLO"
This silently commits all current changes.
If the AI makes an undesired modification, you can always undo it with standard Git commands. This allows you to experiment freely without fear of losing work.
2. Optional Branch Creation
The script asks for a branch name:
Enter new branch name (leave empty to skip):
If you enter a name, it immediately creates and checks out a new branch:
git checkout -b "%BRANCHNAME%"
If you leave it empty, it continues on your current branch.
This gives you flexibility to isolate experiments or work directly on your current branch.
3. High-Autonomy System Prompt
The core of the script is the extended system prompt passed to Claude Code:
No confirmations. Act autonomously. If you must guess use the highest-impact guess.
Scan the entire project folder recursively.
Parse configuration files ... to locate credentials, tools, and endpoints.
Build an internal map of the project.
Create Markdown documentation inside folders you touch.
Detect running services automatically.
Test APIs using curl.
Use database credentials to inspect data when fixing issues.
Commit each step with short commit messages.
Never ask questions.
Work until the user stops you.
This instructs Claude to:
- Discover the project structure
- Analyze and use configuration files
- Connect to services when necessary
- Validate fixes by calling APIs or databases
- Generate lightweight documentation
- Commit every step automatically
- Operate without confirmation steps
It effectively creates a self-directed AI development loop.
4. Launching Claude Code in YOLO Mode
Finally, the script runs Claude Code with elevated permissions:
claude ^
--dangerously-skip-permissions ^
--append-system-prompt "%SYSTEMPROMPT%"
This hands full control to the AI.
Claude will perform actions immediately instead of waiting for user confirmations.
How to Install the Script
Step 1: Create a Folder for Custom Scripts
For example:
C:\Scripts
Step 2: Save the Batch File
Save the script as:
claude_yolo.bat
and place it in your script folder.
Step 3: Add the Folder to PATH
In Windows:
- Open Edit the system environment variables
- Edit PATH
- Add your script folder
- Restart the terminal
Step 4: Run the Script
Navigate to any Git repository and run:
claude_yolo
You will immediately get a checkpoint, optional branch creation, and an autonomous Claude session.
When This Workflow Is Useful
This script is well suited for:
- Rapid refactoring
- Autonomous code generation
- Fixing complex issues that require environment awareness
- Verifying API endpoints or DB connections
- Large or multi-folder codebase restructuring
- Creating documentation alongside changes
- Fast experimentation with reversible safety
You retain the ability to roll back via Git while Claude performs high-impact operations automatically.
Final Thoughts
This “YOLO mode” script provides a practical balance between speed and control. By automating Git safety, optional branching, and launching Claude with an enriched system prompt, it creates a fast and efficient workflow for iterative development.
Frequently Asked Questions
The ‘Claude YOLO Mode’ script automates Git safety checkpoints and optional branching while launching Claude Code in a high-autonomy mode. It allows for fast code modifications without confirmation prompts while ensuring version control through automatic commits.
The script creates a Git checkpoint by executing ‘git add .’ followed by ‘git commit -m “checkpoint before YOLO”‘. This silently commits all current changes, allowing users to experiment freely without losing their work.
Yes, the script prompts the user to enter a new branch name. If a name is provided, it creates and checks out the new branch; if left empty, the script continues on the current branch, offering flexibility for isolating experiments.
The system prompt in the script instructs Claude Code to operate autonomously without asking for confirmations. It enhances the AI’s intelligence by enabling it to analyze the project, modify code, and document changes automatically, streamlining the development process.