AGENTS.md leaks into other repositories in multi-repo workspace

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

AGENTS.md rules from one repository are being applied when working in other repositories within a multi-repo workspace. According to the documentation, AGENTS.md should be plain markdown that automatically scopes to its directory, but in practice it leaks across repository boundaries in workspaces with multiple projects.

Steps to Reproduce

  1. Create a workspace with multiple repositories
  2. Add an AGENTS.md file to one repository
  3. Open a file from a completely different repository in the same workspace
  4. Observe that rules from the first repository’s AGENTS.md are being applied to the files from the different repository
  5. The only workaround is adding frontmatter with globs (e.g., globs: [“/repository-name/”]), which contradicts the “plain markdown” design stated in the documentation

Expected Behavior

According to https://cursor.com/docs/rules:

  • “Unlike Project Rules, AGENTS.md is a plain markdown file without metadata or complex configurations”
  • AGENTS.md should automatically scope to its repository root and subdirectories
  • Rules should not leak into other repositories in the same workspace
  • No frontmatter should be needed for proper directory scoping in multi-repo environments

Operating System

MacOS

Version Information

Cursor IDE (latest version as of 2026-03-21)

For AI issues: which model did you use?

Claude Sonnet 4.5 (Agent mode)

Additional Information

The nested AGENTS.md support mentioned in the docs suggests directory-based scoping should work automatically, but it appears to break down in multi-repo workspaces. This forces users to either:

  1. Add frontmatter with globs (defeats the “plain markdown” purpose)
  2. Move to .cursor/rules/*.mdc (more complex setup)
  3. Accept cross-repo rule pollution

Does this stop you from using Cursor

No - Cursor works, but with this issue

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:

Amazing Dean, thanks for the quick and detailed clarification, really appreciate it. Best of luck to the team

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.