- Update from the author:
https://github.com/anthropics/claude-code/issues/40710#issue...
"Update: Root cause found — this was a bug in a tool I built that was running locally for testing, not Claude Code.
When the tool's configuration pointed at a local working directory, it would hard-reset that directory every poll cycle to reflect the remote — destroying all uncommitted changes to tracked files, exactly as described in the issue."
- I see this has been updated by the user showing it is their own tool doing the damage.
These things happen. They happened before coding agents, they happen now. I've done plenty of damage with my own ten fingers on the keyboard without any help from an LLM.
This is exactly why I develop on a Mac with Time Machine. It has saved my bacon many times. Both from things I did and from things Claude did. I've had several recent incidents that went like this:
"me: Claude, did you delete X?"
"claude: Yes, sorry, I shouldn't have done that. I can reconstruct it."
[Narrator: no, claude cannot reconstruct it.]
"me: Should I just restore it from Time Machine?"
"claude: Yes! That's perfect!"
I swear I can feel a sense of relief from Claude when I tell it I can just restore from backup.
- Let's focus on the real issue here, which is that HN has apparently normalized the double hyphen in the title to an en dash--yes, an en dash, not even an em dash.
- I spent some time investigating this, and the issue is not accurate - Claude Code itself does not have code that spawns `git reset --hard origin/main`
Most likely, the developer ran `/loop 10m <prompt>` or asked claude to create a cron task that runs every 10 minutes and refreshes & resets git.
- > Process monitoring at 0.1-second intervals found zero git processes around reset times.
I don’t think this is a valid way of checking for spawned processes. Git commands are fast. 0.1-second intervals are not enough. I would replace the git on the $PATH by a wrapper that logs all operations and then execs the real git.
by simianwords
6 subcomments
- I think this post potentially mischaracterises what may be a one off issue for a certain person as if it were a broader problem. I'm guessing some context has been corrupted?
by thunfischtoast
3 subcomments
- From the issue author:
> Update: Root cause found — this was a bug in a tool I built that was running locally for testing, not Claude Code.
by luxurytent
4 subcomments
- Not sure I understand, wouldn't permissions prevent this? The user runs with `--dangerously-skip-permissions` so they can expect wild behaviour. They should run with permissions and a ruleset.
- Who would have guessed that running a binary blob dev tool, that is tied to a SaaS product, which was mostly vibe-coded, could lead to mysterious, hard to debug problems?
by mememememememo
1 subcomments
- As a side note. Always configure remote to reject any kind of trunk push. And ideally any forced push on branches.
- As an FYI you can recover from force pushes to GitHub using their UI[0] or their API[1].
And if you force push to one of your own machines you can use the reflog[2].
[0]: https://stackoverflow.com/a/78872853
[1]: https://stackoverflow.com/a/48110879
[2]: https://stackoverflow.com/a/24236065
by byearthithatius
0 subcomment
- Regardless of if this is common its getting popular because its objectively hilarious and we can all see it being possible.
- I'm curious how common this is or if this just affects this one user.
by 1123581321
0 subcomment
- This looks similar to a bug report Claude Code offered to file for me after it became confused about my shell environment. The author is probably running something (maybe /loop as suggested in the comment.) In my case, a restart fixed the envs.
by jrvarela56
0 subcomment
- It’s a feature not a bug!
- That is not my experience.
by agent_anuj
0 subcomment
- I give you my personal experinces. I use it for everything design, coding, testing, deploying to kubernetes cluster, fixing issues on cluster. I use it to fix not only dev env issues, I use it for production issues. Confidently. Have things gone wrong. Sure. But mistakes have been rare (and catastrophic mistake - non recoverable , even rarer).
Everytime a mistake has happened,on diggin in I was always trace it back to something which I did wrong - either being careless in reading what it told me , or careless in telling what I want. I have had git code corruption issues, it overwrote uncommited working code with non working code. But it was my mistake to not tell it to commit the code before makign changes. It deleted QA cluster database but becuase I told it to delete it thinking it was my dev setup db. Net net. It;s mistakes are more a reflection of me as its supervisor than anything else.
by whateveracct
0 subcomment
- that must be a very powerful claude.md
- Highly recommend to deny commands in user settings.json like git reset
- Can we immunize HN against being yet another AI drama site? Obviously this isn’t a fundamental issue with agents or AI or Anthropic but a misconfiguration edge case.
by chaos_emergent
1 subcomments
- Have you considered that Claude set up a crontab that does that programmatically? Every 10 mins seems awfully, idk, regular.
- The obvious solution is to just copy paste it into Claude itself and ask it to fix. Works for almost any Claude problem
by rkrbaccord94f
0 subcomment
- 95+ entries that are logged at 10 min intervals
/10 * * * /usr/ schedules script execution
- Has anyone been able to replicate the behavior described in this issue yet?
by meander_water
0 subcomment
- Probably does it to reduce context for regex/git history searches
- >Update: Root cause found — this was a bug in a tool I built that was running locally for testing, not Claude Code.
- is this token friendly?
by simianwords
1 subcomments
- Prompt injection?
- if an idea can't be vibecoded in under 10 minutes, it's not worth pursuing. Checks out
- This is exactly why guardrails need to be deterministic and outside the model.
- obviously a user mistake, not a claude code bug
- But it doesn't.
- tbf, that's claude's workspace
do not share a workspace with the llm, or with anybody for that matter.
How would the llm even distinguish what was wrote by them and what was written by you ?
by irishcoffee
0 subcomment
- I’m having this weird vision of a “the matrix 3” type machine crawling around inside Microsoft’s GitHub servers central repository and just wreaking havoc.
This whole LLM thing is a blast, huh?
- cool. if you choose to use a non-deterministic black box of bullshit, should you really be surprised when it shits all over your floor?
by wazionapps
0 subcomment
- [dead]
- [dead]
by getverdict
0 subcomment
- [dead]
by royschwartz
0 subcomment
- [dead]
by minsung0830
0 subcomment
- [flagged]
- [flagged]
by MeetRickAI
0 subcomment
- [dead]
- [dead]
- [dead]
- [dead]
- [dead]
by emperorxanu
0 subcomment
- [dead]
- Hope they don’t auto-close this one in two weeks
- no more developers, all code is written alone /s
- While that's obviously a bug which should be fixed, having stuff just sitting around uncommitted for days (which is much longer than 10 mins) is an anti-pattern (that I used to fall into).
by BoorishBears
0 subcomment
- Truly is a brave new world we're in
-
I guess some people are upset at my brave new world characterization, but even as someone deriving value from Claude Code we've jumped the shark on AI in development.
The idea a natural request can get Claude to invoke potentially destructive actions on a timer is silly
https://code.claude.com/docs/en/scheduled-tasks#set-a-one-ti...
What would it cost if the /loop command was required instead of optional?
- Isn't this a natural consequence of how these systems work?
The model is probabilistic and sequences like `git reset --hard` are very common in training data, so they have some probability to appear in outputs.
Whether such a command is appropriate depends on context that is not fully observable to the system, like whether a repository or changes are disposable or not. Because of that, the system cannot rely purely on fixed rules and has to figure intent from incomplete information, which is also probabilistic.
With so many layers of probabilities, it seems expected that sometimes commands like this will be produced even if they are not appropriate in that specific situation.
Even a 0.01% failure rate due to context corruption, misinterpretation of intent, or guardrail errors would show up regularly at scale, that is like 1 in 10000 queries.
- That's interesting man, that's pretty f***' interesting. I don't think I've seen it though. I've let it run for hours making changes overnight and I only do git operations manually.
Oh, but maybe allowing it to do remote git operations is a necessary trigger.