I've been in the tech industry 7.5 years, was a senior staff data scientist before this, have a published paper, and now maintain a popular oss repo whose whole job is cutting the context coding agents burn. I've run a lot of experiments on where Claude Code's tokens actually go, so here's what makes the limits last, from the obvious ones to the ones most people miss.
The one thing to understand first is that every turn re-sends the whole conversation. Caching makes that cheaper, but it still counts against your plan, so almost every saving comes from fewer turns or less context per turn.
The basics
- /clear between unrelated tasks. Old context gets paid for again on every turn after it, and clearing costs nothing.
- /compact at a natural break and tell it what to keep, like `/compact keep the failing test and the files we changed`, instead of letting it auto-compact in the middle of a task.
- Narrow the scope as much as you can. In my own sessions Claude made around 15 navigation calls before its first edit, just finding where to work. If you know the file or function, name it. If you don't, describe where the thing shows up, like "the retry when the payment API times out" or "the save button on the settings page", which still cuts most of that hunt.
- Keep CLAUDE.md short and spend it on gotchas Claude can't see in the code, like the one test command that actually works, because it's loaded on every turn.
- Check /usage and /context once in a while. They show where your usage goes, including MCP servers you forgot were still on.
The ones most people miss
6. Grep is cheap, file reads aren't. In my benchmark runs a grep result was about 170 tokens and a full file read about 1,200, and in my own sessions 1 in 5 reads was a file it had already read. Let it grep, then point it at a line range.
7. Trim big command output. Dumping files with cat and long test or build logs made up over 40% of all tool output in my sessions. Use quiet flags, `git diff --stat` before the full diff, and a hook that keeps only the tail of test output.
8. Don't switch models mid-task. Each model has its own cache, so a /model switch re-reads your whole history uncached. If a cheaper model should do part of the work, hand that part to a subagent.
9. After two failed corrections, /clear and rewrite the prompt. Otherwise every turn keeps re-reading the wrong attempts. For a single bad turn, Esc Esc rewinds to a point that's usually still cached.
10. Leave effort at the default and use `ultrathink` only for the message that needs it, since thinking is billed as output.
11. Don't pick a long session back up after a break. On a subscription the cache lasts about an hour, so after lunch a fresh session with a three-line handoff note costs less than continuing.
12. Use subagents to keep exploration out of the main thread and ask them for short summaries. They still count against your usage, but the 20k tokens of reading don't ride along on every turn after.
Underneath all of this, the biggest long-term win is Claude knowing your codebase: where things live and how the main parts connect. Most of the wasted tokens are it searching for something it could have been pointed to, so a short map of the main folders in CLAUDE.md, and knowing your own repo well enough to point it the right way, pays off on every single task.
I couldnt go into too much details as it was already a long post, feel free to drop your tips in comments