How to reduce Claude Code token usage and stop hitting limits
Six ways to cut the tokens Claude Code and Codex burn per message, from /compact and a lean CLAUDE.md to a free prompt compressor that runs in your terminal.
October 20, 2026 · 5 min read
Claude Code, Codex and other terminal coding agents are token-hungry by design. Every message carries the conversation so far, the files the agent has read, and your project instructions. That is why heavy users hit their usage limits by lunchtime, and why API bills climb fast. The fix is mostly about sending less: less context, less repetition, and shorter prompts.
1. Clear and compact the conversation
A long session makes every new message more expensive, because the whole history goes along with it. When you finish one task, run /clear before starting the next. In the middle of a long task, run /compact to replace the history with a summary.
2. Keep CLAUDE.md short
Your project instructions are loaded into every session. A few hundred focused lines about how the project works are worth more than a sprawling document, and they cost tokens on every single message. Move rarely needed detail into separate files the agent can open when it needs them.
3. Point at files instead of pasting them
Pasting a whole file or a full log is the biggest token sink in coding workflows. Name the file and the function, or paste only the lines that matter. The agent can read the rest itself if it needs to.
4. Write prompts like commit messages
“Could you please,” “I was wondering if,” “be as detailed as possible” and “thanks so much” add tokens without adding information. Lead with the verb, state each requirement once, and say what done looks like.
5. Ask for less output
Replies count too. “Code only,” “just the diff” or “summarize in three bullets” keeps the answer to what you will actually read.
6. Use a prompt compressor
Habits slip mid-task. A prompt compressor applies them automatically. The free TerraWatch CLI wraps Claude Code or Codex (twc-live claude) and compresses every message the moment you press Enter. Compression runs on your machine, so it is instant, unlimited and private. Slash commands and pasted code are left exactly as typed. Add --deep for an AI rewrite when a prompt needs restructuring, and run twc stats to see the tokens and money you have saved.
Working in ChatGPT, Claude or Gemini in the browser instead? The TerraWatch extension does the same next to the message box. Want a number first? Try the savings calculator.