Can I add AGENTS.md to gitignore file?

if I add .cursor folder and AGENTS.md file to gitignore list, the Cursor can work with it fine?

I don’t want to share this files on git with other people, but I want to let it work fine for me only, so it does?

if it is not work for me fine, what should I do?

Hey! Yes, you can add these files to .gitignore, and Cursor will still work fine for you locally.

But it’s important to understand the difference:

  • .cursor/rules and AGENTS.md are project rules. They’re meant for the whole team and are usually version-controlled.
  • If you want personal rules just for yourself, use User Rules instead of project rules: Cursor Settings > Rules, Commands

User Rules:

  • Apply globally across all your projects
  • Aren’t saved to the repo
  • Only work in Agent (Chat)

If you add .cursor/ and AGENTS.md to .gitignore:

  • Cursor will still work for you
  • But other developers on the project won’t get those rules
  • Every time you clone the repo, you’ll need to recreate them

More info: Rules | Cursor Docs

1 Like