All notes

Your AI agent has no memory. Context files are the fix

Your coding agent forgets everything between sessions. It does not remember the package manager you use, the directory you told it never to touch, or the fix you made it repeat three times yesterday. Each session starts with a blank context window, and you pay for that amnesia every time you correct the same mistake twice. That is why over 60,000 open-source projects now ship an AGENTS.md briefing file, which the standard describes plainly: "Think of AGENTS.md as a README for agents." I made the same case for taste in write your taste down — models forget between sessions, so you write the standard to a file. Context files apply that logic to the whole repo, and done right, they are the cheapest win in AI building.

Why does your AI agent start from zero every session?

Every session begins with a fresh context window, and nothing carries over unless you put it somewhere the agent reads. Anthropic's guide to Claude Code memory is explicit: each session starts cold, and the only things that carry knowledge across are the CLAUDE.md file you write and the memory notes the tool keeps for you. The model does not remember your repo. A file does. Once you accept that, the whole problem becomes a writing problem, not a model problem.

What belongs in a context file?

A good briefing file holds only what the agent would get wrong without being told. Exact build and test commands, the package manager, conventions that break the language defaults, architectural boundaries, directories that are off limits, known failure modes. Nothing the agent can discover by reading the code. If a line repeats what a file already shows, it is noise, and noise competes with the signal you actually care about.

OpenAI's own codex repository ships 88 AGENTS.md files, one per directory, because the nearest file to the code wins. That is the pattern that scales: small files that load only when the agent touches that part of the project, not one giant document nobody reads.

Why do bloated context files make agents worse?

This is where the story turns. The first rigorous study of these files, an ETH Zurich evaluation of AGENTS.md, tested agents with no context file, with a generated one, and with a developer-written one. The generated files made things worse: mostly redundant, repeating overviews the agent could already see, and they pushed inference cost up by over 20%. The developer-written files barely moved success rates. Anthropic's own docs warn that bloated CLAUDE.md files cause Claude to ignore your actual instructions.

That matches what I see in real repos. A 400-line context file is documentation theater. The agent skims it, the important rules get diluted, and you traded a forgotten project for a file nobody trusts.

How do you keep a context file tight?

Three moves hold up. Write it like a contract, not a novel: commands, constraints, gotchas, nothing else. Audit it whenever you catch a mistake the file should have prevented; if the agent ignored a rule, the rule was probably buried. And measure it: run one task with the file and one without, then compare the result and the token bill. If the file does not win, trim it.

Treat it as living documentation and commit it to git. Every correction you do not have to repeat is a session you get back.

What does a briefing file change for solo builders?

For a solo founder, the briefing file is the closest thing you have to a second pair of hands. You cannot afford to re-explain your architecture every morning. The agents that act like teammates are not the smartest ones; they are the ones that were briefed well. The file is the memory the model does not have, and for a one-person company, memory is the whole moat.

Write the file that makes your agent stop guessing, and keep it short enough that it gets read. That is the entire skill.

Frequently asked questions

  • Coding agents start each session with a fresh context window. Unless a file like AGENTS.md or CLAUDE.md briefs them, the agent re-learns your project every time and repeats the corrections you gave it yesterday. The briefing file is the only thing that carries knowledge across sessions.

About the author

mosh

mosh is a product designer and design engineer working with design systems, LLM-powered prototypes, agent-safe interfaces, production UI, and automated workflows.

Keep reading