CHAPTERS
What “context” means in Claude Code (the working memory budget)
The video defines context as Claude’s working memory: everything Claude reads, runs, or receives accumulates in a finite context window. Understanding what contributes to that window is the foundation for managing it effectively.
Why context optimization matters during development
As you work longer in a session, context can fill up and reduce effectiveness. The video frames context management as a practical necessity to keep Claude focused on the current task.
Automatic compaction: what happens near the context limit
When you approach the context window limit, Claude Code automatically compacts the session. Compaction summarizes key details and removes less useful artifacts (like verbose tool results) to free space.
Manual compaction with /compact (keep a summary, free space)
You can compact on demand using the /compact command. This is useful when you want to continue the same feature but need to reduce context usage while retaining a high-level memory of prior work.
Starting completely fresh with /clear (remove prior session influence)
If you want to reset entirely, /clear wipes prior context so Claude starts without memory of what happened earlier in the session. This helps avoid “bias” from earlier discussions when switching to a new feature or direction.
Inspecting context usage with /context (see what’s taking space)
The /context command provides visibility into current context size and what categories are consuming it. The video emphasizes using this view to make informed decisions about compacting or clearing.
Rule of thumb: compact to continue a feature, clear to start a new one
The guidance is simple: if you’re mid-feature and running long, compact to keep momentum with relevant context. If you’ve finished and are starting something new, clear to reset the mental frame.
Persisting important knowledge across sessions with claude.md
For information you want Claude to remember in future sessions, store it in a claude.md file. This prevents Claude from having to re-discover key project facts each time.
Be specific: shorter prompts can cost more context long-term
The video highlights a counterintuitive point: overly brief prompts can lead to more context usage. If Claude must explore the codebase and reason more to infer intent, it can consume more context than a couple of explicit sentences would.
MCP servers and tool bloat: turning off unrelated tools
MCP servers load their available tools into context by default, which can inflate context usage. If you have many unrelated MCP servers enabled, disabling them can save substantial space.
Using skills as a lighter-weight alternative to MCP servers
Skills are presented as similar to MCP servers but without loading the entire toolset into context. This can preserve context window capacity while still enabling capabilities.
Subagents: parallel work with separate context windows
Subagents run alongside the main agent with a completely separate context window. They’re ideal for tasks where you only need the answer (not the full investigative trail), returning a concise summary back to the main session.
Practical wrap-up: a workflow for keeping context under control
The closing consolidates the tactics into a simple operating approach: monitor context, compact long sessions, clear between features, write durable notes in claude.md, be explicit in requests, and delegate via subagents when appropriate.
