Skip to content

LearnTutorials

Build features with Claude Code auto mode

Hand a whole feature to Claude Code in auto mode: it edits files, runs your tests and fixes failures without asking at every step, in about 25 minutes.

By Recaply EditorsIntermediate25 min6 stepsUpdated

A hand hovers above an open laptop with a large key sticking out of its side

What you need

Auto mode needs Opus 4.6, Sonnet 4.6 or a newer model. On Team and Enterprise plans, an admin can turn it off.

  1. Step 1: Install Claude Code

    3 min

    Auto mode is built in, so a current install is all you need.

    1. On a Mac or Linux, run the command below in a terminal. On Windows, use the PowerShell command on the setup page.
    2. Open a new terminal window and run claude --version.
    Mac or Linux: run this
    curl -fsSL https://claude.ai/install.sh | bash

    You should see a version number, such as 2.1.300 (Claude Code).

    The terminal says it can't find claude?

    The install folder isn't on your PATH yet. Open a new terminal window first. If that fails, follow Fix your PATH in the docs.

    The native install updates itself in the background. Version 2.1.283 and newer start new sessions in auto mode.

  2. Step 2: Add a checkpoint before pushes

    2 min

    Auto mode lets Claude push to any branch and open pull requests, so make it ask you first.

    1. Open ~/.claude/settings.json in a text editor. Create the file if it doesn't exist.
    2. Add the ask rules below. If the file already has a permissions block, add the two lines to it.
    3. Save the file.
    Your config
    {
      "permissions": {
        "ask": [
          "Bash(git push *)",
          "Bash(gh pr create *)"
        ]
      }
    }

    You should see the file saved with an ask list under permissions.

    Claude Code says the settings file is invalid?

    A comma or bracket is likely missing. Run claude doctor in your shell to see which line fails, then fix it.

    Ask rules apply even in auto mode. A push written another way, such as git -C [DIR] push, doesn't match the rule.

  3. Step 3: Start on a branch in auto mode

    2 min

    A separate branch keeps the work apart from main, so you can throw it away if it goes wrong.

    1. In your project folder, run the commands below. Put your own branch name in place of the brackets.
    2. Sign in with your Claude account if asked.
    3. Check the status bar under the prompt. If it doesn't say auto mode on, press Shift+Tab until it does.
    Run this
    git switch -c [FEATURE-BRANCH]
    claude --permission-mode auto

    You should see ⏵⏵ auto mode on in the status bar.

    Auto mode won't turn on?

    Run /model and pick Opus 4.6, Sonnet 4.6 or a newer model. On a Team or Enterprise plan, ask your admin whether auto mode is turned off.

  4. Step 4: Describe the feature

    3 min

    Claude won't stop to ask much, so the prompt has to carry the scope, the limits and what done means.

    1. Paste the prompt below and fill in the brackets.
    2. Name the files, tables or APIs to leave alone, and the exact test command.
    3. Press Enter and let Claude start.
    Your prompt
    Build this feature: [WHAT IT SHOULD DO].
    
    Stack: [FRAMEWORK AND KEY LIBRARIES]. Follow the patterns already in this repo.
    Don't change: [FILES, SCHEMA OR APIS TO LEAVE ALONE].
    When you're done, run [TEST COMMAND] and fix any failures.
    Commit to this branch. Don't push or open a pull request until I review.
    End with a short summary of what changed and why.

    You should see Claude reading files, then editing code and running commands without asking first.

    Claude still stops to ask a question?

    Answer it in the chat. Next time, put that detail in the prompt, such as the test command or the folder to use.

  5. Step 5: Watch and steer

    10 min

    A correction halfway through costs far less than a rewrite at the end.

    1. Read Claude's updates as it works through the files.
    2. If it heads the wrong way, type a correction and press Enter.
    3. Press Esc to stop the current action if you need to.

    You should see your test command running, and Claude fixing what fails.

    A notice says an action was blocked?

    The safety classifier stopped it. Run /permissions and open the Recently blocked tab. Approve the action there if it's safe, and Claude can retry.

    After 3 blocks in a row, or 20 in a session, auto mode pauses and Claude Code asks you again.

  6. Step 6: Review the changes

    5 min

    Auto mode cuts the prompts, not the review. You still check the code before it ships.

    1. Run /diff to see everything that changed.
    2. Ask for fixes in the same session, such as "The login route needs rate limiting."
    3. When you're happy, push the branch and open a pull request. The rule from step 2 asks you to approve both.

    You should see a diff you've read, passing tests and a branch ready for review.

    The diff touches files you said to leave alone?

    Ask Claude to undo the changes to those files and say why it made them. Then name the files again in your next prompt.

You get

A finished feature on its own branch, written and tested by Claude Code with a checkpoint before anything leaves your machine

Did this guide work for you?

Sources