[KongchangAI]
· 1 min read· 826 words

Three Token-Saving Habits for Claude Code: From Clearing to Model Matching

Three Token-Saving Habits for Claude Code: From Clearing to Model Matching

Controlling context size and matching models to tasks are the keys to reducing Claude Code token consumption.

The article notes that excessive token consumption in Claude Code often stems from interaction habits rather than the model itself, since every request carries the full conversation history and longer context means higher fixed overhead. The author summarizes three token-saving habits from the official docs: use /clear to reset the session when switching tasks (with /rename and /resume to preserve records); choose models by task difficulty—Sonnet for most coding tasks, Opus for complex reasoning, Haiku for simple subagent tasks; and use /compact purposefully for long conversations while pinpointing consumption with /usage. The common logic: control context size and allocate model capability on demand.

Why Is Your Claude Code Burning Through Tokens So Fast?

If you're using Claude Code to write code, you may have noticed: you've barely chatted a few messages, yet your usage is plummeting. The problem often isn't the model itself, but your interaction habits. According to a summary by the YouTube channel SHA Source, the official documentation actually hides three habits that can significantly reduce token consumption—the key is controlling context and selecting models on demand.

Claude Code sends the full conversation history with every request, which means the longer the context, the greater the fixed overhead per message. Understanding this is the starting point for saving tokens.

Claude Code sends your whole conversation with each request.

Habit One: Proactively Clear Context When Switching Tasks

The most easily overlooked waste is leftover old context. When you switch from one task to another unrelated one, if you don't clear the conversation, Claude Code will still pack the entire history into every request sent to the model, and the old content keeps incurring costs in every subsequent message.

The officially recommended workflow is: use /clear to clear the current session; if you want to be able to retrieve it later, first name the session with /rename, then restore it with /resume when needed. This avoids cross-task context contamination while preserving important work records.

The benefits of this habit are cumulative. The longer the session and the more frequent the switches, the more noticeable the savings from clearing.

Habit Two: Match the Model to Task Difficulty

Not every task deserves the most expensive model. According to SHA Source, Sonnet is more than capable of handling most coding tasks and costs less than Opus; Opus should be reserved for scenarios that truly demand brainpower, such as complex architecture design and multi-step reasoning. You can switch at any time with the /model command.

For simple subagent tasks, Haiku 3 is a more economical choice—such tasks usually have clear instructions and don't require deep reasoning, so a small model is more cost-effective.

Sonnet handles most coding tasks well and costs less than Opus.

The core of this strategy is: put the most expensive resources on the hardest problems, rather than having Opus write a simple helper function. Develop the habit of choosing models by task difficulty, and over time you'll see a perceptible drop in token consumption.

Haiku in the Claude 3 series is a lightweight model with fast inference speed and a unit token cost significantly lower than Sonnet and Opus, making it suitable for tasks with clear instructions and structured output, such as format conversion, simple file reading and writing, templated code generation, or routine scheduling of subagents. Its limitation is weaker capability in complex logical reasoning and long-chain thinking—it tends to give shallow answers in scenarios requiring multi-step trade-offs. Therefore, the key to using Haiku for subagents is that task boundaries must be clear enough: the main agent handles decomposition and planning, while Haiku only executes deterministic substeps, which controls costs without sacrificing overall quality.

Habit Three: Compress Context Purposefully

When the conversation does become very long, /compact can summarize the history to free up context space. But compression isn't something to do blindly—you can attach instructions, for example asking the summary to focus on code examples and API usage, so that the compressed context retains genuinely useful information.

After compressing, use /usage to see where the tokens went. This helps you identify the sources of waste: was it a long session that wasn't cleared, or a task that used an oversized model?

Compact on purpose.

A small context means less fixed overhead per message. By combining compression with usage inspection, you can form an observable, adjustable token-saving loop.

Smaller context means fewer tokens

A subagent is a mechanism in Claude Code that delegates tasks to an independent context instance. The main session handles overall planning and interaction with the developer, while the subagent executes specific subtasks in an isolated context and returns only the results to the main session. Because the subagent doesn't inherit the full history of the main conversation, its context is shorter and the fixed overhead per request is smaller—which is exactly why it can be driven by a smaller model. Rationally dividing responsibilities between the main agent and subagents lets expensive models handle only planning and decision-making while delegating mechanical execution to low-cost instances, further reducing overall token consumption.

The Common Logic Behind the Three Habits

These three habits point to the same principle: control context size and allocate model capability on demand. Clearing addresses leftover history across tasks, model matching addresses excess capability, and compression addresses redundant growth within a single session. Together, they cover the main sources of token consumption.

SHA Source recommends starting with /clear from your next session. This action costs almost nothing, yet it makes every request lighter. For developers who use Claude Code frequently, these habits are worth cementing into your daily workflow.

#Claude Code#token consumption#context management#model selection#Sonnet#Opus#Haiku#subagent
Share:

Related articles