Context management
Time: 5–10 minutes
This checkpoint covers the foundational half of the course — from what Claude Code is through the Explore → Plan → Code → Commit workflow — and assesses your confidence before you move into the extension mechanisms.
Context is working memory
Every file Claude reads, every command it runs, every message you send — it all lives in the context window. The context window is a finite buffer that holds everything Claude can "see" in the current session. Running out of space is not a crash; it is a slow degradation as details get summarised away.
What happens when it fills up
When you approach the limit, Claude Code compacts the conversation automatically: it summarises important details and drops the tool call results it no longer needs. Compaction keeps you moving — but the summary is lossy. Details can disappear. Managing context deliberately beats relying on auto-compact every time.
Three commands you should know
/compact — Manual compaction. Summarises everything up to the current point while preserving a memory of what you worked on. Use this when you are mid-feature, close to the limit, and need to keep going.
/clear — Start from scratch with no memory of the previous session. Use this when you are starting a new feature and do not want prior conversation to bias anything new.
/context — Inspect your current context. Shows you the total size, which categories are eating the most space, and a visual breakdown. Run it whenever a session feels sluggish or bloated.
Rule of thumb: /compact when continuing the same feature. /clear when starting a new one. And for things Claude should remember across sessions, put them in CLAUDE.md — not in the current conversation.
Three strategies for saving context space
- Be specific. The irony of short prompts is that they cost more context in the long run. Vague prompts force Claude to explore your codebase more and reason its way to what you meant, burning tool calls along the way. A precise sentence or two saves far more context than it spends.
- Manage your MCP servers. MCP servers load all their available tools into context by default — even the ones you are not using. If you have servers configured for projects unrelated to your current work, disable them. Skills work similarly to MCP servers but only load the name and description, not the full tool definitions.
- Use subagents. Subagents run in parallel with a completely separate context window. For tasks where you only need the answer — "where are the authentication endpoints located?" — a subagent does the digging and returns a summary, keeping your main context clean.
Self-assessment
Rate your confidence on each statement below. This is a checkpoint, not a gate — use it to spot the concepts you might want to revisit before moving on.
1.I can explain what the context window is and why it matters.
2.I know when to use /compact versus starting a new conversation with /clear.
3.I can describe the Explore → Plan → Code → Commit workflow end-to-end.
4.I can explain the difference between Claude.ai and Claude Code.
5.I can describe the agentic loop and how tools enable Claude Code to take action.
6.I can write a descriptive prompt and choose the right permission mode for it.
You've completed the foundations of Claude Code — understanding what it is, how it works, and how to use it effectively with the Explore → Plan → Code → Commit workflow.