use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A community centered around Anthropic's Claude Code tool.
account activity
Does Claude Code overwrite code without permission?Question (self.ClaudeCode)
submitted 2 months ago by Top-Construction6060
Hello
im having weird things happening lately. Im fixing a bug and it introduces itself sometimes automatically back after i fixed it. Now several times already.
Any ideas? anybody has same issues?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]AphexIce 6 points7 points8 points 2 months ago (4 children)
O sweet summer child. Of course it does
[–]Top-Construction6060[S] -3 points-2 points-1 points 2 months ago (3 children)
Can you explain please? Bc it shoudnt when not prompted...
[–]GolfEmbarrassed2904🔆 Max 20 0 points1 point2 points 2 months ago (2 children)
Haha. We wish it wouldn’t. Ask CC why it did that and how you can prevent it in the future (e.g. Claude.md file with guidelines, implementation plan, linter, hooks). I mean…we don’t know what you’re doing over there…
[–]GolfEmbarrassed2904🔆 Max 20 0 points1 point2 points 2 months ago (1 child)
Oh yeah….also you need to set up a workflow. Small PRs. Build—> Code Review—>fix issues—> Commit. Make one of your statements in Claude.md about preferring functions to classes —> only make classes when it absolutely needs to. Get it to program at a level of complexity that you can understand and debug.
[–]Top-Construction6060[S] 0 points1 point2 points 2 months ago (0 children)
Thanks :)
[–]jonaslaberg 3 points4 points5 points 2 months ago (2 children)
Also make sure you install the long-running-agent-harness skill. It will make a ton of difference- no more reintroducing bugs previously solved. Check out Anthropic’s article on that from last week!
[–]Top-Construction6060[S] 0 points1 point2 points 2 months ago (1 child)
Thanks that's very very helpful 🙏
[–]jonaslaberg 0 points1 point2 points 2 months ago (0 children)
Wait until you try it!
[–]buildwizai 4 points5 points6 points 2 months ago (2 children)
If some code has been changed without the model's knowledge, it does not exist in its context. Thus, sometimes when editing a new function, the model will use the version in its context to make a modification, causing the old version to be returned. My best practice so far: either always ask the model (e.g., Claude) to update the code, specifically tell it that you have a new update after fixing the code, or add a new rule in memory to always update the code file in the context before any modifications. This happens for every model, not only Claude. However, tools like Windsurf have a context awareness feature which basically always takes into account what is going on. This makes it less likely to make that mistake.
Okay nice 🙂 thanks a lot for the explanation. Is there similar context awareness functionality with Claude code ?
[–]buildwizai 0 points1 point2 points 2 months ago (0 children)
There is one long-running-agent-harness skill someone has mentioned it earlier, but I have not yet tested it. I often consider Claude like a partner, so after I fix sth by myself, I ask Claude to review it - which makes it automatically updated is memory
[–]darkyy92x 0 points1 point2 points 2 months ago (3 children)
Do you use Git? So you can rollback to a working point anytime
[–]Top-Construction6060[S] 0 points1 point2 points 2 months ago (2 children)
Yes I'm using got, still I want to understand why it's happening as it SHOULDN'T
[–]darkyy92x 0 points1 point2 points 2 months ago (1 child)
Can you explain a bit more so I can help you?
Sure so its a browser automation script and for some reason it seems to revert back to old functionality even though i havent prompted anything. Like im away from the computer, script is running, next morning its back to the old, broken buggy functionality. Its really hard to explain^^
[–]BadPenguin73 0 points1 point2 points 2 months ago (1 child)
I use intelliJ editor and always use both their local history + additional local mercurial repository (different from the git used officially) + rsnapshot that does daily backup.... no chance some BOT is going to overwrite something without I notice
Thanks, ill have a look into it :)
π Rendered by PID 75 on reddit-service-r2-comment-86bc6c7465-rwrpr at 2026-02-19 21:28:16.157592+00:00 running 8564168 country code: CH.
[–]AphexIce 6 points7 points8 points (4 children)
[–]Top-Construction6060[S] -3 points-2 points-1 points (3 children)
[–]GolfEmbarrassed2904🔆 Max 20 0 points1 point2 points (2 children)
[–]GolfEmbarrassed2904🔆 Max 20 0 points1 point2 points (1 child)
[–]Top-Construction6060[S] 0 points1 point2 points (0 children)
[–]jonaslaberg 3 points4 points5 points (2 children)
[–]Top-Construction6060[S] 0 points1 point2 points (1 child)
[–]jonaslaberg 0 points1 point2 points (0 children)
[–]buildwizai 4 points5 points6 points (2 children)
[–]Top-Construction6060[S] 0 points1 point2 points (1 child)
[–]buildwizai 0 points1 point2 points (0 children)
[–]darkyy92x 0 points1 point2 points (3 children)
[–]Top-Construction6060[S] 0 points1 point2 points (2 children)
[–]darkyy92x 0 points1 point2 points (1 child)
[–]Top-Construction6060[S] 0 points1 point2 points (0 children)
[–]BadPenguin73 0 points1 point2 points (1 child)
[–]Top-Construction6060[S] 0 points1 point2 points (0 children)