AGENTS.md (committed, shared with your team) and .agents.local.md (gitignored, personal). Every agent reads both at session start. AGENTS.md delivers compressed project knowledge that applies to every developer and every agent on the project. .agents.local.md holds your personal accumulation of session notes, preferences, and patterns that are still experimental.
This page documents what goes in each file, why each section exists, and how to fill them in.
The 120-line budget
AGENTS.md must stay under 120 lines. This is not an arbitrary style rule — it is an instruction budget constraint.
Research by HumanLayer found that frontier LLMs reliably follow approximately 150–200 instructions. A coding agent’s system prompt already consumes around 50 of those slots. That leaves roughly 120 lines for project context. Content that exceeds the budget does not disappear — it competes for attention with everything else, and the agent quietly deprioritizes it.
Deeper documentation belongs in agent_docs/ and loads on demand when a task requires it. The content in AGENTS.md is passive context: it loads into the prompt on every single turn, whether the agent needs it or not. Vercel’s evals found that passive context achieves a 100% task pass rate, versus 53% when agents must decide to look things up. Make every line count.
Run
agent-context validate to check your line count. It warns you when AGENTS.md exceeds 120 lines and suggests moving content to agent_docs/.AGENTS.md sections
Project
Basic project metadata. Keep each field to one line.Commands
Executable commands for the most common developer tasks. Place this section early because agents need it on the first turn.
Limit this to the directories an agent actually needs to navigate. Skip generated directories, build output, and
node_modules.
Project Knowledge (Compressed)
This is the highest-value section in the file. It contains three subsections, each using a compact pipe-delimited format that keeps information dense without requiring prose.Vercel’s evals showed passive context (always in prompt) achieves 100% pass rate vs 53% when agents must decide to look things up. This section is that passive context. Keep it dense and current.
Patterns
Documents recurring code patterns and where to find a canonical example. Format:pattern | where-to-see-it.
Each entry fits on one line. The file reference gives the agent a concrete starting point — it does not need to search.
Boundaries
Rules the agent must not break, with the reason so it understands the constraint. Format:rule | reason.
The reason column matters. An agent that understands why a boundary exists is less likely to violate it when the rule feels inconvenient.
Gotchas
Known traps with their fixes. Format:trap | fix.
A gotcha entry captures pain that has already been felt. Fill these in from your own experience — not from speculation about what might go wrong.
Rules
A numbered list of behavioral instructions for the agent. The template ships with a default set:Deep References
Pointers to theagent_docs/ directory. These files are read only when a task requires deeper context than the compressed section provides.
agent_docs/ is committed alongside AGENTS.md. Treat it like source code — no secrets, same review standards.
.agents.local.md sections
.agents.local.md is your personal scratchpad. It is gitignored by default and never shared with your team. It grows over time as your agent logs what it learns each session. When it exceeds 300 lines, the agent compresses it: deduplicating entries, merging related notes, and flagging stable patterns for promotion.
Preferences
Your personal working style. The agent applies these throughout the session.Patterns
Settled truths about this project that you have validated but have not yet promoted toAGENTS.md. Promote recurring session learnings here.
Gotchas
Things that look right but aren’t. Include why — the agent needs the explanation, not just the warning.Dead Ends
Approaches you tried and abandoned. Recording dead ends prevents the agent from repeating them.Ready to Promote
The agent flags patterns here during compression when something has recurred across three or more sessions. Items use the same pipe-delimited format thatAGENTS.md expects.
AGENTS.md. Run agent-context promote to review what is waiting. Run agent-context promote --autopromote to append them automatically.