I have some agents written in .cursor/agents and everytime i opened any of those, the IDE automatically remove the header frontmatter of that file (description, model, etc). So everytime i need to create new ones or update the existant ones, i need to put the header from another IDE.
What can i do to solve this issue ?
Steps to Reproduce
Have an agent file in .cursor/agents/NAMEOFTHEAGENT.md with the commons standards of this file with the default YAML Frontmatter header
Expected Behavior
Dont remove it automatically, se we could edit and improve agents from inside of the ide.
Thanks for clarifying. You’re right, my previous reply was about .cursor/rules/ (which use .mdc), but your issue is with .cursor/agents/.
Important note for the team: .cursor/agents/ is the directory for subagents (a nightly feature). Per the docs (Subagents | Cursor Docs), it should contain .md files with YAML frontmatter, not .mdc:
The IDE removes the frontmatter when opening these files, which breaks subagent functionality. It might be because you’re using the .mdc extension instead of .md.
For troubleshooting, can you check:
Are you opening the file on the nightly channel? (Subagents are only available there)
Do you have any extensions related to Markdown or YAML?
For now, the workaround is to edit the file in an external editor (like you’re doing).
I’ll pass this to the team and note that it affects the nightly subagents feature.
Ah i understand! I Didnt notice that was a nightly feature, im using the stable one.
But the problem happen with md or mdc the same (i tried both), and is something that started to happen recently, wasn’t happen before.
One important thing: subagents (.cursor/agents/) are a nightly feature. If you’re on the stable channel (version 2.3.34), this functionality isn’t officially available there. That might be why the IDE is handling these files incorrectly, it doesn’t expect them to exist on stable.
Could you try switching to the nightly channel and check if the issue still happens there?
Cursor Settings > Beta > Update Access > Nightly
After switching, restart Cursor
Open a file from .cursor/agents/ and see if the frontmatter gets removed
Also, please check what extensions you have installed, especially for Markdown or YAML. One of them might be formatting the file on open.
If the issue still happens on nightly, let me know and I’ll pass it to the team for a deeper look.