Five practical tips for saving tokens in Claude Code
The author outlines five ways to save tokens in Claude Code: use Opus 5.5 as the main model, but set automatic compaction between 400k-600k rather than filling the entire 1M context window.
Drawing on hands-on experience, the author offers specific ways to reduce token use in Claude Code, covering context compaction thresholds, cache duration, and model selection for subagents.
Huashu 2026-10-13 20:47 Yunnan
Practical tips for saving tokens in Claude Code, learned through plenty of trial and error 👇
Opus 5.5 actually goes a fairly long way overall, but its default settings need a few tweaks:
1. You can use Opus 5.5 as your main model, but it is best to avoid filling its entire 1M context window. Set automatic compaction somewhere between 400k-600k. Too little context hurts the results; too much uses more tokens, makes things noticeably slower, and can actually reduce quality;
2. Try to finish a task promptly in one continuous session. The main agent's cache lasts 1 hour. If you return with more requests several hours later and the cache has expired, input token usage will rise noticeably;
3. Use Sonnet 5.5 for subagents whenever possible. They are handling supporting tasks assigned by the main agent anyway, so Opus 5.5 adds little. Haiku 5.5 is not really necessary either, since it does not save that much;
4. Explicitly change subagents' cache duration to 1 hour. Claude Code defaults to a 5-minute cache for subagents, which can easily lead to large numbers of uncached input tokens.
5. Explicitly ask for fewer subagents. As long as the main agent can finish a task, whether it needs substantial compaction or only a little, keeping the conversation going maintains a cache hit rate above 98% and is still quite economical. Starting subagents noticeably increases usage, even with Sonnet 5.5.
Source: Huashu · mp.weixin.qq.com