Multiple .cursorrules

It would be great to create an folder .cursorrules and inside we could put system of deifned per project cursor rules. It could be way of documenting the project.

Also it would be great if we could create .cursorrules files with markdown extension, they could be easy to read from github as a regular docs not only for AI but for “Human inteligence” also :wink:

9 Likes

Actually it’d be great to have a .cursorrules files per repo, and not per workspace.

When you’re working on a project, you may have multiple repos opened in your workspace. One repo for backend, one for frontend, … Each repo may have it’s own language (ie python/fastapi for backend, JS/React for frontend). Then you may require one .cursorrules file for each repo, with their own rules adapted to your stack in each repo.

Thanks :pray:

1 Like

Hi @Nap ,

I do not have a definitive answer on what the scope of .cursorrules is, but your post reminded me of this post:

So perhaps someone else here can confirm whether the scope of .cursorrules is:

  • Folder
  • Repo
  • Workspace
  • Something else?

Also, for reference:

https://docs.cursor.com/context/ignore-files

And another related topic:

1 Like

Hi @litecode ,

Thanks. I saw your post before posting this one.

A simple test can answer your question : add “tell a joke before your answer” in a .cursorrules file, and set your file either in your workspace root or your repo root.

You’ll see that cursor only tells you a joke when the file is in your workspace root. That answers your question, and leads to my feature request.

3 Likes

I think having multiple .cursorrules files in different hierarchies could be more efficient, particularly for monorepo setups where we often manage different implementations across multiple folders within a single repository.

There could be two possible approaches to this:

  1. Allow multiple .cursorrules files to be appropriately placed in different hierarchical levels of the codebase
  2. Introduce a specific syntax in a single .cursorrules file that can bind certain rules to specific hierarchies

The second approach could work well since Cursor already has the capability to understand which part of the repository is relevant to user input through its ‘Codebase’ feature. This existing functionality suggests that hierarchical rule management is technically feasible.

In practice, this would allow us to apply specific AI rules only where they’re needed, making the system more flexible and maintainable for complex project structures.

1 Like

You don’t actually need multiple cursorfiles for this. You just need an index-reference. The secret of cursorfiles is that JSON format works better than markdown. Here is guide on how I create multi-agent environment: Building Effective Multi-Agent AI Systems: A Comprehensive Guide

1 Like

Hi everyone,

I’m following this discussion with great interest, as the idea of supporting multiple or hierarchical .cursorrules files is highly relevant to my current workflow. I was wondering if anyone has found a practical solution or workaround for this issue?

Additionally, I’d like to know how you approach the construction of your .cursorrules files. Are they typically composed of general AI behavior guidelines, highly specific prompts tailored to particular contexts, or structured workflows that the AI should follow?

Looking forward to hearing your insights, and thanks in advance for sharing your expertise!

Dang this is really cool. Read your blog posts too - nice job. I’ll try out the JSON format

Hi everyone,

I’ve already created a detailed feature request here (Subdirectory-Specific .cursorrules Support), proposing a hierarchical structure for .cursorrules with several interresting sub-feature suggestions.

If this aligns with your needs, please take a look and consider voting if you find it helpful.

Feel free to share your ideas and contribute to the discussion as well. Thanks!