Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
[BUG] AI Agent Write/StrReplace Tools Blocked on .cursor/rules/private/*.mdc Files
Summary
The AI agent’s Write and StrReplace tools fail with “Write permission denied” when writing to .mdc files in .cursor/rules/private/, despite full filesystem permissions. This is a regression - it worked in previous Cursor versions.
Environment
- Cursor Version: 2.1.50
- OS: macOS 14.6.0
- Impact: High - breaks programmatic rule management workflow
Reproduction Steps
- Create
.cursor/rules/private/directory in workspace - Set full permissions:
chmod -R 777 .cursor/rules/private/ - Ask AI agent to write a
.mdcfile using Write tool - Result: “Write permission denied”

Evidence of Inconsistency
Write Tool (Blocked):
Write tool result: "Write permission denied: "
Shell Command (Works):
$ echo "Test" > .cursor/rules/private/test.mdc # ✅ Success!
Python Script (Works):
with open('.cursor/rules/private/test.mdc', 'w') as f:
f.write("Test") # ✅ Success!
Permissions (Full Access):
$ ls -la .cursor/rules/private/
drwxrwxrwx@ 15 user staff 480 Dec 8 15:30 .
-rwxrwxrwx@ 1 user staff 8118 Nov 27 10:00 example.mdc
Analysis
Filesystem allows writes (777 permissions)
Shell tool with required_permissions: ['all']works
Python scripts work
Write tool blocked
StrReplace tool blocked
Conclusion: Internal Cursor restriction on Write/StrReplace tools, not a filesystem issue.
Current Workaround
Using Python scripts via Shell tool (cumbersome):
python3 << 'EOF'
with open('.cursor/rules/private/my-rule.mdc', 'w') as f:
f.write(content)
EOF
Request
Please restore direct Write/StrReplace access to .cursor/rules/private/*.mdc files as in previous versions. This is essential for AI agents to manage their own rules programmatically.
Additional Info
- Files are NOT tracked in git
- Directory is within workspace
- Same workflow worked in previous Cursor versions
- Issue appeared after recent Cursor update
Full detailed report: See attached cursor-bug-report.md for complete evidence and reproduction steps.
Steps to Reproduce
- Create a
.cursor/rules/private/directory in your workspace - Set full permissions:
chmod -R 777 .cursor/rules/private/ - Ask the AI agent to create or update a
.mdcfile in that directory using theWritetool - Observe the error: “Write permission denied”
Expected Behavior
The Write and StrReplace tools should successfully write to files in .cursor/rules/private/ directory, just like they work on other files in the workspace.
Operating System
MacOS
Current Cursor Version (Menu → About Cursor → Copy)
Cursor Version: 2.1.50
For AI issues: which model did you use?
Sonnet 4.5
Additional Information
cursor-bug-report.md
Bug Report: Write and StrReplace Tools Blocked on .cursor/rules/private/*.mdc Files
Description of the Bug
The AI agent’s Write and StrReplace tools fail with “Write permission denied” error when attempting to write to .mdc files in the .cursor/rules/private/ directory, despite proper filesystem permissions. This worked in previous versions of Cursor without any issues.
Impact
High - This breaks the workflow for managing private cursor rules programmatically. The AI agent cannot update its own private rules without cumbersome workarounds.
Steps to Reproduce
- Create a
.cursor/rules/private/directory in your workspace - Set full permissions:
chmod -R 777 .cursor/rules/private/ - Ask the AI agent to create or update a
.mdcfile in that directory using theWritetool - Observe the error: “Write permission denied”
Expected Behavior
The Write and StrReplace tools should successfully write to files in .cursor/rules/private/ directory, just like they work on other files in the workspace.
Actual Behavior
Both Write and StrReplace tools are blocked with “Write permission denied” error, even though:
- Directory has full
777permissions (drwxrwxrwx) - All files have full
777permissions - The directory is within the workspace
- Files are not tracked in git
- Shell commands (with
required_permissions: ['all']) can write successfully to the same location - Python scripts can write successfully to the same location
Evidence
1. Directory Permissions (Full Access)
$ ls -la .cursor/rules/private/
drwxrwxrwx@ 15 lior.barak staff 480 Dec 8 15:30 .
-rwxrwxrwx@ 1 lior.barak staff 8118 Nov 27 10:00 comet-slash-testing-framework.mdc
-rwxrwxrwx@ 1 lior.barak staff 14390 Nov 16 12:00 dataengine-runtime-improvements-design.mdc
2. Write Tool Fails
Write tool result: "Write permission denied: "
3. Shell Command Succeeds
$ echo "Test content" > .cursor/rules/private/test.mdc
$ cat .cursor/rules/private/test.mdc
Test content # ✅ Success!
4. Python Script Succeeds
with open('.cursor/rules/private/test.mdc', 'w') as f:
f.write("Test content")
# ✅ Success!
Workaround
Currently using Python scripts via Shell tool with required_permissions: ['all'] to write files:
# Workaround - should not be necessary
python3 << 'EOF'
with open('.cursor/rules/private/my-rule.mdc', 'w') as f:
f.write(content)
EOF
Environment
- Operating System: macOS 14.6.0 (Darwin 24.6.0)
- Cursor Version: 2.1.50
- Shell: zsh
- Workspace: Git repository at
/Users/lior.barak/PycharmProjects/orion - File Type:
.mdc(Markdown with frontmatter) - Directory:
.cursor/rules/private/(within workspace)
Additional Context
This issue appeared after a recent Cursor update. Previously, the AI agent could write to private rules directly without any workarounds. The behavior is inconsistent:
Shell tool with required_permissions: ['all']→ Works
Python scripts → Works
Write tool → Blocked
StrReplace tool → Blocked
This suggests an internal Cursor restriction on the Write/StrReplace tools specifically, rather than a filesystem permissions issue.
Regression
This is a regression - the same workflow worked in previous Cursor versions without any special permissions or workarounds.
Request
Please restore the ability for AI agents to write directly to .cursor/rules/private/*.mdc files using the Write and StrReplace tools, as this is essential for programmatic rule management.
Forum Post URL: [To be filled after posting]
Date Reported: December 8, 2024
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor