Zed Rules and AGENTS.md: Which File the Zed Agent Reads
The Zed Agent reads one project instruction file and adds it to every thread. Zed's docs call AGENTS.md the primary file, but it sits seventh in a first-match list. If the repo still has an old .rules, .cursorrules or .github/copilot-instructions.md, Zed uses that one and quietly skips your AGENTS.md. Nothing in the editor tells you which file it picked.
We checked this on 2026-11-23 against Zed's Instructions docs and Rules docs. A Zed GitHub discussion raises the same problem and asks Zed to show which file was loaded.
Download free-zed-rules.zip (MIT: zed-check.py prints which file the Zed Agent loads and which it ignores, plus an AGENTS.md template, an example skill and a 30-test test.sh)
python3 zed-check.py .
The order: first match wins
| # | File | Usually written by |
|---|---|---|
| 1 | .rules |
Zed (older setup, now "compatibility") |
| 2 | .cursorrules |
Cursor (deprecated single file) |
| 3 | .windsurfrules |
Windsurf (older single file) |
| 4 | .clinerules |
Cline |
| 5 | .github/copilot-instructions.md |
GitHub Copilot |
| 6 | AGENT.md |
singular name used by some tools |
| 7 | AGENTS.md |
the file Zed's docs call primary |
| 8 | CLAUDE.md |
Claude Code |
| 9 | GEMINI.md |
Gemini CLI |
Zed also loads personal instructions from ~/.config/zed/AGENTS.md (%APPDATA%\Zed\AGENTS.md on Windows) in every project. When the two conflict, the project file wins.
The traps
- A stale file hides the one you maintain. A repo that moved to
AGENTS.mdbut kept an old.cursorrulesgives Zed the old rules. Every edit you make toAGENTS.mddoes nothing in Zed. - Teammates' tool files count. In a mixed-tool repo, a colleague's
.windsurfrulesor Copilot instructions outrankAGENTS.md. Zed ends up reading that person's setup, not the shared file. - An empty file still wins. Zed stops at the first file it finds. An empty
.rulesleft over from a test gives Zed nothing, and it still won't look further. - Only one file is used, never a merge. Unlike Codex or OpenCode, which combine several
AGENTS.mdfiles, Zed's docs describe one project file. NestedAGENTS.mdfiles in subfolders aren't mentioned, so don't count on them for the Zed Agent. - External agents do their own thing. If you run Claude Code, Codex or Gemini CLI inside Zed as an external agent or in the terminal, that tool reads its own files. Zed's list above doesn't apply to them.
zed-check.py flags the first four. A .clinerules folder (Cline's multi-file layout) is reported separately: Zed's docs list .clinerules as a file name and don't say whether a folder counts.
Fix it in one minute
python3 zed-check.py .
# Zed Agent loads .cursorrules (Cursor's deprecated single-file rules)
# ignored AGENTS.md
# WARNING: .cursorrules hides AGENTS.md. ...
git rm .cursorrules # or: ln -sf AGENTS.md .cursorrules
python3 zed-check.py . # Zed Agent loads AGENTS.md
Before deleting another tool's file, check that its rules are already in AGENTS.md. Cursor reads AGENTS.md and .cursor/rules/, Copilot reads AGENTS.md too, so most teams can drop the old single files.
Example AGENTS.md for Zed
## Commands
| Task | Command |
|---|---|
| Install | `pnpm install` |
| Test | `pnpm test` |
| Lint | `pnpm lint` |
## Rules
- Make small, targeted changes. No drive-by refactors or renames.
- Add or update tests for new behavior and run `pnpm test` before you finish.
- Never log tokens, passwords or personal data.
- Do not edit CI workflows, deploy scripts or `.env*` files unless the task says so.
## Done means
- Tests and lint pass, and you list what you changed and how you checked it.
Keep it short. It's sent with every thread, so every line costs context.
Rules became Skills (Zed 1.4)
Starting in Zed v1.4.0, the Rules Library and on-demand Rules were replaced by Skills. Per the docs, the automatic migration:
- turns non-default Rules into global skills in
~/.agents/skills/, each withdisable-model-invocation: true, so you still call them with a slash command or@-mention; - appends default (always-on) Rules and any git commit prompt customization to your personal
~/.config/zed/AGENTS.md; - keeps the old Rules Library content, so downgrading still works.
Use instructions for always-on facts (commands, conventions, limits) and skills for workflows you run sometimes (release notes, review checklist). The kit includes an example skills/release-notes/SKILL.md. See Agent Skills and SKILL.md explained or grab our 13 free skills.
FAQ
Does Zed read AGENTS.md? Yes, as long as none of the six files above it in the list exist in the project root.
Is the .rules file deprecated? Zed calls it a compatibility file. It still works and still outranks AGENTS.md. Rename it to AGENTS.md so other agents can read it too.
Does Zed read CLAUDE.md? Only if there is no AGENTS.md or any of the files above it.
How do I see which file Zed loaded? The editor doesn't show it today. Run zed-check.py, or temporarily add a line like "Start every reply with OK-AGENTS" to the file you expect and see if the agent does it.
Get matching files for every tool
The free AGENTS.md generator builds a root AGENTS.md (which Zed reads) plus Cursor, Copilot, CLAUDE.md, GEMINI.md and Kiro files. The AI Coding Agent Config Kit adds 12 stack templates and prompts that audit them. More: AGENTS.md examples, AGENTS.md not working? and Migrate .cursorrules to .mdc.
AgentKit Co is not affiliated with Zed Industries.
AI Coding Agent Config Kit
Instruction-file templates for 12 stacks and 12 prompts that write and audit them. 34-page PDF, $14.
Not ready to buy? Start with the free PDF.
Get 10 of our most-used prompts as a free PDF from Gumroad. You will be asked for your email so Gumroad can deliver it.