# AGENTS.md

> A file in the environment that the harness loads into the context window at session start — the project's standing brief to the agent.

A file in the [environment](https://ai9k.vercel.app/en/environment) that the [harness](https://ai9k.vercel.app/en/harness) loads into the [context window](https://ai9k.vercel.app/en/context-window) at [session](https://ai9k.vercel.app/en/session) start — the project's standing brief to the [agent](https://ai9k.vercel.app/en/agent). Cross-harness convention; some harnesses also have their own variant (Claude Code's is CLAUDE.md).

Because it loads automatically, it's one way to avoid repeating yourself across sessions. The [model](https://ai9k.vercel.app/en/model) is [stateless](https://ai9k.vercel.app/en/stateless) — a correction you give in one session is gone in the next, and you end up telling every fresh session that the project uses pnpm, that tests run with a particular flag, that a directory is generated and shouldn't be touched. When you've corrected the agent for the same thing twice, that correction is a candidate line for AGENTS.md.

Suitable content is whatever the agent can't derive from the code: build and test commands, conventions the codebase doesn't make obvious, hard constraints ("never edit the generated client"). Short and declarative — it's a brief, not documentation.

The trade-off is that everything in it is always loaded. Instructions accumulate, most of them irrelevant to any given task, and a long AGENTS.md both costs tokens and dilutes itself — the more instructions in context, the less reliably the model follows any one of them.

_Avoid:_ using AGENTS.md for content that should be [progressively disclosed](https://ai9k.vercel.app/en/progressive-disclosure) — anything in it pays a [token](https://ai9k.vercel.app/en/token) cost every [turn](https://ai9k.vercel.app/en/turn), in every session, whether or not that session needs it. A style guide can go behind a [skill](https://ai9k.vercel.app/en/skill) or a [context pointer](https://ai9k.vercel.app/en/context-pointer) instead; keep AGENTS.md for the lines that apply everywhere.

**Usage**

"Why is every session starting with 4k tokens already burned?"

"Check AGENTS.md — someone pasted the entire style guide in there instead of putting it behind a skill."

---

- Section 6 — Memory and Steering · Term 54 of 72
- Page: https://ai9k.vercel.app/en/agentsmd
- Learn step by step: https://ai9k.vercel.app/en/learn#/agentsmd
- On the map: https://ai9k.vercel.app/en?term=agentsmd
- JSON: https://ai9k.vercel.app/data/terms/agentsmd.json
- Mentioned in: [Harness](https://ai9k.vercel.app/en/harness.md), [Stateless](https://ai9k.vercel.app/en/stateless.md), [Stateful](https://ai9k.vercel.app/en/stateful.md), [System prompt](https://ai9k.vercel.app/en/system-prompt.md), [Session](https://ai9k.vercel.app/en/session.md), [Environment](https://ai9k.vercel.app/en/environment.md), [Filesystem](https://ai9k.vercel.app/en/filesystem.md), [Contextual knowledge](https://ai9k.vercel.app/en/contextual-knowledge.md), [Memory system](https://ai9k.vercel.app/en/memory-system.md), [Progressive disclosure](https://ai9k.vercel.app/en/progressive-disclosure.md), [Context pointer](https://ai9k.vercel.app/en/context-pointer.md), [Skill](https://ai9k.vercel.app/en/skill.md), [Home Repo](https://ai9k.vercel.app/en/home-repo.md), [DX](https://ai9k.vercel.app/en/dx.md), [AX](https://ai9k.vercel.app/en/ax.md)
- Previous: [Memory system](https://ai9k.vercel.app/en/memory-system.md)
- Next: [Progressive disclosure](https://ai9k.vercel.app/en/progressive-disclosure.md)

Every term page has a markdown copy: add .md to its address.
