# zed_agent: Pick rules file in order described in docs \(\#52495\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/12bdc208e5298a6aaa1803b07bf6f63599cb6add)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 12bdc208e5298a6aaa1803b07bf6f63599cb6add

Requested commit: 12bdc208e5298a6aaa1803b07bf6f63599cb6add

Commit: 12bdc208e5298a6aaa1803b07bf6f63599cb6add

Tree: 80e2f9657a830c1085f652510150785ed7d42246

Author: Erik Funder Carstensen

Committer: GitHub

## Message

```
zed_agent: Pick rules file in order described in docs (#52495)

## Context

This makes zed-agent prioritize rules files in the same order as is
described in the docs. My order of experience was
- saw in my zed agent thread `Using project "CLAUDE.md" file.
- went to settings to see if I can make it use `AGENTS.md` instead.
- went to [the docs](https://zed.dev/docs/ai/rules) where it specifies
that AGENTS.md is be picked over CLAUDE.md.
- went to source to see what went wrong

## How to Review

I'm changing the order of filenames in an array - the only two places
where the order matters is when picking which rules file to use. The
last place it's used with an `.iter().any()`.

## Self-Review Checklist
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- If you want the behavior tested I can, but I think it's equally hard
keeping docs and tests and docs and this codepath in sync.
- [x] Performance impact has been considered and is acceptable

Release Notes:

-Fixed agent rules files are prioritized as described in docs
```

## Parents

- [15d8660748b508b3525d3403e5d172f1a557bfa5](https://git.cafe/gitcafe/zed/commit/15d8660748b508b3525d3403e5d172f1a557bfa5?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/12bdc208e5298a6aaa1803b07bf6f63599cb6add?format=markdown)
