Context the agent reads
The model remembers nothing from one session to the next, so the harness “assembles the context” (source: Matt Pocock: Dictionary of AI coding, harness) it reads. Some of it loads before you type: “CLAUDE.md, auto memory, MCP tool names, and skill descriptions all load into context” (source: Anthropic: Explore the context window). The rest is read when a phase needs it. /context shows “what’s using space” (source: Anthropic: How Claude Code works), and “which CLAUDE.md and rules files loaded at launch” (source: Anthropic: Memory).
The instruction file is context, not configuration
Section titled “The instruction file is context, not configuration”CLAUDE.md is “loaded at the start of every conversation” (source: Anthropic: Memory), and Claude Code treats it as “context, not enforced configuration” (source: Anthropic: Memory). The memory page draws the line itself: “to block an action regardless of what Claude decides, use a PreToolUse hook instead” (source: Anthropic: Memory). So the file keeps to “facts Claude should hold in every session” (source: Anthropic: Memory), and anything that must hold whatever the agent decides becomes a check, which Checks that block covers.
The budget is a line count. Anthropic’s memory page says to “target under 200 lines per CLAUDE.md file” (source: Anthropic: Memory), because “longer files consume more context and reduce adherence” (source: Anthropic: Memory), and splitting it into imports does not help, since “imported files also load at launch” (source: Anthropic: Memory). The best practices give the test for every line, “would removing this cause Claude to make mistakes?” (source: Anthropic: Best practices for Claude Code), and cut what fails it. I keep mine under that target and put that question to each line. A multi-step procedure goes elsewhere: “move it to a skill or a path-scoped rule instead” (source: Anthropic: Memory), and path-scoped rules “load only when Claude works with matching files” (source: Anthropic: Memory). This site’s CLAUDE.md holds what the project is, its hard rules and a map of where things live.
The briefs
Section titled “The briefs”Impeccable reads two files before it designs anything. PRODUCT.md holds “audience, goals, platform, constraints, terminology, and confirmed brand commitments” (source: Impeccable: Context); DESIGN.md holds “the shared visual system: colors, typography, components, and design rules” (source: Impeccable: Context). Without them, “missing or vague context can lead to more generic design” (source: Impeccable: Context). I keep the product brief and the prose of the design record to intent, what the code cannot say.
Both are read when a phase needs them, not at every start, and the design record is the heavy one: in Atlassian’s tests a DESIGN.md file “loads everything, every time” (source: Atlassian: Atlassian's DESIGN.md is here), which means “higher cost and slower responses from the start” (source: Atlassian: Atlassian's DESIGN.md is here). The design record does a second job too: “when DESIGN.md is available, the detector and design hook can check for drift from documented values” (source: Impeccable: Context), the fonts, colours, radii and type sizes it records. Its sidecar, .impeccable/design.json, holds “generated design metadata used by tooling” (source: Impeccable: Context): refresh it with /impeccable document, never by hand.
The glossary and the decision records
Section titled “The glossary and the decision records”GLOSSARY.md holds the project’s words and the words to avoid; docs/adr/ holds the decisions that qualified for a record, with their reasons. /grill-with-docs writes both, as Align on done describes, and later skills read them: /to-spec “synthesises what is known (from the thread, the codebase, your GLOSSARY.md and ADRs)” (source: Matt Pocock: to-spec).
Memory
Section titled “Memory”Claude Code keeps notes of its own. Auto memory “lets Claude accumulate knowledge across sessions without you writing anything” (source: Anthropic: Memory), and “the first 200 lines of MEMORY.md, or the first 25KB” (source: Anthropic: Memory) load at the start of every conversation. It “skips anything it can derive from the codebase, such as architecture, file paths, or debugging fixes” (source: Anthropic: Memory). I keep the same rule: pointers and facts the code cannot say, with the state read from git and GitHub. A pull request’s status or a commit hash copied into memory is a fact that goes stale, which is rule 6: context is derived, never copied.
What a compaction reloads
Section titled “What a compaction reloads”When the window fills, Claude Code “clears older tool outputs first, then summarizes the conversation if needed” (source: Anthropic: How Claude Code works), and “detailed instructions from early in the conversation may be lost” (source: Anthropic: How Claude Code works). What comes back “depends on how it was loaded” (source: Anthropic: Explore the context window): the project-root CLAUDE.md and auto memory are “re-injected from disk” (source: Anthropic: Explore the context window); of the files Claude read or edited, “Claude Code re-reads up to five, most recently modified first” (source: Anthropic: Explore the context window); “skill bodies are re-injected after compaction” (source: Anthropic: Explore the context window); and what hooks added earlier is “summarized with the rest of the conversation” (source: Anthropic: Explore the context window). For path-scoped rules, “Claude Code reloads them on demand” (source: Anthropic: Explore the context window), since “compaction summarizes them away with everything else” (source: Anthropic: Explore the context window). Hence the rule: “if a rule must persist across compaction, drop the paths: frontmatter or move it to the project-root CLAUDE.md” (source: Anthropic: Explore the context window). When an instruction vanishes after a compaction, the memory page’s first cause is that “it was given only in conversation” (source: Anthropic: Memory).
The smart zone
Section titled “The smart zone”The window is not the budget. In Matt Pocock’s dictionary, the agent starts a session in the smart zone, “sharp, focused, recall is good” (source: Matt Pocock: Dictionary of AI coding, smart zone), and drifts into the dumb zone as the session grows. Where the drift begins is a debated range. The dictionary says that on frontier models the dumb zone “commonly begins around 125K-150K tokens — though this is debated” (source: Matt Pocock: Dictionary of AI coding, smart zone); another of his pages puts it “at around the 40% context mark” (source: Matt Pocock: Why the Anthropic Ralph plugin sucks), and adds that “everyone agrees the boundary exists” (source: Matt Pocock: Why the Anthropic Ralph plugin sucks).
The drift arrives long before the limit: “a session can be deep in the dumb zone with most of the window still free” (source: Matt Pocock: Dictionary of AI coding, smart zone). Anthropic describes the cause as an attention budget, where “every new token introduced depletes this budget by some amount” (source: Anthropic: Effective context engineering for AI agents). So “plan around the smart zone, not the window” (source: Matt Pocock: Dictionary of AI coding, smart zone); Sessions and effort covers what to do at its edge.
Sources
Section titled “Sources”- Matt Pocock: Dictionary of AI coding, harness github.com
- Anthropic: Explore the context window code.claude.com
- Anthropic: How Claude Code works code.claude.com
- Anthropic: Memory code.claude.com
- Anthropic: Best practices for Claude Code code.claude.com
- Impeccable: Context impeccable.style
- Atlassian: Atlassian's DESIGN.md is here atlassian.com
- Matt Pocock: to-spec aihero.dev
- Matt Pocock: Dictionary of AI coding, smart zone github.com
- Matt Pocock: Why the Anthropic Ralph plugin sucks aihero.dev
- Anthropic: Effective context engineering for AI agents anthropic.com