Where to Put AGENTS.md in Cursor

Cursor Agent runs from the sidepane with Cmd+I, and the docs describe its task setup as Instructions, Tools, and Model. For AGENTS.md in Cursor, put the file at the boundary the agent should respect: one shared AGENTS.md can fit a monorepo, while several repositories should each carry their own AGENTS.md. The recorded July 2026 workshop answer was the same: one shared team file fits a monorepo, and multiple repositories need one AGENTS.md per repository.
Put the rule file where the boundary lives
AGENTS.md should carry durable repository guidance: architecture constraints, naming conventions, test expectations, and review rules that should survive beyond one chat. In Cursor, the official surface that participates in agent instructions is Cursor rules, so AGENTS.md should not become a dumping ground for task prompts.
A monorepo often has one operational boundary even when it has many packages. In that case, one root AGENTS.md gives the agent a shared baseline before it edits code.
If a subdirectory has different constraints, add a nested file near that code instead of making the root file longer. Local scope keeps the instruction precise.
Rolling this out in your team?
We train engineering teams on their own codebase in two days. Cursor setup, shared rules and review included.
Separate AGENTS.md from skills and subagents
AGENTS.md is the place for repo-specific rules. Cursor skills are better for reusable procedures, templates, or reference material that can travel across repos.
That distinction matters for Cursor subagents and skills because the activation surface is different. A repo rule should always shape work in that repo, while a Cursor skill should be pulled in when the task needs that capability.
For the wider set of patterns, keep this article next to Subagents and skills. The repo boundary question is only one part of that operating model.
Use Projects for larger migrations
Cursor’s docs say that for a larger body of work, such as a feature or a migration, you create a Project so a coordinator agent can plan and delegate work to other agents. That does not remove the need for good repo guidance.
For a migration in a monorepo, the root AGENTS.md should explain the shared constraints. A nested file can add the local migration rule for one service or package.
There is no limit on the number of tool calls Agent can make during a task. That makes review more important, because a long task can touch more files than expected. In our methodology, this belongs closest to Review: check the agent’s changes against the repo boundary before accepting them.
If the review problem is regression safety rather than repo layout, Cursor Hooks and Regression Tests is the more relevant next read.
Copy this repo-layout decision table
Use this table to decide whether to use one AGENTS.md for a monorepo or one per repository in Cursor. The goal is to keep durable instructions close to the code they govern.
| Repo shape | Put AGENTS.md here | Cost to watch |
|---|---|---|
| Monorepo with one shared engineering standard | One root AGENTS.md | Easy to maintain, but it can become too broad if teams keep adding local exceptions. |
| Monorepo with service-specific constraints | Root AGENTS.md plus nested AGENTS.md files near the special code | More files to maintain, but the agent gets the local rule at the right scope. |
| Several separate repositories | One AGENTS.md per repository | Some duplication, but each repo remains understandable on its own. |
Keep the file small enough to review
A useful AGENTS.md should be boring to change. If nobody wants to review it, it will drift.
Write the rule where a reviewer can check it against real code. For example, a test command belongs in the repo or package where that command actually runs.
Long shared files create a second cost: they make the agent carry instructions that may not apply to the current edit. Nested files reduce that noise when different parts of a monorepo behave differently.
Further reading
Next step
Pick one active Cursor repo and write the smallest AGENTS.md that describes its real boundary. For guided practice, use hands-on training on Cursor rules and agent review.
Related research
Train your team on Cursor
Two days on your team's own repository, onsite or remote, with a written proposal before you commit.
Book a callPrefer to measure first? Take the free team check.