Session Is Not the Same as Context Window
The two most commonly confused concepts: what Claude can currently see, versus everything that has happened. They must be kept separate.
- 1 Both Compaction and Trimming are irreversible operations — once compressed, the original details are gone forever
- 2 At compression time, it's impossible to know which Tokens will matter later — today's seemingly irrelevant detail may be the basis for tomorrow's critical decision
- 3 If the original information is lost after compression, it can never be recovered — this is a fundamental constraint of information theory
The correct approach: raw events are stored permanently in the Session, while the Context Window is just a temporary viewport into the Session. Losing the Context is fine — the Session persists, and you can always rebuild from it.
Just like an object in a REPL, the LLM can write code to query and filter events from the Session. The Brain can start reading from any position, rewind to a specific point in time, or re-read the context surrounding a past decision.
- Optimize Prompt Cache hit rate: keep prefixes stable to reduce redundant Token computation costs
- Context engineering: selectively include the most relevant historical events based on the current task type
- The Harness is swappable: different models may need different context strategies; swapping the Harness doesn't affect the Session
| Dimension | Context Window | Session |
|---|---|---|
| Persistence | Temporary, discarded after use | Permanent, durably stored |
| Contents | Curated Tokens | All raw events |
| Operation | Read-only (from Claude's perspective) | Append-only |
| Size | Limited (model's max window) | Unbounded |
| Purpose | Current inference | History replay, state recovery |
You wouldn't load all your files into RAM at once — that would overflow it. By the same logic, you shouldn't stuff all historical events into the Context Window — that would overflow your Tokens. The correct approach is load on demand: store everything in the Session, pull a subset into Context.