The .agents/ Directory
The repo tier of the context hierarchy. An agent can read every line of your code and still write the wrong thing, because the knowledge that matters most is not in the code — it's in people's heads. The .agents/ directory is where you write that knowledge down so every agent starts each task already briefed.
An agent without your context makes confident, wrong assumptions about your requirements. A new hire reads the onboarding wiki before touching the codebase; an agent should read its briefing before every task.
Code is not context
LLMs are good at reading code and bad at inferring intent from it. A model can see that you call a function, but not that you use Fernet for encryption everywhere, that every API route needs auth middleware, or that you never use VARCHAR because a past migration burned you. That is the non-obvious knowledge experienced developers carry — and an agent without it guesses.
So you write it down. A scaffold drops a handful of markdown files in .agents/, each split by concern, and agents read them before every task.
Routed by role
The directory is not one big context dump. It is split by concern, and each agent in the pipeline reads only the files relevant to its job. A single monolithic context file forces every agent to read everything, which burns tokens and buries the three lines that matter. Splitting by concern means context is routed, not broadcast.
A file is a contract
Each file is plain markdown with one extra convention: a header line naming the agents that read it. Here is a filled-in ARCHITECTURE.md — none of which is inferable from any single file in the repo:
# Architecture
> Agents: Planner · Implementer · Reviewer · Risk
## Service Boundaries
| Service / Module | Responsibility | Communicates With |
|------------------|---------------------------|-------------------|
| engine/api | HTTP, auth, validation | orchestrator, db |
| orchestrator | poll, dispatch, reconcile | workers, tracker |
| workers | run the coding-agent CLI | code host, db |
## Key Design Decisions
- Async everywhere (asyncpg, async SQLAlchemy).
- JWT in HTTP-only cookies; OIDC/SSO for enterprise.
- Fernet encryption for stored tokens; keys rotate quarterly.
The tables are deliberate — an agent parses "orchestrator talks to workers and the tracker" far more reliably from a row than from a paragraph. The reason behind async-everywhere is institutional memory; the Fernet decision is exactly the kind of thing an agent would otherwise reinvent three different ways.
Of the eleven, SPECIFICATION.md does the most work. The Planner writes it from an issue, and every downstream agent validates against it — especially the out-of-scope list, which is how you stop an agent from gold-plating a two-line change into a refactor nobody asked for. The acceptance criteria become the Reviewer's checklist and QA's test targets; the risks line is what the Risk agent reads before it scores. One file, read four different ways.
Be specific, or don't bother
The failure mode is vagueness. The test is simple: if an agent could infer it from the code, leave it out; if it could not, write it down precisely — real paths, real function names, real table names.
CLAUDE.md, taken seriously
If this feels familiar, it should. A coding agent already reads a root instruction file on every run — build commands, conventions, architecture notes — injected straight into the system prompt. The .agents/ directory is that same instinct taken seriously: instead of one catch-all file that grows into a monolith, a set split by concern and routed by role. One CLAUDE.md is a sticky note; eleven routed files are an onboarding program.
And the instinct itself is now an open standard, not a private convention.
AGENTS.md began as a collaboration spanning OpenAI Codex, Amp, Google Jules, Cursor, and Factory, and is now stewarded by the Agentic AI Foundation under the Linux Foundation. The format is read natively by roughly twenty tools — Codex, Cursor, Copilot, Gemini CLI, Aider, Windsurf, Zed, Factory, Jules, and more — so one file in the repo briefs every agent that touches it. The standard already anticipates routing: nested AGENTS.md files scope instructions to subtrees, and OpenAI’s own codex monorepo ships 88 of them. The .agents/ directory on this page extends that single-file standard one step further — the same system of record, split by concern and routed by role rather than nested by path.
The one rule that matters after you write these files is to keep them true. Out-of-date context is actively harmful — it leads agents to the confident wrong assumptions the directory exists to prevent. Because the files are plain markdown in the repo, the .agents/ update is part of the change, not a cleanup task for later.
That is the whole idea: the context layer for a single repo, kept honest, in the repo. To scale it across many repos, give the whole system one — the poor man's monorepo.