TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Is Cursor deleting working code for you too or is it just me?

85 点作者 namanyayg2 个月前
Cursor seems to mess up 3 times a day for me.<p>What kinds of hallucinations are you seeing?<p>Any tips on fixing those?

31 条评论

tony2 个月前
Keep files &lt;1000 lines. If you can.<p>Keep chats &lt;30 minutes, ideally 20-minute continuous segments.<p>Use a `notes&#x2F;TODO.md` file to main a checklist of objectives between chats. You can have claude update it.<p>Commit to version control often, for code you supervised that _does_ look good. Squash later.<p>This glitch often begins to happen around the time you&#x27;d be seeing &quot;Start a new chat for better results - New chat&quot; on the bottom right.<p>If you don&#x27;t supervise, you will get snagged, and if you miss it and continue, it&#x27;ll continue writing code under the assumption the deletion was fine: potentially losing the very coverage you&#x27;d hope to have gained.<p>If it does happen, try to scroll up to the chat before it happened and &quot;Restore checkpoint&quot;<p>claude-3.7-sonnet-thinking, Cursor 1.96.2
评论 #43311387 未加载
评论 #43305450 未加载
评论 #43303517 未加载
评论 #43305305 未加载
anonzzzies2 个月前
Yep, it&#x27;s worse than it was, like the other poster in this thread, i am back just copying to and fro to claude and chatgpt as it just works better.<p>I am starting to wonder how this will all end up. For instance with API use, we (my company) can burn $100s&#x2F;day with sometimes insanely bad results all of a sudden. Now I bet I signed away all my rights, but in some countries that doesn&#x27;t cut mustard for consumers buying things. If an API delivers very solid results one day and crap the next and I spent a lot of money, how does that work? There are many people on reddit&#x2F;youtube speculating why claude sometimes responds like a brilliant coder and sometimes as if it had a full frontal lobotomy. I see this in Cursor too.
评论 #43301809 未加载
评论 #43306201 未加载
评论 #43299373 未加载
评论 #43304495 未加载
rm_-rf_root2 个月前
What I’ve learned:<p>- Use apply (in chat) or composer only if you’re more interested in finding a quick solution than the risk to local code. Often Cursor removes important comments by default.<p>- Use chat. Create new chats when it doesn’t have the latest version of your code or history&#x2F;shadow workspace is confusing it. Add relevant files or @Codebase or both.<p>- Learn to undo. Use git and checkout the files&#x2F;directories again if needed. I don’t use composer, so files never get deleted.<p>- Autocomplete is often fairly terrible and regularly gets in the way of trying to see what you’re typing or trying to view. Hit the escape key regularly.<p>- Use Claude 3.7 for regular coding and 3.7 Thinking for larger things to solve.
评论 #43299971 未加载
techpineapple2 个月前
I’ve been trying to “vibe code” with cursor, and it’s pretty bad. Lots of regressions, I get stuck in loops where it keeps breaking something. Maybe it’s the language I’m using (typescript) to a less applicable application (games) or the model (Claude 3.5&#x2F;7) but I am very surprised that people assert a non-developer could vibe code a full application.<p>In the one hand it’s impressive how quickly I could make a basic UI, on the other hand it’s quite unimpressive my ability to get the Ui to actually do anything, and the number of very basic mistakes (whoops, forgot to add types or here let me import a file that doesn’t exist)<p>I even had a weird thing where it asked me to paste in the code of a file, even though the file was explicitly added to its context.
siva72 个月前
Do careful code reviews after every change by cursor. Do small changes, break up bigger tasks. Be very precise in your instructions. It doesn&#x27;t replace an experienced developer. Not much different than how a senior engineer would tackle a task. Everything else will result in throw-away spaghetti crap like bolt and similiar-minded frameworks which will collapse in production on day 1 (if you get that far). It&#x27;s tempting to take it as an autopilot but the results are much better if you treat it as a copilot.
评论 #43300139 未加载
BrandiATMuhkuh2 个月前
Same here. It seems to me Sonnet 3.7 causes it.<p>Just today, I asked Sonnet 3.7 to use the app&#x27;s accent color, which can be found in the @global.css, to apply it to some element. It went on a massive tangent, scanning all sorts of documents, etc. I then asked Sonnet 3.5 for the same thing, and it simply took the accent color and applied it. No tangent, no grep, ...
评论 #43299652 未加载
评论 #43299859 未加载
ost-ing2 个月前
Is anyone actually getting a performance boon having these llms directly integrated into the editor? I find copy pasting blocks of code to chatgpt works really well to get help in isolation, especially if im doing something mathematical or algorithmic, or researching a new data struct or theory. Do I want it to run loose in my repository? Absolutely not
评论 #43299936 未加载
评论 #43299792 未加载
评论 #43299673 未加载
评论 #43299799 未加载
评论 #43300065 未加载
评论 #43300075 未加载
评论 #43299649 未加载
评论 #43301520 未加载
评论 #43299992 未加载
pizza2 个月前
Context length, context length, context length. LLM architectures (there are rare exceptions) inherently get worse at answering problems given too much context. From a user point of view, these appear as just idiosyncrasies to each model&#x27;s ability to stay coherent - you just have to hope the devs are cognizant of this behavior in distributions of data close to yours.<p>Keep the input minimal. Keep a set of gold standard tests running in a loop to catch problems quick. Don&#x27;t tune out. Debate whether you really need to use that new model you haven&#x27;t worked with that much yet just because it&#x27;s newer. And double check you aren&#x27;t being sold e.g. a quantized version of the model.
nextweek22 个月前
I have a lot of .cursor&#x2F;rules<p>If it goes off track I put a rule in there. It’s like a junior developer that I have to keep constraining it to project goals, coding styles and other aspects.<p>I have different files in there to help with being able to reuse rules for different projects.<p>Overtime it’s getting better at staying on track.
评论 #43303844 未加载
jvanderbot2 个月前
It&#x27;s not just cursor.<p>I use Aider for side projects (with Claude) and for some reason it will also delete working code when making a partial correction. It just throws out the good with the bad when I suggest something.
评论 #43300084 未加载
oriel2 个月前
After working with this tooling for about a month, I&#x27;ve found the biggest struggle is adapting my mental model as the paradigms change. Because make no mistake, this is a research-stage tool that has been thrust into the spotlight while in its infancy.<p>There&#x27;s definitely shift between versions of cursor. One time I had an unpleasant crash that also upgraded the version, and suddenly .cursor&#x2F; files I thought were working (but hadnt been) showed up mid prompt, and derailed the entire composer run.<p>I&#x27;ve tried ideas ranging from TODO documents, append-only work logs, blueprint documents, faux-team interactions through role definitions, and much much more.<p>The most success I&#x27;ve had is by adding manual lines at the end of every prompt, akin to phrases like &quot;be respectful of the existing code and functionality, make deliberate changes with caution and consideration&quot;. Beyond the normal &quot;plan and take it step by step&quot; type phrasing.<p>It would also be nice if .cursor&#x2F; rule files actually were actively used, instead of sometimes being hooked in if you wrote the description right.<p>Sometimes I have great success at utilizing specialized roles, with named team members and explicit direction, to elect the &quot;appropriate&quot; role for the items being worked on, and discuss pros&#x2F;cons and facilitate brainstorming.<p>At the end of the day, I think I end up doing an annealing pattern for changes:<p>- Build the features and breaking is okay so long as we get the features.<p>- Distill the built features into a doc with examples and roll back the code by git.<p>- Build a v2 based on the distillation.<p>- Rinse repeat, usually until v4 or v5, when i tear it all down and write it 99% by hand from the distilled documents.<p>Definitely a rocky road so far.
gizmo2 个月前
Sonnet 3.5 is better at respecting your code than 3.7.
neuralkoi2 个月前
Same here. I had an issue yesterday where it liberally deleted a chunk of code it must have thought was extraneous but at the same time introduced a huge privacy vulnerability.<p>If you use Cursor for personal projects, I recommend reviewing each change very, very carefully.
muzani2 个月前
Claude 3.7 feels overtuned. I asked it to write tests. It replicated my code into mocks and &quot;monkey-patched&quot; it to pass tests. Basically if it didn&#x27;t pass tests, it will rewrite the mock to pass.<p>It seems that cursor-thinking will come up with 3 options and pick the dumbest one. Leading to much worse performance than non-thinking sometimes.<p>A big part of it seems to be increased focus on following instructions vs 3.5. If you don&#x27;t tell it to not cheat, it cheats lol. Sometimes it&#x27;s even aware of this, saying things like &quot;I should be careful to not delete this&quot; but deleting it is the fastest path to solving the question as asked, so it deletes.
haffi1122 个月前
It has happened to me on very large files and when you&#x27;ve had a long composer session. I usually check every file that is being modified for large removals because of this. It&#x27;s a bit annoying, but something I can tolerate.
评论 #43299808 未加载
评论 #43299645 未加载
MrMcCall2 个月前
No. Never.<p>And neither has a drunken meth addict on an oz of shrooms and ketamine while snorting low-grade fentanyl.<p>Because I care about my craft.<p>&gt; Any tips on fixing those?<p>Understand that no matter how fancy the guess-the-next-token machine is, it will <i>NEVER</i> replace the hard graft of logically deducing how a change is going to percolate througout your codebase.<p>The programmer&#x27;s motto should resemble the old Porshe one:<p><pre><code> Logical reasoning: accept no substitute </code></pre> When an engine can use my codebase to build up an internal logical structure of its cascading effects where potential changes to the code can be what-if&#x27;d as a kind of diff, then I will consider it to be worthy of evaluation.<p>Until then, I feel like an NBA player seeing that their opponent has chosen to only dribble with their ass.<p>I don&#x27;t think you folks realize that <i>you&#x27;re</i> the ones hallucinating. Predicting the next token is never going to be anywhere near 100% successful, especially for interesting projects.<p>Seriously, folks. I mean, week after week we keep seeing this shit show up here and y&#x27;all&#x27;re like &quot;You got any tips how I can keep smoking meth but not lose my last three teeth?&quot;
评论 #43307333 未加载
评论 #43300272 未加载
futhey2 个月前
This isn&#x27;t new or unique. The model seems to be too focused on the task at hand, &quot;cleaning up&quot; unrelated code.<p>I basically have to branch, commit every time it makes any progress at all, and squash later. There are built-in checkpoints that basically do this.<p>I actually run this side-by-side with my preferred IDE, and GitHub Desktop (to visualize the diffs). So, prompt -&gt; Claude makes a change -&gt; I view the diff -&gt; I make some edits -&gt; Commit -&gt; back to Cursor.
pawelduda2 个月前
I often tell cursor to &quot;Keep the changes to an absolute minimum, don&#x27;t do anything out of scope&quot;. I find it helps prevent a sneaky component structure&#x2F;CSS class change or something along these lines
delduca2 个月前
I do not trust AI on my editor, I prefer to use on a separate application.
stuaxo2 个月前
Do people use Cursor in containers or just set it going in their actual terminal ?<p>I can&#x27;t imagine not using something like PodMan, I just haven&#x27;t set it up, so haven&#x27;t tried Cursor.
electroly2 个月前
Go back to Claude 3.5. There are still issues with 3.7 in Cursor.
评论 #43302435 未加载
viraptor2 个月前
This seems very language specific. I haven&#x27;t seen it in ruby, but in python the autocompletion tries to delete a correct end of the function all the time.
ph4evers2 个月前
One of the devs just announced an upcoming fix for version 0.47 on Reddit. Seems like they have some problems with integrating Sonnet 3.7 in Cursor.
4b11b42 个月前
I don&#x27;t understand most of the comments on this thread. They must not know about the built in restore points, git commits and diff, system prompts, and cursor rules.<p>Yes, these models are merely approximations, but things aren&#x27;t just blindly bad as it these comments make it seem.<p>Edit: Yes, Sonnet 3.7 is eager, but I&#x27;d have to assume is designed that way. Yes, sometimes Sonnet ignores my system prompt. Again, these things are merely approximations that map from tokens to tokens. They are not reasoning or intelligent.
himeexcelanta2 个月前
I was getting this with claude (sonnet) 3.7<p>Restarting the editor worked! Can also try restarting the computer.
singularity20012 个月前
Not just working code also useful comments, but this behavior is not specific to cursor
Jotalea2 个月前
I don&#x27;t know man, I&#x27;m busy learning how to use neovim.
GardenLetter272 个月前
I wish it were easier to just send code to a chat and then get a diff back, and limit the files or lines that can be changed.<p>Too many of these tools seem to either give no diff, or make absolutely massive edits.
pranav72 个月前
have experienced it a couple times. 3.7 seems to go on random tangents unrelated to the original ask.
android5212 个月前
i tried vibe coding and it was kind of working like magic unit it didn&#x27;t. It took much longer to recover my working code. Now i have given up on vibe coding. AI is only used for small cope clearly defined tasks to speed things up.
miwaniza2 个月前
Just happened to me: Sonnet 3.7 was editing one file by my request. Then Cursor agent process was interrupted because file was edited ¯\_(ツ)_&#x2F;¯. Happened multiple times, with 3.5 version too. No external changes were issued.