Cursor now deleting code indiscriminately & loosing context

Only after the recent update is Cursor effectively reducing an entire page to fit the requirements of the latest request. For example if I had a paragraph on a page and was prompted to add in 1 sentence, the entire page gets reduced to the singular additional line.
This happens across multiple pages and API routes without triggering errors until I circle back to older work and notice entire code blocks deleted. Or reduced to “rest of your code here”

5 Likes

Example 2

1 Like

When called out it will even acknowledge the mistake
image

Problem is the goal was supposed to be to trust the LLM and get work done faster. That cant be the case with hiccups like this. Luckily I caught the mistake. But imagine this in 5 files and across orgs…

3 Likes

This is happening often lately! To me - every maybe 20 answers, it deletes the whole code from the file by trying to add a few lines of code. It adds its code but deletes everything else (my old code).

The problem is probably on Cursor side, not LLM.
Can’t wait for the next Cursor update, we haven’t had a proper one in a very long time (compared to before, check changelog). Maybe the Cursor team is preparing some major changes?

1 Like

I’m a new user to Cursor and this is happening to me know and it’s super disheartening. Anyone know which version of Cursor didn’t have this problem and how I download this version?

Same problem here. It’s actually fucking up my productivity now.

1 Like

I’ve had the same experience as well lately. It’s been deleting files and I wasn’t sure why and how it deletes the files, but this has to be fixed because one really needs to be careful so it doesn’t break the existing code structure when applying updates

Same here, I have been experiencing same issue quite some time now. I mostly use composer to do things. I have few files that are very problematic, Cursor usually deletes everything else but the function it wants to add or change.

After reverting and specifically telling Cursor not to delete but add. It confirms that adding only but still diff view shows up in 90% red.

Same issue here. Unusable.

It keeps either reducing the code to a single line or two, or it replaces the whole contents because it suddenly lost all context. This has been happening since the start, became worse maybe a month ago, but the last days have been crazy. I’ve been having to start over multiple times for the same project, thus wasting all my requests as well, so now I’m on the “slow requests”. The next time it loses context and/or deletes a bunch of things, I’ll throw this crap out and consider buying a more expensive but at least different, tool. I was even considering buying more fast requests this month, but then I realized it’s a “per month” purchase, an addition to your current subscription. There is no choice to just buy 500-1000 extra requests as a one-time purchase.

Embarrassing…

So until this is fixed, I have put this in every message to cursor whether I’m using CMD + K or CMD + I:

Note: if you ever respond with any code from any file, please make sure you respond with the FULL code in the file, not just a partial.

this should be fixed in the next release!

1 Like

This is not an excuse to Cursor, but these prompts help to reduce the pain.


Output Format for the IDE

Cursor employs a local model to interpret your outputs and apply necessary edits to specific files. Therefore, it is crucial to adhere to the specified output format precisely.

Include a brief excerpt from the current file before and after the intended changes. This helps the local model accurately locate where modifications or additions should be made.

Example:

// ... Previous content remains unchanged

{excerpt; 2 or 3 lines of the existing content immediately before the intended change}

{intended addition or modification}

{excerpt; 2 or 3 lines of the existing content immediately after the intended change}

// ... Following content remains unchanged

Note: The comment format must start with ‘// …’


Consult the Codebase and Project Structure

  • Please consult the @Codebase for overall details and locate the information or file you need. You may be able to access them directly.
  • Refer to the @project_structure.txt file for a structured view of the project’s relevant files (.ts, .js, .json, .md, .ps1) and directories. Note that standard development folders (node_modules, .git, .vscode), hidden files, and package-lock.json are excluded from this view.

Note: The shared information (snippets and excerpts) might be incomplete due to length restrictions. If you need to consult or edit a specific file, please let me know in advance so I can share the entire file content with you. This is important to ensure you have access to all necessary details and context.


IDE Already Implemented Changes

It seems my IDE has already implemented some or all of your suggestions. However, it would be prudent to verify and double-check the latest version of the files to ensure they are complete and accurate. Could you please review all the changes we’ve made to confirm they are fully implemented and correct?

1 Like

I’ve been facing these issues the last few days too but today has been the worst with cursor losing context and attempting to delete large swaths of core functionality for simple things like adding console.log for debugging.

About to switch to Windsurf tomorrow or worst case, back to old fashion chat interface with Claude 3.5 & GPT o-mini

1 Like

Here is an example of what is happening on my end. Thanks @system
Feedback for Cursor - Youtube.

Update: It only seems to be happening with files that aren’t initially created with Cursor. Developing files from scratch with Cursor is a dream!

Is cursor-small incapable of reading the actual file contents?

I am getting Chat deleting most code in the Editor (brown backgroun when Apply changes), about the same time I ran out of Claude credits and continued with free Cursor.

I am also asking Chat to read the contents of the file before making changes (so it won’t delete existing code), and it responds with garbage such as:
“I do not have the ability to access external files, directories, or any specific codebase directly. My responses are generated based on the information you provide in our conversation.”

Update: I asked Chat itself (cursor-small)
“Are AI engines other than cursor-small capable of reading actual folder contents? Which ones work in the free version of Cursor?”

Response:
As of my last knowledge update in October 2023, AI engines, including those integrated into various coding tools and IDEs, typically do not have the capability to directly access or read the contents of your local file system or folders. They operate based on the input provided by the user and do not have inherent access to external files or directories for security and privacy reasons.

So, cursor-small can’t read or modify existing code files. It is also over 1 year old.

This remains a significant issue while testing version 0.43.1 and the new composer agent interface. Cursor / composer frequently deletes substantial portions of the existing codebase when implementing proposed changes, and represents a very notable decline in the ability to apply code updates compared to a week ago.

Incredibly frustrating.

Same here, they are trying to be Windsurf now and agent mode doesn’t even work

In Windsurf, it doesn’t seem much different from Cursor. Overall, I can say that I experienced even worse performance in my multi-module project compared to Cursor. A few hours ago, I encountered numerous errors, especially while trying to apply the code it generated.

I came up with a hack to replace single functions in the mean time @system