← Claude Code Hub
✦ Tip #003 Feb 7, 2026

Claude Code Context Window: Track Token Usage with /context

The /context command breaks down how many tokens each component of your session consumes, giving you full visibility into the context window before it fills up.

Claude Code operates within a 200k token context window (expandable to 1M tokens on certain plans). Everything Claude needs to function — system prompt, tools, MCP servers, agents, auto memory files, skills, and your conversation — competes for that space. The /context command breaks down exactly how many tokens each component consumes, giving you full visibility into a resource that drains silently.

The /context output in Claude Code: usage by category, MCP tools loaded on demand, and the suggestions block

It's easy to overlook at first. You start adding MCP servers, custom agents, rules... and before you know it, a significant chunk of the context window is already pre-consumed before you type your first message. /context keeps you aware.

Result, in a session running the 1M window:

/context

Context Usage
Opus 5 (1M context)
claude-opus-5[1m]
138.8k/1m tokens (14%)

Estimated usage by category
  System prompt:    4.4k tokens  (0.4%)
  System tools:      21k tokens  (2.1%)
  MCP tools:         265 tokens  (0.0%)
  Memory files:     3.2k tokens  (0.3%)
  Skills:           6.2k tokens  (0.6%)
  Messages:       104.2k tokens (10.4%)
  Free space:      860.7k       (86.1%)

MCP tools · /mcp (loaded on-demand)
└ 126 tools · 265 tokens

Memory files · /memory
└ 1 file · 3.2k tokens

Skills · /skills
└ 48 skills · 6.2k tokens

/context all to expand

 Suggestions
 ℹ File reads using 76.1k tokens (8%) → save ~22.8k
   If you are re-reading files, consider referencing earlier reads.
   Use offset/limit for large files.

Setup

No setup needed. The command is available in any session.

1. Run the command

Type /context at any point during your session:

/context

Run /context all to expand the full breakdown: every MCP tool, every skill and every memory file with its individual cost.

2. Analyze the breakdown

The output shows consumption per category. Pay close attention to:

  • MCP tools: check the detail line under the breakdown. If it reads (loaded on-demand), those tool schemas sit outside your window and only load when they are needed. In the capture that is 126 tools for 265 tokens.
  • System tools: built-in tools load on every request and do not depend on your configuration.
  • Free space: your actual working space. This is what's left for messages, file reads, and command outputs.
  • Autocompact buffer: the reserve Claude sets aside for automatic compaction. It shows up as its own row when your session has autocompact enabled.

3. Act on what you see

The command closes with a Suggestions block pointing at where the avoidable spend is and how many tokens you would get back. In the capture: 76.1k tokens spent on file reads, roughly 22.8k recoverable if you stop re-reading the same thing.

If MCP tools consume too much, run /mcp to see per-server costs and disable those you don't need in this session. With Tool Search enabled (the current default), that category should already be a fraction of what it was: names and instructions only, with schemas deferred. If free space drops below 30%, consider using /compact or starting a fresh session.

If the row that stands out is Skills, this screen only gives you the total. The skill-by-skill split, with the ones you have never invoked flagged, comes from /skill-doctor, and if that total looks high, the folder each skill lives in decides whether it counts at all.

Reference

Category What it includes
System prompt Claude Code's internal instructions
System tools Built-in tools (Read, Edit, Bash, Grep, Glob, etc.)
MCP tools Tool definitions from connected MCP servers
Custom agents Custom agents defined in .claude/agents/
Memory files CLAUDE.md and auto memory files
Skills Descriptions of registered skills
Messages Your conversation: prompts, responses, and tool results
Free space Tokens available to keep working
Autocompact buffer Reserve for automatic compaction
Suggestions Avoidable spend it detected, with the tokens you would recover

Related: When each feature loads into context · The unused plugins costing you context · Why Claude gets worse in long sessions

Official docs: The context window

Part of the 10 habits to save tokens in Claude Code.

Free guide

The 51 essentials, as a guide.

One page per tip. Five chapters. What I actually use daily in production. No theory, no fluff.

  • I. Getting started 10 tips
  • II. Awareness 3 tips
  • III. Mastery 22 tips
  • IV. Autonomy 10 tips
  • V. Comparison 6 tips
Are you a professional Web developer?

You'll receive the guide by email · You join the Gravitas newsletter · Unsubscribe anytime

of 51
#

Wmedia · 51 Tips
Free guide · 51 tips · 5 chapters

The 51 essentials, as a guide.

Are you a professional Web developer? · Unsubscribe anytime
Workshop for teams

Multiply your team's output without sacrificing quality: a 6 to 8 hour AI First workshop, online, on the Claude platform.

See the workshop

Want the 51 Claude Code essentials as a guide?