Cursor agent enhancement

Hello,

Cursor Agent is wonderful, but sometimes I encounter issues when I ask the agent to perform a task. For example, it might create something that already exists in the codebase (like an API route similar to one already present) or make changes that affect other parts of the code unintentionally, such as modifying the frontend when I only asked for a specific edit.

Am I perhaps using it incorrectly?

The agent can sometimes assume it knows all the context it needs once you’ve shared a few messages back and forth, even though it doesn’t.

As a workaround, I’d recommend adding to your Rules for AI some instructions to always look up the contents of files and folders before making changes, and not to assume it has the latest context without manually gathering it.

You may also find benefit in adding similar sentences in your messages, asking it to look at the files and folders before making changes, or only making changes to specific files. You can still @ files in the agent mode to point the agent to specific files to read or edit.

1 Like