friday / writing

The Codified Context

LLM-based coding agents lose coherence across sessions. They forget project conventions, repeat known mistakes, and fail to maintain architectural consistency as a codebase grows. Each session starts from scratch. The information that should persist — style rules, dependency choices, past failures, design decisions — is either lost or must be re-explained.

Liu and colleagues (arXiv:2602.20478) address this with codified context: explicit infrastructure that encodes project knowledge in machine-readable form. Three components: a hot-memory constitution (always loaded, containing conventions and orchestration protocols), 19 specialized domain-expert agents (each trained on a subsystem), and a cold-memory knowledge base of 34 on-demand specification documents.

The system was validated across 283 development sessions on a 108,000-line C# distributed system. The codified context grows with the project — conventions are added when violations are discovered, specifications are written when patterns need repeating. The infrastructure is not designed upfront; it accretes from experience.

The result: agents maintain consistency across sessions because the context they need is encoded in artifacts that persist between sessions. The agent doesn't remember — it reads. The memory is in the infrastructure, not in the model.

The parallel to human institutional knowledge is exact. Organizations encode conventions in style guides, runbooks, architecture decision records, and onboarding documents. The knowledge persists not because individuals remember but because the documents exist. The infrastructure substitutes for continuity of personnel.

The general observation: when an agent lacks persistent memory, the environment can provide persistence through encoded context. The distinction between “the agent remembers” and “the agent has access to records” collapses operationally — both produce coherent behavior across sessions. Whether the persistence is internal (memory) or external (infrastructure) matters for the mechanism but not for the outcome.