Claude Code Cost-Saving Tips: Let AI Use Its Own Judgment and Delegate Across Models
Claude Code Cost-Saving Tips: Let AI U…
Let Claude Code use its own judgment and delegate subtasks to cheaper models to save tokens.
Simon Willison shares two key Claude Code insights: replace rigid rule lists with declarative intent to unlock the model's own judgment, and use a primary/subagent architecture to delegate coding tasks to lower-cost models like Sonnet or Haiku. This approach significantly reduces token consumption while maintaining quality on decisions and reviews.
Article
Many developers instinctively write exhaustive instructions when working with AI coding agents like Claude Code. But in a fireside chat with the Claude Code team, well-known developer Simon Willison came away with a counterintuitive insight: instead of micromanaging every step, let the AI apply its own judgment. This approach not only boosts productivity but can significantly reduce token consumption.
Claude Code and AI Coding Agents: A New Paradigm
Claude Code is Anthropic's command-line AI coding agent, representing a paradigm shift in the next generation of "agentic" AI programming assistants. Unlike earlier code-completion tools such as GitHub Copilot, coding agents can autonomously plan tasks, invoke tools, read and write files, execute commands, and even coordinate multiple subtasks in parallel. The central challenge with these tools is striking the right balance between autonomy and control — too many constraints kill their effectiveness, while too little oversight can produce unexpected results. Simon Willison's hands-on experience represents a hard-won balance within that tension.
Core Philosophy: Let the Model Decide
Simon Willison moderated a fireside chat at the AI Engineer World's Fair (AIE) with Claude Code team members Cat Wu and Thariq Shihipar. The most valuable piece of advice from that conversation: let the model use its own judgment rather than prescribing exactly how it should work.
Take testing strategy as an example. The traditional approach is to write precise rules: "Only use automated tests for larger features; don't update or run tests for small copy or design changes." But the more effective approach is far simpler — just tell Claude Code to "use your own judgment when deciding whether to write tests."
Why "Declaring Intent" Beats "Piling On Rules"
This advice reflects a deeper shift rooted in two classic programming paradigms from software engineering. "Imperative" programming requires developers to tell a computer step-by-step how to do something (e.g., a manual for-loop), while "declarative" programming describes only what result is needed (e.g., SQL queries, React component state declarations), leaving the runtime to figure out the execution details. An overly detailed list of rules is essentially imperative thinking, while "use your own judgment" is the declarative equivalent.
Handcrafted rules are often brittle and incomplete: you can't anticipate every scenario, and rules can contradict each other. Modern large language models, on the other hand, have developed substantial contextual understanding and commonsense reasoning. When you hand decision-making authority to the model, it can weigh the nature, scope, and risk of a task holistically and make more flexible, context-appropriate choices. As model capabilities continue to improve, declarative prompts tend to be more robust — models can interpret intent flexibly from context rather than mechanically executing a set of potentially conflicting rules.
This is fundamentally a shift from "imperative instructions" to "declarative intent" — and it's a key skill for collaborating effectively with the next generation of AI tools.
Practical Tip: Run Subtasks on Lower-Power Models to Save Tokens
To appreciate the value of this technique, it helps to understand the economic weight of tokens. Tokens are the basic unit of measurement for how large language models process text — roughly equivalent to 3/4 of an English word. Major models are billed by the number of input and output tokens, and price differences between models are substantial: Claude Opus costs over 60× more than Haiku. In complex coding agent tasks, where the model repeatedly reads codebases, generates analysis, and outputs code, token consumption can spiral out of control. For heavy users, token costs have become a real operational expense, making multi-model task delegation an economic necessity rather than just a technical option.
Simon picked up a practical token-saving trick from developer Jesse Vincent: tell Claude Code to use other models for smaller tasks, and let it decide which one to use.
The actual prompt Simon gave Claude Code was:
For all coding tasks use your judgement to decide an appropriate lower power model and run that in a subagent
Subagent Architecture: The Underlying Principle of Distributed Execution
The "subagent" here isn't a metaphor — it's a mature architectural pattern in AI agent systems. The primary agent handles task decomposition, result integration, and quality control, delegating specific atomic tasks to independently running subagents, each of which can use different model configurations, tool sets, and context windows. This pattern borrows from the microservices philosophy in software engineering, breaking a single complex system into components with clearly defined responsibilities. In Claude Code's implementation, subagents are directed to smaller models via a "model override" parameter and receive "self-contained prompts" — complete task descriptions that don't rely on the main loop's context — enabling genuinely decoupled execution.
How Claude Understands and Persists This Instruction
Notably, Claude automatically saved this instruction as a memory file at ~/.claude/projects/name-of-project/memory/delegate-coding-to-subagents.md. This memory file not only records the user's original intent but also generates a clear execution strategy:
- Why: For cost and efficiency — concrete implementation work rarely requires the top-tier model; judgment, review, and synthesis work remains in the main loop.
- How: When a task primarily involves writing or editing code, spawn a subagent with a model override (Sonnet for important implementations, Haiku for trivial/mechanical edits) along with a self-contained prompt; review results in the main loop before committing. Design, auditing, data synthesis, and tasks requiring heavy judgment stay with the primary model.
Claude Code's memory persistence mechanism works through Markdown files, organized into two layers: global configuration (~/.claude/CLAUDE.md) and project-level memory (~/.claude/projects/<name>/memory/). This "self-documenting" memory model is superior to traditional implicit preference storage: file contents are fully transparent and auditable by the user, can be manually edited or version-controlled, and can be shared across teams. In essence, this mechanism turns the results of prompt engineering into reusable configuration assets, reducing the cognitive overhead of re-explaining preferences every session — and this memory system itself is one of Claude Code's major strengths.
Primary/Subordinate Model Delegation: An Architecture for Reducing Costs
The essence of this approach is layered delegation — the primary model (e.g., Opus) handles high-level judgment, review, and synthesis, while delegating concrete code implementation to more economical subagent models (Sonnet or Haiku).
This mirrors a classic resource allocation principle in software engineering: use scarce, high-value resources where judgment matters most, and hand repetitive work off to lower-cost executors. In the context of AI coding agents, the division of labor looks like this:
| Model | Appropriate Use Cases |
|---|---|
| Haiku | Trivial, mechanical code edits |
| Sonnet | Substantive feature implementation |
| Opus / Main loop | Decision-making, code review, cross-module synthesis |
Simon reports that this approach works well — he's getting a substantial amount of work done while burning through his token quota noticeably more slowly than before.
Two Takeaways for Developers
First, trust the model's judgment. As model capabilities improve, overly detailed instructions can sometimes constrain a model and limit its flexibility. Guiding with high-level intent rather than constraining with low-level rules is the core skill for working effectively with the next generation of AI tools. Declarative prompt engineering is increasingly becoming a foundational literacy for effective AI collaboration.
Second, actively manage your costs. Now that token pricing represents a real expense, multi-model task delegation is an effective cost-control measure. Let strong models make decisions and lightweight models handle execution — you get quality without the price tag. Taking it one step further, hand off the decision of which model to use to the AI itself — that's the essence of meta-level prompt engineering.
As AI coding agents become ever more prevalent, these kinds of "meta-level" prompt engineering techniques — guiding AI on how to orchestrate its own resources — will become essential skills for productive developers. Just as a software architect doesn't personally write every line of code, the AI-native developer of the future will need to master "orchestrating intelligence" rather than merely "using intelligence."
Related articles

The Truth Behind Codex 'Build a Website in 5 Minutes': AI Isn't Creating Sites—It's Helping You Copy Them
Exposing the truth behind viral Codex 5-minute website videos: creators aren't building original sites with AI—they're copying shared prompts or scraping others' work. Learn AI coding tools' real limits.

Getting Started with AI Agent Development: A Complete Guide from Concept to Practice
A comprehensive guide to AI Agent architecture and development, covering automated marketing, intelligent customer service, and investment analysis scenarios with single and multi-agent collaboration.

The Truth Behind Codex 'Build a Website in 5 Minutes': AI Isn't Creating Sites — It's Helping You Copy Them
Exposing the truth behind viral Codex 5-minute website videos: creators aren't building original sites with AI — they're copying shared prompts or scraping others' work.