Guide

Claude Code Context Window: What Uses It and How to Use Less

A shorter prompt helps a little. A smaller working history, narrower file reads and shorter tool output usually matter more.

What fills a Claude Code context window

Context is the working material Claude Code can see in the current session. It includes your instructions, conversation history, files it reads, its replies and tool output. Project rules, memories, skills and hooks can add material before the first prompt.

This is why a task can become heavy without one enormous message. A directory listing, a broad search result and a long test log are all useful only if they help make the next decision. Otherwise they keep travelling with the conversation.

Why later turns can cost more than the first

Each new turn is built on the relevant history already in the session. Early work may include a small brief and a few files. Later work can carry earlier decisions, edits, logs and repeated investigations as well.

The practical question is not "how do I write the shortest prompt?" It is "what must still be available for the next decision?" Keep that answer small and named.

When to use /clear and when to use /compact

Use /clear for a different task

If you move from a CSS bug to a marketing draft, the old conversation is mostly baggage. Start a clean session and state the new goal. If one decision from the previous work matters, copy that decision into the new prompt rather than the whole discussion.

Use /compact to continue one long task

Compaction summarizes the conversation so the task can continue. Before it runs, name the priority: the goal, accepted decisions, files that remain relevant, checks already run and the current risk. Claude Code's documentation calls this focused compaction.

Neither command makes a plan limit larger. They change what the current session carries forward.

Read less of the repository and keep logs useful

  • Start with a narrow search for a filename, symbol or visible phrase.
  • Open the smallest relevant file or range first. Expand only after the result proves it is necessary.
  • Ask for a focused command result, such as failing test names, instead of a full build log.
  • When research is large, keep the final summary with its evidence and leave the raw exploration in its own context.
  • Write down unrelated improvements as Later. Do not add them to the current task because they are nearby.

A local sample, not a promise

The Statistics screenshot in AI-limit-watcher shows one seven-day sample from the author's Mac. In that sample, 74% of tokens were in calls above 200k context. A late turn used 526k tokens compared with 68k near the start. This is a useful signal to inspect your own habits, not a result that every Claude Code user should expect.

AI-limit-watcher shows where usage went and when limits reset. It does not increase a limit or reduce token use by itself.

Copy the context-saver skill

This small skill is for a real task that risks growing into a broad investigation. Copy it into a folder named context-saver, or download the ready folder.

---
name: context-saver
description: Keep a substantial coding or research task focused when it risks broad repository reads, long tool output, or an overloaded session. Do not use for a simple one-file edit.
---

# Context Saver

Work on one user task at a time.

- Start with a narrow search and the smallest files or ranges that can answer the next question.
- Read the full repository or full logs only when earlier evidence shows they are needed.
- Do not add adjacent improvements. Record them as `Later`.
- At the end of a stage, write a short handoff: goal, decisions, files, tests, risks, and one next step.
- Do not promise a percentage reduction in context or token use.

Download context-saver.zip

Sources

Back to AI-limit-watcher