Claude Code Context Window Explained: Limits, Tips & How to Track It
In this article
Claude Code has a 200,000-token context window per conversation, shared between all the files, chat history, tool outputs, and system prompts in a session. When you hit the limit, Claude starts dropping earlier context or you see degraded responses. As of July 2026, this 200K window applies across all Claude Code plans (Pro and Max). Usagebar shows your live context fill percentage in your macOS menu bar so you always know where you stand.
- Context window: 200,000 tokens per conversation
- Roughly equals ~150,000 words or ~500KB of plain code
- Context does not reset on a timer — it resets when you start a new session
What is the Claude Code context window?
The context window is the total amount of text Claude can "see" at once inside a single conversation. Every message you send, every file Claude reads, every tool result (bash output, file diffs, test results) counts against the same 200K-token budget. Once that budget is full, Claude either truncates older messages or the conversation stalls. According to Anthropic's model documentation, all current Claude 3.x and Claude 4.x models support 200K input tokens.
A token is roughly 3-4 characters of English text, or about 2-3 characters of code. A 1,000-line TypeScript file is typically 8,000-12,000 tokens depending on how verbose the code is. So a 200K context window fits roughly 15-25 moderately sized source files alongside your conversation history.
What fills up context in Claude Code?
Context consumption in Claude Code is not just your typed messages. Several automated inputs consume tokens silently in the background.
| Input type | Typical token cost |
|---|---|
| System prompt / CLAUDE.md instructions | 500 – 3,000 tokens |
| Each file Claude reads (per read) | 500 – 15,000 tokens |
| Bash / terminal tool output | 100 – 5,000 tokens per run |
| Your typed chat messages | 50 – 500 tokens |
| Claude's own replies | 200 – 2,000 tokens |
| File diffs / search results | 1,000 – 8,000 tokens |
Long bash outputs (test runs, build logs, npm install) are one of the biggest surprises. A full Jest test suite output can be 10,000+ tokens. This is why Claude Code uses so many tokens compared to what you type — the tool calls pile up fast.
How is the context window different from usage limits?
The context window (200K tokens) is a per-conversation technical ceiling set by the model. Usage limits are a separate rate-limit imposed by your subscription plan (Pro or Max), measured across a rolling 5-hour window and a weekly cap. You can hit either independently: a long coding session can exhaust context without touching your plan limit, or heavy multi-session use can exhaust your plan limit with context still mostly empty.
See the does Claude Code usage affect Pro limits breakdown for how the two interact, and Claude Code weekly limit vs 5-hour lockout for how the plan-level caps work.
How can you check context usage in Claude Code?
Claude Code does not show a live context percentage in the terminal by default. Your three main options are:
- /usage command: Type
/usagein the Claude Code terminal. It reports token counts for the current session but requires you to remember to check it. - claude.ai/settings/usage: Shows aggregate token consumption across your account, not per-session context fill.
- Usagebar: A $9 one-time macOS menu bar app that shows real-time context fill, 5-hour usage, and weekly cap — all with notifications at 50%, 75%, and 90% so you know before you hit a wall.
For a detailed walkthrough of each method, see how to check Claude Code usage limits and how to check Claude Code token count.
How to manage context on large codebases?
For large projects, context exhaustion is the primary bottleneck — not plan limits. These techniques keep you under 200K across long sessions.
Use /compact or start fresh sessions
Claude Code supports a /compact slash command that summarizes the conversation history into a compressed form, freeing up context budget. According to the official Claude Code slash commands documentation, /compact replaces verbose history with a condensed summary while preserving key decisions. Alternatively, starting a new session resets context entirely.
Scope what Claude reads
Instead of letting Claude glob-read entire directories, explicitly name the files relevant to the task. Saying "look at src/auth/login.ts and src/auth/middleware.ts" burns ~10,000 tokens. Saying "look at the whole src/ folder" can burn 100,000+ tokens on a mid-sized project.
Truncate tool output
Pipe long bash outputs through head or grep before Claude sees them. npm test 2>&1 | tail -50 instead of the full output saves thousands of tokens per test run. More techniques are covered in how to reduce Claude Code token usage.
Keep CLAUDE.md concise
Your CLAUDE.md project instructions are injected at the start of every session. A bloated CLAUDE.md with 3,000 tokens of boilerplate costs you 3,000 tokens before you've typed a single message. Trim it to only what Claude needs to know that it can't infer from the code.
Break large tasks into sessions
Plan your work so each session has a narrow scope: one feature, one bug, one refactor. Cross-session context is not preserved, but Claude Code's slash commands like /memory can persist notes between sessions without burning live context.
Does context usage affect billing or plan limits?
On Claude Code's Pro and Max plans, you pay a flat subscription — not per token. Context window usage is not billed individually. However, higher context consumption per session does map to higher underlying API usage, which is what your 5-hour rolling rate limit and weekly cap are measured against. Sessions with heavy file-reading will exhaust your plan limits faster than sessions where you only chat. As of July 2026, Anthropic's support documentation confirms Claude Code usage is deducted from your Pro/Max plan allowance.
Key takeaways
- Claude Code's context window is 200,000 tokens per conversation, covering all inputs: files, messages, tool outputs, system prompts.
- Context resets when you start a new session, not on a timer. Plan limits reset on a rolling 5-hour window (separate system).
- Tool outputs (bash, tests, file reads) consume more context than your typed messages — often by an order of magnitude.
- Use
/compactto compress history mid-session, or start a fresh session for unrelated tasks. - Scope file reads explicitly and truncate terminal output to stretch context further on large codebases.
- Usagebar ($9, one-time) shows live context fill and notifies you before you hit limits — the fastest way to stay aware without running
/usagemanually.
Sources
Never Get Locked Out Mid-Task Again
Never hit your usage limits unexpectedly. Usagebar lives in your menu bar and shows your 5-hour and weekly limits at a glance.
Get Usagebar$9 — one-time, lifetime updates