When working in a mono-repo the agent often is working in the wrong path when trying to execute commands. I often need to tell it to check the current dir first, it would be nice if the agent knew the current working directory before generating a command.
Jesus christ this!
Yes this is still missing from Cursor, it tries to follow steps from docu that start anywhere but not at current project.
Hey, most of our users, including us at Cursor, often find we either:
- Open the folder in Cursor specifically, to keep things scoped
- Manually provide context, so the Composer knows where to look
Neither solution is perfect for every workflow, but we also use a mono-repo internally, so an upgrade here would be of interest to us too.
The issue is that Cursor Chat/Composer does not know where it is and then suggest to do stuff like ‘cd folder’ where the folder name is current project. instead of knowing that it already is there.
I’ve been thinking about this problem for a while, and I think there’s a general need for context-related system prompts to be injected periodically or before taking action. This doesn’t get us to what we want quite yet, but if we add template variables (or mustache templating or similar), I think we do.
Being able to add system prompts at various dialogue phase transitions/lifecycle events (in a .cursor/hooks/ folder perhaps) and a simple, well known, templating language on all prompts goes a long way to making a powerful agent (and chat) for relatively little effort.
I think the template context should minimally contain:
The current shell environment
The current IDE state
Workspace metadata
Optional /.cursorcontext.json
Thoughts anyone?
The Composer should be provided pwd
by the application when it first runs a console-based tool in a conversation.
After re-thinking security and access permissions, I’m ambivalent about pwd in this context. Why would any tool need to know what is outside its own folder (the path preceding).
can the OP’s issue be solved differently?
- relative paths for commands from current folder ./scripts/…
- ideally all executable paths (cli tools, etc.) should be in PATH already and automatically working.
The problem is mostly due to working in a mono repo, so while working on a workspace the agent assumes that the root is the place to run commands before realising otherwise.
This is likely resolved using project rules, but I have yet to try.
Yes in a monorepo, project rules with glob for path (even with file wildcards) would help make better targeted changes or tool calls.
Anything thats outside of common training data may need to be explained succinctly to AI. It cant yet read our minds