Context mistakes
Stop wrong-file edits and duplicated code, know when to start a new chat, and cut rules and MCP servers that crowd the context.
-
Why Does Cursor's Agent Duplicate Code You Already Have? Usually you asked for a change before anyone looked at what's already there. Level 2: Context
- 1Ask how it works now
- 2Check the answer
- 3Ask for the change
- 4Review the diff
-
When Should You Start a New Chat in Cursor? Start a new chat when you switch tasks, when you finish a feature, or when Agent keeps going in circles, even if you're mid-feature. Level 2: ContextKeep goingsame chat
- Same feature
- Useful earlier context
- Agent is on track
Start freshnew chat- New task
- Agent making mistakes
- Going in circles
-
Why Does Cursor Edit the Wrong File, and How Do You Stop It? Agent takes your request literally, and where you give no intent, it uses its best judgment. Level 2: ContextLeft to guessno scope given
- Picks a similar file
- Invents a pattern
- Edits more than asked
Directedscope in the prompt- Right file
- Your pattern
- A small diff
-
Are Too Many Rules and MCP Servers Hurting Cursor? They can be. Level 3: WorkflowsTop: needed always. Bottom: needed sometimes.Always Apply rulea few lines, every chatReference a filean @ file is read only when neededGlob ruleloads with matching filesSkillfull text loads when relevantLeft: short. Right: long.
Too little and too much look similar
Both produce confident work that's off target. With too little context, the agent guesses at files and patterns. With too much, your instruction competes with long rules, stale conversation and irrelevant results. The context ring and a look at your last prompt will usually tell you which one you're dealing with.
Change the setup, not just the prompt
If you've made the same correction twice, a better prompt won't stop it happening a third time. Write the fix into a rule, exclude the competing files with .cursorignore, or start your work with a read-only step in Ask mode. Then the next chat starts in a better place.
Why does Cursor keep editing the wrong file?
It's probably choosing between similar matches, such as two config files. @-mention the exact path, say which folders to leave alone, and exclude generated copies with .cursorignore.
Why does Cursor create a function that already exists?
Cursor's course calls this changing before understanding. Ask Agent first to show how the repo already handles the task and where shared code lives, then ask for the change using that code.
When should I start a new chat in Cursor?
When you switch tasks, finish a feature, or see the agent going in circles. Cursor's course says it's worth continuing while you're on the same feature and the earlier context is useful.
Can too many rules hurt Cursor?
Yes. Cursor's course says too many rules consume unnecessary context and may confuse the agent. Keep always-on rules short, scope others with globs, and move occasional procedures into skills.