User-level agent discovery ignores --user-data-dir

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

When launching Cursor with --user-data-dir pointing to a custom directory, user-level agent discovery still looks in the hardcoded ~/.cursor/agents/ path instead of /agents/. This means agents placed in the correct data directory are not discovered.

Expected Behavior
Agent discovery should respect the --user-data-dir setting and look for user-level agents in /agents/ (e.g., ~//agents/).

Actual Behavior
Agent discovery is hardcoded to ~/.cursor/agents/ regardless of the --user-data-dir value. Agents in the actual user data directory are ignored.

Steps to Reproduce

Launch Cursor with a custom user data directory:
cursor --user-data-dir=/Users/me/.
Verify the process is using the custom directory (confirmed via ps aux showing --user-data-dir=/Users/me/.)
Place an agent definition file at ~/./agents/my-agent.md
Try to invoke the agent — it is not discovered
Place the same file at ~/.cursor/agents/my-agent.md — it is discovered

Expected Behavior

gent discovery should respect the --user-data-dir setting and look for user-level agents in /agents/

Operating System

MacOS

Version Information

Environment
Cursor version: 2.4.37
OS: macOS 15 (Darwin 25.2.0)
Shell: zsh

For AI issues: which model did you use?

N/A — this is not a model-specific issue. It affects user-level agent discovery (~/.cursor/agents/), which is evaluated before any model is invoked. The agent file is never found, so no model interaction occurs.

For AI issues: add Request ID with privacy disabled

N/A — no AI request is involved. The bug is in the agent discovery/loading layer, which runs before any AI request is made. The agent definition file at /agents/ is missing.

Additional Information

The --user-data-dir flag is inherited from VS Code and is documented in Cursor’s own CLI help (cursor --help). Other Cursor features (extensions, settings, MCP config) correctly use the custom directory — only agent and rules discovery appear to be hardcoded to ~/.cursor/.
Process evidence:
/Applications/Cursor.app/Contents/MacOS/Cursor --user-data-dir= --extensions-dir=/extensions
Files that ARE correctly read from the custom directory:
/User/settings.json
/mcp.json
/extensions/
Files that are NOT read from the custom directory (bug):
/agents/*.md — ignored, only ~/.cursor/agents/ is checked
This is relevant for users who run multiple Cursor instances with separate data directories (e.g., per-project or per-org isolation).

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. These steps to reproduce are great.

This looks like a real bug. The --user-data-dir flag is applied correctly to settings, the MCP config, and extensions, but the agent and rules discovery paths seem to be hardcoded to ~/.cursor/. I’ll pass this along to the team.

Let me know if you need anything else.