Skip to content

AI Compass / Knowledge cards

Keeping context clean

fewer tokens, clearer answers

Checked Costs Prompting

The context is everything the model reads along when it answers: instructions, history and files. In Claude Code it grows with every message, because every request sends the entire history so far. Old failed attempts and finished side tasks therefore cost tokens again with every further message.

What it is for

Your subscription quota lasts longer, or with pay-per-use billing you pay less. Long tasks stay on target because the history is not full of old traces.

Steps

  1. Check where the usage goes: /usage shows cost and quota, /context shows what currently occupies the context.
  2. When a new, independent task begins: /clear and give only what is needed again.
  3. After a failed attempt, rewind instead of patching: with an empty input field press Esc twice or call /rewind, then continue writing with the new direction.
  4. Pass long work on via a handoff file. A custom command writes task, status, constraints and problems found into a file with a fixed structure. Then /clear and read the file in the new session. You define the structure yourself.
  5. If the history is still needed, compact it yourself, that is, have it summarised, and say what must stay, for example /compact keep decisions and open bugs. See Limits.
  6. Hand research and refactoring where only the result counts to subagents, and explicitly ask for that in the prompt.
  7. Keep small what is always loaded: if a service offers both a command-line tool and an MCP server (an interface that provides tools to the agent), use the command-line tool. According to the docs, Claude Code only loads an MCP server’s tool descriptions once a tool is needed (before that, only names and server instructions are in the context). But the command-line tool needs no entry at all. Limit long terminal output: the default is 30,000 characters, adjustable with BASH_MAX_OUTPUT_LENGTH.

Limits

Sources

Status

Checked 11 October 2026 · Maturity new (built-in tools, described in the docs; nobody has measured the effect independently)

Want to try this with your team? That’s what the AI Lab is for. See the AI Lab