Repository navigation
Instruction files: .rules (compatibility) outranks AGENTS.md (primary), and nothing reports which was loaded #63908
Replies: 3 comments
|
I think showing which instruction file was actually loaded would be the best first step. The precedence itself can be intentional for compatibility, but the current behavior is hard to debug when you have multiple instruction files in a repo. If Zed showed something like I also like the warning idea when both files exist. That could make the conflict obvious without changing the existing precedence rules. I'd personally start with the "show the loaded file" part since it's useful even if the precedence stays exactly as it is. |
|
Same read here, and the log line is the bit I'd fight for — it's useful whether or not the precedence ever changes. Selfishly: anything that writes these files currently has to guess which one won, so I ended up refusing to write |
|
+1 to the log line, and a related failure the same line would have caught. I extracted a third-party repo inside my workspace and my agent silently loaded that tree's CLAUDE.md as instructions, because nothing reports which instruction files were loaded. A one-line manifest at session start (file, precedence rank, bytes) turns both problems into a two-second read. On the precedence list itself, a compatibility file that outranks the primary is a canonical-copy problem. The rule I run is one canonical location per instruction and pointers everywhere else, so a .rules file in a repo that has AGENTS.md should be a one-line pointer to it, not a competing copy. The coexistence warning you propose is the mechanical version of that rule. Two candidates at different ranks is the signal that a copy has drifted or a leftover is shadowing. I maintain a reference architecture that documents the canonical-copy pattern at https://github.com/jimy-r/agent-workspace-architecture/blob/main/PATTERNS.md#17-one-canonical-copy-and-pointers-from-everywhere-else |
Uh oh!
There was an error while loading. Please reload this page.
The compatibility file outranks the primary one, and nothing says which was loaded
Reading the current docs, two statements sit next to each other and point opposite ways.
instructions.md— "Zed supportsAGENTS.mdas the primary instruction file for personal and project-level agent guidance" — then gives the project precedence list, first match wins:rules.md— "Rules have been replaced by Skills and Instructions", and.rulesfiles "remain supported as compatibility project instruction files".So the file documented as compatibility-only takes precedence over the file documented as primary, and six other compatibility filenames sit between them.
Why that combination bites
A
.rulesfile is not something people carefully choose to keep. It is left behind — by a tool that wrote one months ago, by a template, by a teammate who tried something once. It is four bytes of dotfile that nobody greps for. MeanwhileAGENTS.mdis the file the docs tell you to write, so it is the one that gets maintained.The result is a repository whose maintained instructions are silently ignored in favour of a stale file, with no signal anywhere: the agent behaves as though it read your instructions, because it did read some. This is the failure mode that is expensive to diagnose, because the symptom is "the agent ignores my AGENTS.md" and the cause is a file you forgot exists.
It gets slightly worse in a mixed-tool repository, which is now the normal case:
.cursorrules,.windsurfrulesand.clinerulesall outrankAGENTS.mdtoo. A team where one person uses a different agent can end up with Zed reading that person's tool config instead of the shared file.The ask, smallest first
instructions: .rules— turns a silent wrong-file into a two-second diagnosis. This alone would close most of the pain and changes no behaviour..ruleswins andAGENTS.mdis present, that is almost always not what the user wanted.AGENTS.mdshould move up. Riskier — it changes behaviour for existing setups — so I would not lead with it. But a precedence list where the deprecated entry is first and the documented-primary entry is seventh is going to keep surprising people, and it will surprise them more asAGENTS.mdadoption grows.What I checked, and what I did not
The precedence list and both quoted lines are from the docs in
mainas of today. I have not confirmed the behaviour in the running editor — I am reading the documentation, not the loader, so if the implementation already logs the chosen file or already merges, this is a docs problem instead and I would rather be told that than guess.I ran into this from the other side: I maintain a tool that generates project instruction files for a number of agents, and its Zed adapter refuses to write
.ruleswhen any of the other eight is already present — precisely because writing the first entry silently hides whatever the repository was using. Having to build that guard is what sent me to the precedence list in the first place. If Zed surfaced the chosen file, the guard would be a warning instead of a refusal, which is the better shape for everyone writing these files.All reactions