17 November 2026
خلّ Claude المدير وموديل أرخص يكتب الكود: subagent بـ Haiku أو موديل محلي بـ Ollama خطوة بخطوةMake Claude the Boss and a Cheaper Model the Coder: a Haiku Subagent or a Local Ollama Model, Step by Step
After this guide you can let Claude decide and write the plan while Haiku or a local model on your machine writes the code, and you will know where the savings really come from.
Who this guide is for
Daily Claude Code users who want a smaller bill without weaker decisions
Key terms
- subagent
- A helper inside Claude Code with its own file and its own context window. You can give it a different model from the main conversation.
- Boss and worker
- A strong model reads the project, decides and writes a short plan. A cheaper model follows the plan and writes the code.
- Ollama
- A free tool that runs open models such as Qwen on your own machine. A local model is not billed per token, but it needs a capable computer.
- advisor
- Anthropic's name for the same idea in the API: a cheaper executor consults Opus on hard decisions. The advisor usually writes only 400 to 700 tokens.
The steps
Step 1
Know where the money goes first
Most tokens go into execution: reading files, writing code, running tests again and again. The decision itself is short.
So the point is not fewer tokens. Anthropic says multi agent systems use about 15 times the tokens of a chat. The real saving is that the heavy work is billed at a cheaper model's price.
If you see a claim like 1000% fewer tokens, it is impossible. The most you can ever save is 100%.
Tip: Measure your bill for a week before the change and a week after, and decide on your own numbers.
Step 2
Write the worker file on Haiku
In your project, create .claude/agents/worker.md
The top of the file holds the name, the description and the model between two --- lines, with the instructions below. The line model: haiku makes this helper run on Haiku instead of the conversation's model.
The Claude Code docs say the field takes sonnet, opus, haiku or inherit, and that every subagent spends tokens from the same usage limits.
The Write subagent files section of the Claude Code docs: a file with YAML settings, then the instructions.Source: code.claude.com --- name: worker description: Executes a written plan: reads the listed files, writes the code and runs the tests. Use it once a plan is ready. model: haiku --- You are an executor. Follow the plan you receive exactly. Do not change the design or add features. If the plan is missing something or contradicts itself, stop and come back with one clear question. When done, return: the files you changed and the test results.PromptFile contentsTip: Keep the description clear, because Claude decides when to call the subagent from it.
Step 3
Let Claude the boss write a short plan and hand it over
In the main conversation, let Claude read the project and decide, without writing the code itself. Ask for a short, specific plan, then a hand off to the worker.
The clearer the plan, the fewer questions and retries from the worker.
Read the project and understand [the task]. Do not write code yourself. Write a short plan: the files that change, the change in each file in one sentence, and the test that proves it works. Then hand the plan to the subagent named worker, and review what it returns before you say we are done.PromptBoss promptStep 4
Review the worker before you merge
A cheaper model makes more mistakes. The boss's job does not end at the plan: it reviews the diff and the test results.
If the worker fails twice on the same part, let the boss write that part. It is cheaper than an endless retry loop.
Review what worker returned against the plan. Did every file change as agreed? Did the tests pass? If something is wrong, give worker a specific two line fix. If the same mistake repeats twice, fix it yourself.PromptReview promptStep 5
Optional: run a local worker with Ollama
Install Ollama from its official site, then pull a model that supports tools, such as a Qwen model from the Ollama library.
The simplest route: let Claude the boss send one specific part to the local model with ollama run in the terminal, then review the result. A local model is not billed per token, but its speed and quality depend on your machine.
The Ollama docs also show ollama launch claude, which runs all of Claude Code on an Ollama model. There is no Claude boss in that setup, so keep it for simple tasks.
The official Ollama download page: the install command for Mac, with Linux and Windows tabs beside it.Source: ollama.com Ollama is installed on this machine with the model [model name]. For each small part of the plan, run: ollama run [model name] "[the part and the file]" Take the output, review it and fix it if needed before you write it to the file.PromptLocal worker promptTip: The Ollama docs recommend a context window of 64k or more for larger repositories.
Step 6
Compare and decide
Run the same kind of tasks for a week the new way and compare three things: the bill, how often you had to fix things, and the time.
In a search test from Anthropic, Haiku with an Opus advisor scored 41.2% instead of 19.7% alone. That is a search test, not coding, so do not read it as a promise for your project. Your own numbers decide.
Ready prompts to copy
The takeaway
Let Claude decide and review, and let the cheaper worker write and retry. The saving is in the price, not the token count.
Liked this guide?
Join Mohammad's community
72 guides like this one, and a new one every week. One subscription opens them all.
Approximate price in your currency. You pay in AED
- A permanent archive. Open any guide, any time
- 20% off private build sessions
- Cancel any time, no commitment
Or without a subscription
Most value
Start building with me now
We sit together, break down your problem, and I build the AI solution with you step by step
- A private session with you
- Real building during the session
- Results you take with you when we finish
100% free
A free consultation about your problem

