Architecture

Context Compaction

The process where Claude summarizes prior conversation to free up context space, preserving key decisions while discarding verbose history.

Context compaction happens automatically when the conversation approaches the token limit. Claude compresses earlier exchanges into a summary, retaining decisions, file paths, and action items while dropping the verbose back-and-forth. The risk is losing critical state: a correction made 40 messages ago might get compacted away. Knowledge OS mitigates this by writing state to files (PRDs, memory files, iteration logs) rather than relying on conversation memory. The Ralph Execute protocol was specifically designed to survive compaction by storing all project state in a PRD file that gets re-read after each compaction event.

Where it shows up:

Long sessionsMulti-phase PRD executionNewsletter pipeline runsComplex planning sessions

Build your Knowledge OS

90 minutes from zero to your first skill chain.