/context is a diagnostic command that shows what is filling the context window right now. Use it to find the cause when a conversation gets slow or instructions are being ignored.
How it works
The context window holds your instructions, the files Claude has read, Claude's responses, and content you never see in the terminal. Before you type anything, CLAUDE.md, auto memory, MCP tool names, and skill descriptions are already loaded.
/context [all] visualizes this usage as a colored grid. It also shows optimization suggestions about context-heavy tools, memory bloat, and capacity warnings. If the conversation exceeds the context window, the output shows a warning with how far over it is and which commands free up space. In fullscreen mode, the per-item breakdown is collapsed so the grid shows first, and adding all expands it.
How to use it
- Type /context to see the grid and the suggestions.
- If the per-item breakdown is collapsed, expand it with /context all.
- In the Memory files list, check that CLAUDE.md and CLAUDE.local.md were loaded. If a file is not listed, Claude cannot see it.
- If you have many MCP tools, turn off unused servers in /mcp.
- Follow the suggestions: shorten CLAUDE.md, use /clear if the topic changed, or use /compact if you are continuing the same work.
/context /context all
What you can cut
Here is the direction the official costs doc gives. Use /clear between unrelated tasks, and add instructions to /compact about what to keep. Keep CLAUDE.md under 200 lines, and move procedures needed only for specific tasks into skills, which load only when invoked. MCP tool definitions are deferred by default, so only names and server instructions load first, but it is still better to turn off servers you do not use.
Hand large research tasks to a subagent. A subagent reads files in its own context and returns only a summary, so less of your context fills up.
If you need a larger window, some models support a 1 million token context. Check the model configuration docs for availability and how to select it.
How it relates to nearby commands
- /compact: summarizes the same conversation to free up space. If /context is the diagnosis, /compact is the treatment.
- /clear: starts a new conversation with an empty context.
- /autocompact: sets when automatic compaction starts.
- /memory: opens the memory files you saw in the /context list for editing.
- /usage: shows cost and plan usage limits, not context.
Real examples
You added a new rule to CLAUDE.md, but Claude does not seem to apply it at all
/context
Look for that CLAUDE.md in the Memory files list in the output. If it is missing, the file is in the wrong place. If it is there, check whether the file is too long or conflicts with other instructions.
The conversation got noticeably heavier after you connected several MCP servers
Check with /context, then disable unused servers in /mcp
If a tool that takes up a lot of context shows up in the suggestions, turn off that server first. Even with deferred loading, where only names and instructions load, many servers add up.
A warning appears in a long conversation and you are about to hit the limit
Check with /context, then /compact keep the decisions made so far and the remaining to-dos
You check the current usage in the grid, then compact with instructions so you can continue the same work. Run /context again and you can see the usage went down.
Common mistakes and when not to use it
- Mistaking /context for a compaction command. It only shows information and frees nothing.
- Applying every suggestion in the output at once. Suggestions are candidates, so pick the ones that make sense for your work.
- Not telling context problems apart from usage limit problems. A context warning is not a limit overrun. Check limits with /usage.
- Trimming by gut feeling without looking at the grid. Confirm what is actually large first to avoid wasted effort.
FAQ
How is /context different from /usage?
/context shows what is filling the context window. /usage shows session cost, plan usage limits, and activity statistics.
Does a context warning interrupt my work?
No. Claude Code compacts automatically when it gets close to the limit. If you want to decide what is kept, run /compact with instructions beforehand.
Where can I see which CLAUDE.md files are loaded?
In the Memory files list in the /context output. You can also see and open the file list in /memory.
Checked against the official docs on 2026-10-30. Sources: Claude Code docs: Commands, Claude Code docs: Explore the context window, Claude Code docs: Manage costs effectively, Claude Code docs: How Claude remembers your project. How we write