The Workshop · 11 min mission
Rules Files Across Tools: AGENTS.md and the Rest
Keep one source of truth for agent rules across every IDE coding tool you use.
On this page
This guide maps which rules/memory file each coding agent reads, and how to keep one canonical briefing across all of them. After reading it you can put your project rules in a single AGENTS.md, let native readers consume it directly, and add a two-line bridge for the two tools (Claude Code, Gemini CLI) that need one.
| Tool | Primary native file | Reads AGENTS.md? | Notable structured / legacy files |
|---|---|---|---|
| Cross-tool standard | AGENTS.md (root + nested) | It *is* the standard | Stewarded by Agentic AI Foundation / Linux Foundation |
| Cursor | .cursor/rules/*.mdc | Yes (root + nested) | Legacy .cursorrules no longer documented |
| GitHub Copilot | .github/copilot-instructions.md | Yes — plus CLAUDE.md & GEMINI.md | .github/instructions/*.instructions.md (applyTo, excludeAgent) |
| VS Code Copilot | .github/copilot-instructions.md | Yes (chat.useAgentsMdFile) | Reads CLAUDE.md via chat.useClaudeMdFile; .instructions.md |
| Windsurf / Devin Desktop | .devin/rules/*.md | Yes (root always-on; nested auto-scoped) | Legacy .windsurf/rules/, .windsurfrules, global_rules.md |
| Claude Code | CLAUDE.md (+ .claude/rules/) | No — bridge via @AGENTS.md or symlink | CLAUDE.local.md; managed-policy CLAUDE.md |
| Gemini CLI | GEMINI.md | Only if added to context.fileName | ~/.gemini/GEMINI.md global file |
| Cline | .clinerules/ | Yes (root + ~/.agents/AGENTS.md) | Legacy single .clinerules file |
| Roo Code | .roo/rules/ | Yes (roo-cline.useAgentRules) | .roorules, AGENTS.local.md (v3.47.0) |
Nesting and precedence
A packages/api/AGENTS.md refines or overrides the root file when the agent works inside packages/api; chat prompts beat both. Most native readers honor "more specific takes precedence." The exception is Claude Code, which concatenates ancestor files (root down to the working directory) instead of letting the closest one override.
Cursor
Cursor reads AGENTS.md at the root and in nested subdirectories ("more specific instructions take precedence"). On top of that, Project Rules live in .cursor/rules/ as .mdc files (Markdown + YAML frontmatter), organizable into subdirectories like .cursor/rules/frontend/components.mdc. Four rule sources exist — Project, User, Team, and AGENTS.md — with precedence Team Rules → Project Rules → User Rules.
| Mode | Frontmatter | When it loads |
|---|---|---|
| Always Apply | alwaysApply: true | Injected into every chat session |
| Apply Intelligently | description set, no globs | The agent decides when it is relevant |
| Apply to Specific Files | globs pattern set | When a matching file is in context |
| Apply Manually | none of the above | Only when you mention @rule-name |
GitHub Copilot
Repository-wide instructions live in a single .github/copilot-instructions.md (natural-language Markdown) at the repo root. For finer scope, .github/instructions/NAME.instructions.md files carry frontmatter: applyTo: "glob/pattern" scopes a file (e.g. applyTo: "app/models/**/*.rb"), and excludeAgent: "code-review" or excludeAgent: "coding-agent" hides it from a specific agent. With no excludeAgent, all agents use the file. Copilot also reads AGENTS.md (root primary, nested = additional for their subtree) plus CLAUDE.md and GEMINI.md at the repo root per the support matrix. AGENTS.md support for the coding agent shipped 2025-08-28.
Windsurf is now Devin Desktop
On 2026-06-02 Windsurf became Devin Desktop (Cognition); docs moved to docs.devin.ai/desktop/…. Cascade is now the legacy agent (successor "Devin Local," rewritten in Rust), usable through 2026-07-01; the "Windsurf" name persists in directory paths for backward compatibility. Workspace rules are .devin/rules/*.md (preferred, takes precedence), with .windsurf/rules/*.md as fallback and the single-file .windsurfrules at root still read. The global file is ~/.codeium/windsurf/memories/global_rules.md. It offers trigger: frontmatter modes — always_on, model_decision, glob, manual — and reads AGENTS.md into the same rules engine: a root AGENTS.md becomes an always-on rule; a subdirectory one is auto-scoped with the glob <directory>/**.
Bridge Claude Code to a shared AGENTS.md
Import AGENTS.md from CLAUDE.md
Put
@AGENTS.mdas the first line of a shortCLAUDE.md. Claude expands the shared file into context at launch. Imports are recursive up to 4 hops; they do not reduce context (the imported file still loads).Add only Claude-specific notes below it
Everything not in the shared brief — plan-mode rules, skills, path-scoped notes — goes under the import so nothing duplicates
AGENTS.md.Or symlink when there is no Claude-specific content
Run
ln -s AGENTS.md CLAUDE.md. Works everywhere except Windows without admin or Developer Mode — use the@AGENTS.mdimport there.Or let /init pull it in
Running
/initin a repo that already hasAGENTS.mdreads it into the generatedCLAUDE.md, and also pulls from.cursorrules,.devin/rules/, and.windsurfrules.
@AGENTS.md
## Claude Code
Use plan mode for changes under `src/billing/`.
Prefer the /review-pr skill before opening a PR.Gemini CLI
Gemini CLI's default context filename is GEMINI.md. It loads hierarchically — global ~/.gemini/GEMINI.md, then project and ancestor directories, then just-in-time as tools touch files — and concatenates everything it finds with each prompt. It supports @file.md imports and the /memory show / /memory reload commands. It does not read AGENTS.md by default; add it to the context.fileName key in settings.json (accepts a single name or an array). Latest stable: v0.45.0 (2026-06-03).
{
"context": {
"fileName": ["AGENTS.md", "CONTEXT.md", "GEMINI.md"]
}
}Cline and Roo Code
Cline uses a .clinerules/ directory: it processes every .md and .txt file inside and combines them, with optional numeric prefixes (01-coding.md) as ordering aids. Global rules live in ~/Documents/Cline/Rules; conditional rules use paths: frontmatter. It reads both a project-root AGENTS.md and a cross-tool global ~/.agents/AGENTS.md.
Roo Code uses .roo/rules/ (recursive, appended to the system prompt in alphabetical filename order), with the single-file .roorules as legacy fallback and .roo/rules-{modeSlug}/ for mode-specific rules. It loads AGENTS.md (or AGENT.md as fallback) from the workspace root by default — disable with the VS Code setting "roo-cline.useAgentRules": false. As of v3.47.0 (2026-02-05) it also supports AGENTS.local.md for personal, un-committed overrides, auto-added to .gitignore.
Wire one source of truth across your stack
Make AGENTS.md canonical
Write the project overview, build/test/lint commands, setup gotchas, and hard constraints once in
AGENTS.mdat the repo root. Keep it lean — plain Markdown, no required structure.Let the native readers just read it
Cursor, Copilot, Windsurf/Devin, Cline, and Roo Code need nothing more. For a monorepo, add nested
AGENTS.mdfiles in subprojects where closest-file-wins should refine the root.Bridge Claude Code
Add a short
CLAUDE.mdwhose first line is@AGENTS.md, then list only Claude-specific notes below it.Bridge Gemini CLI
In
~/.gemini/settings.json, setcontext.fileNameto an array including"AGENTS.md". Gemini CLI concatenates it with anyGEMINI.mdit finds.Reserve structured rules for scoped concerns
Keep
.cursor/rules/*.mdc,.github/instructions/*.instructions.md,.devin/rules/, and.claude/rules/for narrow needs — path globs, modes, lifecycle. The broad briefing stays in the singleAGENTS.md.
Reads AGENTS.md natively vs. needs a bridge
Native — nothing extra needed
Cursor (root + nested), GitHub Copilot (coding agent + VS Code via chat.useAgentsMdFile), Windsurf / Devin, Cline, Roo Code.
Drop AGENTS.md at the repo root; these tools pick it up. Add nested files for monorepo subtrees where the closest file should win.
Needs a thin shim
Claude Code → a short CLAUDE.md containing @AGENTS.md (or ln -s AGENTS.md CLAUDE.md on non-Windows).
Gemini CLI → add AGENTS.md to context.fileName in ~/.gemini/settings.json (or @AGENTS.md import into GEMINI.md).
Knowledge check
You keep your briefing in AGENTS.md at the repo root. Cursor and Copilot read it, but Claude Code ignores it entirely. What is the supported fix?
Translate one rule set into every tool
Write your rules once, ship them everywhere
Every coding agent reads its rules from a different file with its own conventions. Write your project rules once below — then switch tabs to get each tool's native format, ready to copy.
Deeper dives in the cosmos
This is the cross-tool overview. For the structured-rules systems, see Cursor: rules and context. For each native file in depth: Claude Code's CLAUDE.md, Codex and the AGENTS.md standard, and Gemini CLI's GEMINI.md.
Reach the end and this star joins your charted sky.