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 477 indexed pages and articles.

  1. Wiki concept Progressive Context Loading (Skills) The three-level loading pattern Claude Code uses to keep skills lightweight. Level 1: initial search only reads the YAML frontmatter (name + Readers have engaged with this next
  2. Wiki concept Claude Code Token Economics The token-accounting model of Claude Code sessions. Every turn re-reads the full conversation, claude.md, MCP tool definitions, system prompts, skill frontmatter, and Related by tokens
  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