I want a cursor agent to be able to switch its agent mode in the middle of execution. Especially for multi step commands.
An example is a command to fix a bug that first gets the bug info, clarifies details, makes a new branch, then automatically switches to ‘Debug’ agent mode and starts to diagnose the bug. When it is marked as fixed, the next step of the command can have it switch back to regular agent mode and have it make a pull request for the bug.
I could see many other use cases for this, but this is the one I am currently trying to solve for, just allowing the agent to tell which mode it is in (Agent/Plan/Debug/Ask/etc.) and switch between them. Even if it was a prebuilt command to switch the modes that you have to explicitly ask it to execute.
Right now, the agent can’t programmatically switch between modes during runtime. Modes (Agent/Plan/Debug/Ask) can only be changed manually through the UI or with hotkeys.
As a workaround, you can try Custom Slash Commands: Commands | Cursor Docs. They let you create dedicated commands with instructions for using certain tools. For example, a /debug-bug command could include something like “First investigate using search tools, then add debug logging,” but the agent still won’t be able to automatically switch into Debug Mode. You’d need to do that manually between steps.
Your use case, an automated workflow like “get a bug, create a branch, switch to Debug, make a PR,” is a really interesting idea for more advanced agent orchestration. I’ll share it with the product team for consideration.