Hey, thanks for the report. This is a known issue: in multi-root workspaces, Cursor loads the root-level AGENTS.md from each workspace folder globally, without scoping it to the current directory.
Nested AGENTS.md files not at the repo root work correctly. They’re automatically scoped to their directory. The issue is only with root-level files.
For now, the workaround is the one you already found: add frontmatter with globs. Yeah, it goes against the idea of plain markdown, but it’s currently the only way to limit the scope. Another option is to move the rules to .cursor/rules/*.mdc, where globs are set explicitly.
The team is aware of this issue, and your report helps with prioritization. I’ll update the thread when there’s news.
Related threads for context: