TokenPincherGet started

Claude Code Context Window Full? Here's Why

TokenPincher

Claude Code warns you the context window is filling up, or worse, cuts a task short because it ran out of room. It usually happens sooner than people expect for a model with a large context window — because the window doesn't just hold your conversation, it holds everything the agent has read and run on your behalf too.

Why it fills up faster than you'd think

The context window is shared by everything in the session: your messages, Claude's responses, every file read, every command output, every grep result, and your CLAUDE.md — prepended fresh on every single turn. In an agentic session, tool output is usually the dominant share. One large file read, one verbose test run, or one big build log can eat a meaningful chunk of the window in a single step, and it stays there, resent on every subsequent turn, until you clear or compact.

Long sessions compound this. A session that's been running for hours across multiple sub-tasks accumulates the tool output from allof them, even the ones you've mentally moved on from.

/compact vs /clear

Claude Code gives you two tools for this, and picking the right one matters:

  • /clearwipes the conversation entirely and starts fresh. Use it when you're switching to an unrelated task — there's no reason to keep dragging old context along, and it's the cleanest way to free up the window.
  • /compactsummarizes the existing conversation into a shorter form instead of deleting it. Use it when you need the thread of a long task to continue but you're running out of room. It's lossy — summarization drops detail — and it only compresses chat history, not the underlying tool output that caused the problem. Full breakdown in /compact explained.

Rule of thumb: task finished or genuinely unrelated → /clear. Same task, just running long → /compact.

Compressing tool output so it fills up less often

Both /compact and /clearare reactive — they deal with the window after it's already full or nearly full. The more durable fix is reducing how much of the window tool output eats in the first place:

  • Ask for specific sections or functions instead of full-file reads when you can.
  • Use quiet or summary flags on commands rather than defaults that print everything.
  • Avoid re-reading files the agent has already seen this session unless they changed.
  • Keep CLAUDE.md tight — it's loaded fresh on every turn regardless of relevance.

Doing this by hand, on every tool call, is easy to forget under deadline pressure. TokenPincher automates exactly this: it compresses large tool output and logs, lossless by default, before they enter context, on every request, so the window fills up slower without you having to manage it turn by turn.

Install
npx tokenpincher init

Related reading

For the complete picture on where Claude Code tokens go and every tactic to cut them, read how to reduce Claude Code token usage, or see the Claude Code overview.