Claude Code context, memory, MCP and hooks: what loads and what it costs
On this page
Run /context in a session to see what the context window is made of right now: the system prompt, tools, MCP servers, memory files, skills and the messages so far. The posts below explain each part and what to trim.
What happens when the context window is full?
A full window does not end the session. Claude Code compacts the conversation on its own. What matters is what loads before you type, when compaction runs, and what survives it.
Full guide: Claude Code context window full.
How much do CLAUDE.md and memory files cost?
They load at session start and ride along with every request, so their size is paid again and again. The Claude Code docs suggest keeping CLAUDE.md under 200 lines and moving workflow-specific instructions into skills, which load only when invoked.
Full guide: How much context CLAUDE.md and memory files take.
What do MCP servers add to the context?
Tool definitions are deferred by default, so at session start only tool names and server instructions enter the context. A server costs more when its tool results are large or when definitions load upfront anyway.
Full guide: Claude Code MCP token usage.
Why are my hooks slow?
Hooks block by default and run on every matching event, so one slow script adds its delay to every turn. Measure each hook, then fix or move the slow one.
Full guide: Why Claude Code hooks are slow, and how to find which one.
Measuring it
/context shows the current window; it does not show cost over time. To see which memory files, MCP servers and skills took tokens across a day or a week, a monitor that reads your session transcripts does: Claude Code usage monitor for Mac, or the mod for Windows and Linux.
Checked against the Claude Code docs on 2026-10-14.