Context Window Estimator

See how much of your context window your files will eat.

  • $25 Free
  • 45 sec
  • No signup
1

Add your files and CLAUDE.md size

2

See the context window fill up

3

Trim the biggest offenders

You get: A token-budget breakdown of what's filling your context window.

What's loaded

Your context window

23%46.9k / 200k tokens
Healthy headroom

Where it's going

CLAUDE.md

1.0k

Loaded files

12.3k

MCP schemas

3.6k

History

18.0k

System / tools

12.0k

Free

153.1k

Estimates only, using ~4 characters per token and a 200k-token window. Real token counts vary by content and tokenizer. Confirm your live usage with the /context command in the Claude Code CLI.

What the context window actually is

Every Claude Code session runs inside a fixed context window - a snapshot standard of 200,000 tokens. That window has to hold everything the model can see at once: the system prompt, your CLAUDE.md, the tool schemas from each MCP server, every file you have loaded, and the full back-and-forth of the conversation so far. When the window fills up, Claude Code has to drop or summarize the oldest material to keep going. The estimator above turns the sizes you already know - kilobytes of files, number of MCP servers, how long you have been talking - into an approximate token count so you can see how close you are to that ceiling before you hit it.

The math is a first-order approximation. English text runs at roughly four characters per token, so a kilobyte of text is about 256 tokens. Code is often denser, and different tokenizers count slightly differently, so treat the number as a planning estimate, not a guarantee. The point is not the exact figure - it is the shape of where your window is going, so you can trim the right thing instead of guessing.

The five things eating your window

  • CLAUDE.md - loaded into every single session, so every line is a permanent tax on your window. A 4KB file is about 1,000 tokens you pay on turn one, forever.
  • Loaded files - usually the biggest and most variable chunk. Asking Claude Code to read a large file pulls the whole thing into context, and it stays there.
  • MCP tool schemas - each connected server injects its tool list and descriptions. A handful of chatty servers can quietly cost several thousand tokens before you type a word.
  • Conversation history - grows every turn. A long session reloads all of it on each new prompt, which is why old sessions feel sluggish and hit the wall.
  • System prompt and tool overhead - the base cost of Claude Code itself plus the built-in tool definitions. You do not control this directly, but it is real and worth knowing.

Files and history are the two knobs you control

System overhead and MCP schemas are mostly fixed once you have chosen your setup. The two levers that move most are how many large files you load and how long you let a session run. Trim those first.

How to read the progress bar

  • Under 70% - healthy headroom. Keep working; you have room for the model to reason and load what it needs.
  • 70% to 90% - getting full. Finish the current task, then compact or start a fresh session before the next big step.
  • Over 90% - critical. Quality degrades as the window nears the ceiling because the model has less room to think. Compact now or the session will start dropping context.

How to reclaim context fast

  1. Run /compact to summarize the conversation so far and free up history tokens without losing the thread.
  2. Start a fresh session for a genuinely new task instead of continuing a bloated one - a clean window reasons better.
  3. Trim your CLAUDE.md to under 200 lines. It is loaded every session, so it is the highest-leverage single file to shrink.
  4. Stop loading whole files you do not need. Point Claude Code at specific paths or line ranges instead of pasting entire modules.
  5. Disconnect MCP servers you are not using in this session. Each one costs schema tokens whether or not you call it.
  6. Ask for diffs, not full-file rewrites, so the model's output does not balloon the history you carry forward.

Why a full window hurts quality, not just cost

It is tempting to think of the context window purely as a budget. But a window that is 95% full is not just expensive - it is a worse thinking environment. The model has almost no room to reason, plan, or hold intermediate work, and it is more likely to lose track of instructions buried early in a long history. Keeping healthy headroom is a quality decision as much as a cost decision. The best sessions are the ones where you compact deliberately and keep the working set tight.

What this estimator does not model

This is an approximation. It does not model prompt caching (which affects cost but not window occupancy), tool-call outputs that can spike a single turn, images or non-text attachments, or the exact tokenizer behavior on your specific content. Code tends to be denser than prose, so a KB of minified JSON will cost more tokens than a KB of comments. Use the /context command in the CLI for the authoritative live number, and use this tool to plan before you load.

Frequently asked questions

  • How big is the Claude Code context window?

    The standard snapshot is 200,000 tokens. This estimator budgets against that figure. Anthropic may offer larger windows on some tiers, so confirm your exact limit in the CLI or on their site.

  • How do tokens relate to file size?

    As a rough rule, English text is about four characters per token, so one KB of text is roughly 256 tokens. Code and structured data are often denser, so treat the estimate as a planning figure, not an exact count.

  • Why does my CLAUDE.md cost so much?

    Because it loads into every session. A file that is small in isolation is expensive in aggregate since you pay for it on turn one of every conversation. Keeping it under 200 lines is the single best win.

  • Do MCP servers really use context even when idle?

    Yes. Each connected server injects its tool schemas and descriptions into the window so the model knows the tools exist. That cost is paid whether or not you actually call the tool during the session.

  • When should I compact versus start fresh?

    Compact when you want to keep the current thread but reclaim history tokens. Start fresh when you are moving to a genuinely different task - a clean window reasons better than a compacted one carrying old baggage.

  • How do I see my real context usage?

    Run the /context command in the Claude Code CLI. It shows the authoritative live breakdown of what is occupying your window right now. Use this estimator to plan before you load, and the CLI to verify.

Liked this tool? The club is the next step.

Join Claude Code Club for $9/month. 650+ lessons, weekly updates, and the workflows behind every tool on this site.

  • No experience needed
  • Cancel anytime
  • Updated weekly