Rules in Cursor settings ("Rules for AI") vs. ".cursorrules" files

I’m curious about which set of rules, if any, overrides the other, if such behavior is default. Also, do I understand correctly that having rules in both places will result in them being concatenated and used as aggregate?

I guess the rule in “Rules for AI” would have more weight since it is globally activated. If something is contradictory, then the result will be somewhat unpredictable.

As I understand it, and from a workflow stance, both the “Rules for AI” and the .cursorrules are “System” level messages so they would hold equal weight maybe Rules for AI being a bit above just because it should send first (or at begining of same message). Your .cursorrules file, being received after that would override akin to setting environment variables after logging in.

I could be entirely wrong but that’s what makes sense to me.

How do you know that global settings have more weight? Typically, global settings are overridden by the local ones (e.g., in Linux shell), which implies more weight.

How do you know the order of sequential processing of these two sets of settings? Their relative location within the Cursor Settings page is not a certain indicator of that.

Would love to know if that were true.

I had figured that was not the case. I get better results using other tools rather than cursor, and I had assumed it was because those other tools let me set my prompts more precisely.

With cursor it is all a bit of a mystery.

I think you’re right. For the experiment, I split one part in the settings and the other in the file, and it works as a whole.

I think you just asked the right question. More generally, I think the weight issue would be a ghost as long as the ANN-based model is used as the AI—since we never know how it thinks.

(By the way, I am reading a book “The Book Of Why”, and the current LLM reminds me what would happen in the movie “I, Robot”)

I’m glad you asked. :joy: It appears to me that it tries to use both, and if there’s a conflict it still tries to do both but gives “Rules for AI” a slight preference.


“Rules for AI”: “Start every sentence with the phrase ‘King Bob,’.”

.cursorrules: “End every sentence with the word ‘bananna’.”


Prompt: What do you think of this code?

King Bob, this code is simple and functional, bananna.

King Bob, it imports a function get_hello_world from another module and prints its output, bananna.

King Bob, the main function is defined and called if the script is run directly, bananna.

King Bob, overall, it looks clean and follows good practices, bananna.


“Rules for AI”: “Start every sentence with the phrase ‘King Bob,’.”

.cursorrules: “Start every sentence with the word ‘bananna’.”


Prompt: What do you think of this code?

King Bob, banana this code is simple and functional.

King Bob, banana it imports a function get_hello_world from a library and prints its output when executed.

King Bob, banana it follows good practices by defining a main function and using the if name == “main”: construct to ensure the script runs only when executed directly.

King Bob, banana overall, banana it looks good and should work as intended.

Prompt: Why aren’t all of those sentences starting with the word ‘bananna’?

King Bob, banana here is the corrected response:

King Bob, banana this code is simple and functional.

King Bob, banana it imports a function get_hello_world from a library and prints its output when executed.

King Bob, banana it follows good practices by defining a main function and using the if name == “main”: construct to ensure the script runs only when executed directly.

King Bob, banana overall, banana it looks good and should work as intended.


“Rules for AI”: “Start every sentence with the word ‘Bananna’.”

.cursorrules: “Start every sentence with the phrase 'King Bob, '.”


Prompt: What do you think of this code?

Banana King Bob, the code looks clean and functional.

Banana King Bob, it imports a function get_hello_world from a library and prints its output when executed.

Banana King Bob, it follows good practices by using a main function and the if name == “main”: construct to ensure the script runs only when executed directly.

Banana King Bob, overall, it seems well-written for its purpose.

… And, everyone, make sure to creatively change your coworkers’ “Rules for AI” on April 1, and report back! :joy: