Your best model is too good to spend on your smallest tasks. This is the setup that stops it doing the grunt work. It plans and it judges, and a cheaper, faster model does the actual doing.
About 15 minutes. You do not have to write code, but you do have to type into a terminal.
Before you start
1. You need a paid Claude plan. Claude Code is not on the free plan. Pro, Max, Team or Enterprise.
2. This is Claude Code, not the Claude app. Claude Code runs in your terminal. If you have never installed it, paste one of these into your terminal and press enter.
Mac, Linux or WSL:
curl -fsSL https://claude.ai/install.sh | bash
Windows PowerShell:
irm https://claude.ai/install.ps1 | iex
Then type claude and follow the browser login. If the terminal is genuinely not your thing, the Claude desktop app runs Claude Code with a normal interface instead, and everything below works there too.
3. Check your version. Type claude --version. You want 2.1.139 or later for step 4. Steps 1 to 3 work on older versions.
4. This is not an unlimited plan. It moves the dull, repetitive work onto a cheap model so more of your allowance goes on the thinking. It will not rescue a job that needed the big model all along.
Step 1: Open Claude Code where your work is
Claude Code only sees the folder you start it in, so start it in the right one.
Open your terminal. Type cd and a space, then drag the folder from Finder or File Explorer onto the terminal window and let go. It fills in the path for you. Press enter, then type claude.
cd /Users/you/Documents/my-project
claude
Everything from here is typed into that Claude Code session, not into your terminal.
You’ll know it worked when you get a prompt with a
>and the folder name showing at the top of the window.
Step 2: Create the executor
The executor is the worker. It is a small text file that tells Claude Code “when there is dull mechanical work, hand it to this thing, and run it on the cheap model”.
You do not write the file yourself. Paste this into Claude Code and it writes it for you:
Create a project sub-agent at .claude/agents/executor.md called executor.
Frontmatter:
name: executor
description: Carries out well-specified implementation work handed down as an explicit plan. Use for repetitive edits, boilerplate, renames, file moves, running commands and applying a spec that is already written. Do not use for design decisions or judgement calls.
tools: Read, Write, Edit, Bash, Grep, Glob
model: haiku
Body: it executes the plan it is given exactly as written, it does not redesign or improve on the plan, it reports what it changed file by file, and if the plan is ambiguous it stops and says which line is ambiguous instead of guessing.
“Frontmatter” is just the settings block at the top of the file. You only need to check it is there.
Two things worth knowing. description is what Claude reads to decide when to hand work over, so it describes what the work looks like, not what the agent is called. And model: haiku is the entire point of the file. Haiku is the small fast one. If its output comes back too thin for your work, sonnet goes in the same spot.
Swap .claude/agents/ for ~/.claude/agents/ in that prompt if you want the executor available in every folder on your machine.
You’ll know it worked when Claude tells you it created
.claude/agents/executor.md. Ask it to show you the file and checkmodel: haikuis in there.
If Claude cannot find the agent afterwards, quit Claude Code and start it again. A session only watches folders that already existed when it opened.
Step 3: Make your top model plan instead of do
This is the bit people skip, and it is the bit that makes the whole thing work. Left alone, your main model will happily do the job itself. You have to tell it not to.
Paste this in before you describe the actual job:
For this session you are the planner and the reviewer, not the worker.
Work in this order:
1. Read whatever you need to understand the job.
2. Write the plan out in full, file by file, specific enough that someone with no context could follow it.
3. Hand the plan to the executor sub-agent and let it do the work.
4. Read what comes back and check it against the plan.
5. If it does not match the plan, send it back with the specific correction. Do not fix it yourself.
You write the plan and you judge the result. The executor does the doing.
Then describe your job normally.
Point 2 is doing more work than it looks like. The executor gets a fresh, empty head every time it runs. It cannot see this conversation, so a plan that says “then do the same to the other files” hands it nothing. Named files, named changes.
You’ll know it worked when the transcript shows a row that says
executor(...)doing the edits, instead of your main model editing files directly. Type/taskswhile it is running and the executor’s row tells you which model it is on.
Step 4: Give it a finish line
Right now it still stops when it feels done. /goal changes that to stopping when the job actually passes.
/goal Every invoice PDF in this folder is renamed to YYYY-MM-vendor.pdf and summary.csv lists all of them with date, vendor and amount, with no file left unrenamed.
After every turn, a small fast model reads the conversation and decides whether your condition holds yet. If it does not, Claude starts another turn by itself instead of handing control back to you.
The condition is the whole game. The checker does not run commands or open files. It only reads what Claude has already put in the conversation. So write a condition that Claude’s own output can prove:
- Works:
every invoice is renamed and summary.csv has a row for each one - Works:
npm test exits 0 and the lint step returns clean - Dead:
the folder is tidy(nothing to measure) - Dead:
the code is production ready(nothing to measure)
You can put a limit on it too. Add or stop after 20 turns on the end.
You’ll know it worked when a
/goal activeindicator appears, and after each turn you see the checker’s verdict and its reason.
Type /goal on its own at any point for the condition, how long it has been running, how many turns, and what it has spent. /goal clear stops it.
Step 5: Walk away
Two things have to be true for it to run unattended: it has to keep starting new turns, and it has to stop asking you for permission mid-turn. /goal handles the first. Auto mode handles the second, where a classifier model reviews each action instead of you.
On Pro, Max and Team plans, auto mode is what sessions start in, so it is probably already on. Check the status bar at the bottom of Claude Code, which always names the current mode. Press Shift+Tab to cycle through the modes.
If you want the cheap model applied to absolutely everything rather than just the executor, add this to ~/.claude/settings.json (ask Claude to do it for you):
{
"env": {
"CLAUDE_CODE_SUBAGENT_MODEL": "haiku",
"CLAUDE_CODE_SUBAGENT_MODEL_FORCE": "1"
}
}
With the force flag on, Claude Code ignores the model line in every agent file and runs the lot on Haiku. Needs version 2.1.257 or later. Good for a big mechanical job, worth turning off afterwards, because it also drags your research agents down onto Haiku.
When it goes wrong
The executor never gets used. Almost always the description line. It has to describe the shape of the work, not the agent. Then check the planner prompt from step 3 is still in the session, because /clear wipes it.
Claude says it cannot find the agent. Quit and restart Claude Code.
/goal is not there. Your version is below 2.1.139, or you have not accepted the trust prompt for that folder.
The goal has gone quiet. If the executor is still running when a turn ends, the check gets skipped for that turn. A long executor run looks like a frozen session. It is not stuck.
It keeps going round without getting anywhere. Claude Code stops the loop itself and warns you. That is nearly always a condition the conversation can never prove. Rewrite it as something a command’s output demonstrates.
Everything still ran on the expensive model. The model gets picked in this order: whatever Claude passed for that call, then the model line in the agent file, then CLAUDE_CODE_SUBAGENT_MODEL, then your main model. Something higher up that list is winning.
Haiku’s work is not good enough. Change model: haiku to model: sonnet. The saving is smaller but the structure holds.
The checklist
-
.claude/agents/executor.mdexists, withmodel: haikuin it - The description says when to delegate, not what the agent is called
- The planner prompt is pasted in before you describe the job
- The plan names files and changes, because the executor cannot see the chat
- The goal condition is something Claude’s own output can prove
- The status bar says auto mode if you are walking away
-
/tasksshows the executor running on the cheap model
The one line to remember: the expensive model runs the job. It does not do the job.
