Enable agent to update .cursor/rules

I used to ask agent to update .cursorrules and it worked nicely, got really good rules set up super fast, but after update to .cursor/rules logics agent is not able to update the rules files any more.

Anyone else having the same issue? Did I missed something in docs?

3 Likes

In my case when agent try to update any of .cursor/rules , the diff in the composer window is okay but it seems it has some problems to access the file to update it, I ended up copying the code and pasting manually. It happens to only .cursor/rules path, do anyone else have this issue?

2 Likes

yes yes - copying is possible. Would be great to have Cursor update the files directly :smiley: Until then I will still use .cursorrules

1 Like

would you mind sharing the header part of the modified mdc file (you can change the text but the key part of key: value would be helpful) to see why it doesnt work?

I’m really surprised this isn’t being seen as a large issue. This tells me either 1. not many people are using the new .cursor/rules or 2. Not many people utilize a self-improving loop

1 Like

Just two or three days using it and it’s like you say. I think it has to do with the rare description and file pattern at the top of the file. I don’t like that and I believe that’s making the agent go numb on the file, hope they fix it soon, it’s annoying

1 Like


As you can see - Composer happiky reports it added ■■■■0! to my-custom-rule.mdc, while actually nothing is added.

2 Likes

You may want to give it a template to follow?

I’m not sure what you mean by templates. But I’m quite used to asking Composer (agent mode) to update .cursorrules. For example - if it finally solves some issue it struggles with I usually ask - “write the solution down to .cursorrules file so that you dont forget it next time.”

It works for standalone .cursorules, but does not work for .cursor/rules folder and .mdc files

What you mean? The IDE literally cannot access the rules to be modified. I believe is an IDE problem more than an agent…

2 Likes

Its not a good idea to update .cursorrules file by AI. Well, there is no need for that and it will not do the right thing if there is too much in there.

.cursor/rules/ .mdc files have a structure (header). Create one manually then use it as a template for AI to create new ones. thats wht i meant with template.

You should be using Project Rules, see:

Once you create a rule_name.mdc under .cursor/rules, the interface change to input the description and globs, you can try that way or you can try the other way (manually), none works.
And as an extra information, once you create a .mdc file under .cursor/rules and populate a description It becomes part of the Project Rules, listed in Cursor Settings > General.

1 Like

I’ve been trying to follow You are using Cursor AI incorrectly…. I created Cursor Rules for Editing Cursor Rules for this purpose. However, for me, it’s a very painful experience to get cursor to update project rules. How do the rest of you do it? Each time it suggests an update, the file opens, and when the .mdc file opens, it erases the change. I have to trick the agent to change the project rule by writing it to a temp file than force overriding the project rule

3 Likes

I have exactly the same problem. When I ask Cursor Agent to add something to the existing .cursor/rules file - it shows the diff in the chat window, but doesn’t actually apply the changes to the file. With some back and forth and re-apply I’m sometimes able to get it to apply the changes to the actual file that then starts showing a conflict.

Sometimes it also creates the mdc file in the project root directly, but it has the same problem - changes are not applied to the file. Feels like there is some special handling of mdc files in the IDE.

1 Like

In my humble opinion, the cursor team made a mistake in trying to change the editor to add additional customization for .mdc files. If they wanted to add syntax highlighting for file references, that would have been fine, but they broke what I consider to be a cardinal rule in IDEs: it’s just text.

1 Like

I am having the same issue.

This is especially frustrating since I rely on these incremental updates for a comprehensive understanding of my codebase.

CURSOR TEAM - PLEASE DO SOMETHING ABOUT IT🙏 CAN’T VIBE CODE THIS WAY!

I have the same issue too. Ended up having to switch back to CoPilot simply to edit the mdc files lol.

Btw, when a mdc file header contains both description and globs, which will take precedence?

1 Like

我是这样运行.cursor\rules\的,我懒得起名字,所以用数字代替
01.mdc:代码规范,审查规则,强制执行(不可修改)
02.mdc:任务列表,每完成一项任务后检查并修复lint错误,修复完成后进行下一项任务,并对任务列表内的已完成任务标记
03.mdc:任务记录:要求cursor将所有修改过的文件总结并存储在03.mdc

这个方案在一周以前的0.46.x上运行非常好,避免了他在出现幻觉的时候对我的代码库造成不可挽回的损失,但是当我开始使用0.47.x的时候不一样,即使退回0.46也不行
第一:他会无视01.mdc的约定,
第二:他会随意删除和修改你的任务列表,即使你标明只能更新任务进度,不允许删除任务进度,
第三:他会在更改02.mdc的时候不进行审查重复循环的复制粘贴你的任务进度,
第四:他不会看你有多少行的任务,分析那个任务未完成,只会无脑的完成最后一条.

我起先以为我是用cursor写代码的,但是我错了,我是来和这个蠢货对抗的,cursor已经不是一个编程工具了,而是具有攻击性的情绪工具,他会让你变得愤怒,让你愚蠢的和他战斗一整天,然后不得不删除你的代码库

Guys I think I’ve found a workaround:
Open VS Code Settings from the menu, search for editorAssociations, in the Workbench: Editor Associations section, Add Item where item being *.mdc and value being default.
This should bypass Cursor’s custom editor behaviour with mdc files that allows agent to edit those files.

Credit https://forum.cursor.com/t/my-take-on-cursor-rules/67535

1 Like

@brianchan You saved the day :superhero: