The biggest weakness of AI coding agents is that they forget everything when a session ends. Project rules, past mistakes, all gone. Developers started writing rules in files like CLAUDE.md and .cursorrules, but a study of 253 CLAUDE.md files (Agentic Coding Manifests) found that a single file cannot cover a 100K-line codebase.
The answer to this problem is Codified Context. In February 2026, Aristidis Vasilopoulos formalized this approach in a paper (arXiv:2602.20478). It structures project knowledge inside the codebase so that agents do not start from scratch every session. The central idea is to treat documentation as infrastructure by design.
Why Structure Works: The 3-Tier Architecture
What makes Codified Context different from a simple rules file is that it separates knowledge into three layers by access frequency.
Tier 1 is the Constitution. A single Markdown file of about 660 lines containing coding standards, build commands, and a trigger table. It is auto-loaded at the start of every session as hot memory. It defines what the agent should know before it writes a single line of code.
Tier 2 is Specialized Agents. Domain-specific agent specs. In the paper's case study, 19 agents totaling about 9,300 lines. A trigger table controls routing. Change a network sync file and network-protocol-designer is called automatically. By predefining which knowledge is needed for which files, agents retrieve the right context without being told.
Tier 3 is the Knowledge Base. 34 spec documents totaling about 16,250 lines, searchable on demand via an MCP server. Cold memory that does not consume the context window until needed.
This design solves a fundamental dilemma: load everything and the context overflows; load nothing and the agent loses track. By separating always-loaded knowledge, trigger-invoked knowledge, and search-retrieved knowledge, maximum context is maintained within a limited context window.
What This Structure Produced: 100K Lines by One Person
Vasilopoulos is a chemist, not a software engineer. Using Claude Code as his only code generation tool, he built a 108,256-line C# multiplayer game in 70 days. 405 files, 283 sessions, 2,801 human prompts. The knowledge-to-code ratio was 24.2%. For every 4 lines of code, there was about 1 line of context documentation.
The 3-tier structure showed concrete results in the save system. A 283-line spec (Tier 3) was refined over 74 sessions. Zero save-related bugs were reported. Because past failures and correct patterns accumulated in the spec, the agent did not repeat the same mistakes. For UI sync routing, a 126-line spec collected lessons learned, and the next similar feature was built correctly on the first try.
Maintenance cost was about 5 minutes per session for spec updates, plus a 30-45 minute review every two weeks. About 1-2 hours per week total.
Caveats and Tool Support
This research has clear limits. It is an observational report from a single developer on a single project, not a controlled experiment comparing results with and without Codified Context. The implementation is specific to Claude Code, so direct applicability to other tools remains at the principle level. Other research has reported that context files can actually lower task success rates in some cases. The effect depends on conditions.
That said, the principle of structuring knowledge for agents has been adopted across vendors. Claude Code has four scope levels (organization, project, user, local) with CLAUDE.md, .claude/rules/, and Auto Memory. Cursor uses Project, Team, and User Rules plus AGENTS.md, with .cursorrules now legacy. GitHub Copilot supports .github/copilot-instructions.md, .github/instructions/ directory files, and AGENTS.md. Context files are not configuration. The AI reads them and tries to follow them, but there is no guarantee. Conflicting instructions are resolved arbitrarily.
Conclusion
The central insight of Codified Context is practical: if you have explained something to an AI agent twice, it should be a spec document. And those specs should be designed by deciding what to always load, what to invoke by trigger, and what to search on demand. Treating project context as infrastructure is shaping the next phase of AI-assisted development.




Top comments (0)