Skip to content

🌐 日本語

What Is the Context Window? — What the LLM "Sees"

NOTE

In the previous page, we learned the concepts of Chat / Session. On this page, we examine the overall structure of what Claude Code specifically places inside the Context Window.

The LLM's Thinking Space

For an LLM, the context window is "everything in the world." Information outside the window simply does not exist.

In Claude Code, the following are all placed within this Context Window:

Context Window Structure

ElementInjection TimingDescription
System PromptAlways (at session start)Claude Code's internal system prompt. Users cannot modify
CLAUDE.mdAlways (at session start)Project knowledge and conventions. Hierarchically merged. Recommended under 200 lines
Rules (.claude/rules/)Conditional (on glob match)Injected only when file patterns match
Skills (.claude/skills/)On-demandLLM decides, or user invokes with /
MCP Tools (.mcp.json)Always (as tool definitions)Performance degrades over 20K tokens
Conversation HistoryAlways (accumulates per turn)User-LLM dialogue log. Compressible with /compact

WARNING

Elements Outside Context: settings.json and Hooks are not in the LLM's context window. These are processed by Claude Code's "runtime" (the Node.js equivalent), and do not directly affect the LLM's "thinking."

Difference Between "In Context" and "Outside Context"

CategoryTargetImpact on LLM
Within ContextCLAUDE.md, Rules, Skills, MCP, Conversation HistoryLLM directly "reads" and uses for decisions
Outside Contextsettings.json, HooksLLM is unaware. Runtime handles it

Understanding this distinction is key to grasping the design decisions in Parts 3–7.

Connection to Structural Problems

The structural problems we learned in Part 1 all stem from constraints of this context window:

  • Context Rot: Quality degrades as context fills up
  • Lost in the Middle: Attention to middle sections of context decreases
  • Priority Saturation: Compliance with instructions decreases as instructions within context increase

Previous: Chat / Session

Next: Injection Timing Overview

Released under the CC BY 4.0 License.