Claude Code Context Management Discipline

Claude Code Context Management Discipline

The set of practices for keeping Claude Code context windows lean: /clear between unrelated tasks, /compact at ~60% capacity with targeted instructions, /context to audit where tokens go, batched prompts instead of sequential messages, surgical file references instead of whole-repo dumps, lean claude.md files under ~200 lines acting as routing indexes, MCP disconnection via /mcp, and plan-mode-first workflows. Treats context as a budget to be spent and reclaimed, not a free resource.

Key points

  • /clear between unrelated tasks to reset conversation cost
  • /compact manually at ~60% capacity rather than waiting for the 95% auto-trigger
  • /context command shows live breakdown of what’s eating the window
  • claude.md should be under 200 lines and route to other files, not duplicate them
  • Disconnect unused MCP servers at session start with /mcp
  • Use surgical file references (@path or function names) instead of full repo paths
  • After 3-4 compacts in a row, quality degrades — clear and restart with a summary
  • Set a status line showing model, usage percentage, and token count for visibility
  • The 10-hour course introduces context early: system prompts, tools, CLAUDE.md, MCP servers, conversation history, and files all share the same finite context window [src-016]
  • Nate treats context management as a practical operating discipline for long Claude Code builds, not an optimisation to learn after things break [src-016]
  • Mornati’s article adds a configuration-level rule: keep low-frequency service guidance in On-Demand Skill Files or CLI/API references, and reserve Native MCP for tools whose G/N ratio is high enough to amortize schemas [src-041]
  • Skill files placed in always-loaded context behave like miniature schemas, so service-specific instructions should not live in CLAUDE.md unless they are truly global [src-041]
  • [src-061] points toward a model-native successor: agents can learn when and how to compact their own histories, turning context management from a human operating discipline into Agentic Context Management.

Related entities

Related concepts

Source references

  • [src-004] Nate Herk cluster — Nate Herk — Claude Code cluster (21 videos)

– Videos referenced: 49V-5Ock8LU, tXtCK66fPj8, zKBPwDpBfhs

  • [src-016] Nate Herk — “Build & Sell with Claude Code (10+ Hour Course)” (2026-03-12)
  • [src-041] Marco Mornati — “The Future of Agentic Tooling: MCP Servers vs. CLI A Data-Driven Comparison” (2026-04-27)
  • [src-061] Lex Fridman – “State of AI in 2026: LLMs, Coding, Scaling Laws, China, Agents, GPUs, AGI | Lex Fridman Podcast #490” (2026-01-31)

Robin Cartier perspective

This page is part of Robin Cartier's working AI knowledge graph: a practical research layer for production AI, recommendation systems, experimentation, GEO, and agentic web readiness.

The useful next step is to connect this concept back to applied product leadership and operating models.

Recommended next

Keep reading from this thread

From 494 indexed pages and articles.

  1. Wiki concept On-Demand Skill Files Pattern for keeping service-specific CLI/API guidance out of the always-loaded project context until the agent actually needs that service. Related by mcp
  2. Wiki concept Tool Schema Tax The fixed context cost paid when an agent runtime injects tool schemas into every prompt, regardless of whether those tools are used in Related by mcp
  3. Insight AI Beyond POCs How enterprise AI moves beyond proofs of concept through ownership, governance, measurement, adoption, and production operating models Readers have engaged with this next