Are you the author? Sign in to claim
Repository Context Layer — a git-native context.md standard for AI agents: consult before planning, write back what was
A proposed standard for AI project context: one markdown file, versioned with the code, that agents read before planning and append to after working — under human review.
Git stores what changed.
context.mdstores what the project knows.
📋 Spec · 📝 Full example · 📄 Whitepaper (PDF) · 🎓 Paper (preprint, PDF)
A pre-registered evaluation on SWE-bench Verified (protocol frozen and timestamped before any run — see experiment/):
![]() A frontier agent running the lifecycle resolves 72.9% of held-out tasks vs 58.3% without it (+14.6 pp, p = 0.041). |
![]() Context helps a small model only when its author is more capable: frontier-written context +26.1 pp (p < 0.0001); the model's own lessons +0.0. |
And it pays for itself: 32% fewer tokens per fixed bug — successful fixes cost the same; the saving is the doomed exploration that never happens.
Every number is reproducible from the released data: cd experiment && make docker-reproduce → 15/15 claims reproduced. Full protocol, transcripts, and verdicts in experiment/; details in the paper.
# Repository Context
## Intent
Local-first CLI. Files are the source of
truth; SQLite is a rebuildable index.
## Constraints
- No ORM. Rejected 2026-03: query opacity
broke the offline repair path.
## Evolved Context
- [2026-06-29] pkg x >= 3.0 breaks ARM64
builds. Pin to 2.3.x until fixed.
Three sections, all required:
Agents find the file at a fixed path — .repo/context.md, else context.md at the repository root — never by searching.
consult → execute → update → commit
Because the file lives in git, it branches when the code branches, merges when it merges, and rolls back when it rolls back. Conflicting learnings on two branches are an ordinary merge conflict, resolved by a human in review.
context.md at your repository root (start from the example).No SDK, no server, no vendor: any agent that can read a file participates, and any human with a text editor is a first-class writer.
READMEs describe how to use a project, not how to change it. ADRs are write-once essays no agent is required to read. RAG retrieves by similarity, which fails for constraints — a rule matters most when nothing in the prompt resembles it. IDE memories are private to one tool and invisible to review. Agent instruction files (CLAUDE.md, AGENTS.md) carry orders downward but have no defined way to absorb what the agent learns. What's missing is the combination: versioned with the code, consulted by contract, and written back by the agent under human review. The full argument is in the whitepaper; the formal treatment — properties, lifecycle semantics, design analysis, and the reference implementation — is in the paper.
The standard covers discovery and lifecycle, not content. Anything beyond the three headers — decision logs, pattern catalogs, per-directory context — is convention layered on top. Under-specified and adopted beats complete and ignored.
Metatron is one reference implementation: decisions kept as git-backed markdown, served to agents at consult time, feedback routed into the ledger. The abstraction is the point, though — any tool, or none at all, can implement it.
© 2026 P. Kerbel. Freely available. This repository is the canonical home of the Repository Context Layer.
⚠️ Experimentelle Skill-Sammlung für deutsches Recht (Arbeits-, Gesellschafts-, Insolvenz-, Datenschutz-, Prozessrecht u
Manage multiple Claude Code agents from TUI or Web with tmux and git worktrees
Project management using GitHub Issues + Git worktrees for parallel agent execution
Core skills library for Claude Code with 20+ battle-tested skills including TDD, debugging, and brainstorming