When opening agent-cli in a subfolder of a monorepo, the following issues occur:
Doesn’t read .cursor directory from current working directory: agent-cli doesn’t read the .cursor directory from the current working directory
Incorrect path when generating rules and skills: When generating rules and skills, they are not generated in the .cursor directory of the current working directory, but instead are generated in the monorepo parent directory
Steps to Reproduce
In a monorepo structure, navigate to a subfolder (e.g., td-all/td-cc/)
Run agent-cli in that subfolder
Try to generate a rule or skill
Observe where the files are generated
Expected Behavior
agent-cli should behave consistently with cursor-ide:
Read the .cursor directory from the current working directory
When generating rules and skills, they should be generated in the .cursor directory of the current working directory
1. Is there a .cursor directory in the monorepo root folder, or only in td-cc/?
Both exist:
There is a .cursor directory in the monorepo root folder (td-all/.cursor)
There is also a .cursor directory in the subfolder (td-all/td-cc/.cursor)
The issue is that when running agent-cli from td-cc/, it seems to be reading from the root .cursor directory instead of the local one.
2. What exact command are you using to generate rules/skills?
I’m using the /create-rule command (via the create-rule skill) to generate rules. When I run this command from the td-cc/ subfolder, the generated rule files are created in td-all/.cursor/rules/ instead of td-cc/.cursor/rules/.
3. The terminal output when running the CLI from the subfolder:
I just ran the command again from td-cc/ and there are no warnings or errors - everything appears to run normally. However, the issue is that the files are silently being generated in the wrong location (td-all/.cursor/rules/ instead of td-cc/.cursor/rules/) without any indication that this is happening.
This makes the bug particularly subtle - the CLI doesn’t give any indication that it’s using the wrong path, so users might not notice until they check where the files were actually created.
Additional context:
The monorepo structure: td-all/ (root) contains multiple subprojects including td-cc/, td-oversight/, etc.
Each subproject has its own .cursor directory with project-specific rules and skills
When working in td-cc/, I expect agent-cli to use td-cc/.cursor/ for reading and writing, but it’s currently using td-all/.cursor/ instead
This behavior is inconsistent with cursor-ide, which correctly uses the .cursor directory from the current workspace
I understand the workaround of running from the monorepo root, but that’s not ideal since each subproject has its own configuration needs.
Let me know if you need any additional information!
Thanks for the details, now the full picture is clear.
This is definitely a bug. The CLI should use the .cursor file from the current directory, just like the IDE does. What’s especially tricky is that there are no warnings, files are silently created in the wrong place.