Claude Code runs Git reset –hard origin/main against project repo every 10 mins
by mthwsjc_ on 3/29/2026, 10:15:06 PM
https://github.com/anthropics/claude-code/issues/40710
Comments
by: kibwen
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.
3/30/2026, 12:49:40 AM
by: Jarred
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`<p>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.
3/30/2026, 1:33:26 AM
by: kccqzy
> Process monitoring at 0.1-second intervals found zero git processes around reset times.<p>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.
3/30/2026, 12:24:37 AM
by: nstj
As an FYI you can recover from force pushes to GitHub using their UI[0] or their API[1].<p>And if you force push to one of your own machines you can use the reflog[2].<p>[0]: <a href="https://stackoverflow.com/a/78872853" rel="nofollow">https://stackoverflow.com/a/78872853</a> [1]: <a href="https://stackoverflow.com/a/48110879" rel="nofollow">https://stackoverflow.com/a/48110879</a> [2]: <a href="https://stackoverflow.com/a/24236065" rel="nofollow">https://stackoverflow.com/a/24236065</a>
3/30/2026, 2:15:24 AM
by: simianwords
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?
3/30/2026, 12:06:50 AM
by: lambda
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?
3/30/2026, 1:28:01 AM
by: nerolawa
Highly recommend to deny commands in user settings.json like git reset
3/30/2026, 2:16:14 AM
by: luxurytent
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.
3/30/2026, 12:03:15 AM
by: mememememememo
As a side note. Always configure remote to reject any kind of trunk push. And ideally any forced push on branches.
3/30/2026, 12:43:21 AM
by: byearthithatius
Regardless of if this is common its getting popular because its objectively hilarious and we can all see it being possible.
3/30/2026, 12:28:34 AM
by: ghelmer
That is not my experience.
3/30/2026, 12:07:21 AM
by: jrvarela56
It’s a feature not a bug!
3/29/2026, 11:52:12 PM
by: oelmgren
I'm curious how common this is or if this just affects this one user.
3/30/2026, 12:12:45 AM
by: lqstuart
if an idea can't be vibecoded in under 10 minutes, it's not worth pursuing. Checks out
3/30/2026, 1:58:25 AM
by: gverrilla
obviously a user mistake, not a claude code bug
3/30/2026, 2:03:49 AM
by: chaos_emergent
Have you considered that Claude set up a crontab that does that programmatically? Every 10 mins seems awfully, idk, regular.
3/30/2026, 12:49:50 AM
by: jxcole
The obvious solution is to just copy paste it into Claude itself and ask it to fix. Works for almost any Claude problem
3/30/2026, 12:45:04 AM
by:
3/29/2026, 11:58:13 PM
by: simianwords
Prompt injection?
3/29/2026, 11:46:41 PM
by: whateveracct
that must be a very powerful claude.md
3/30/2026, 12:00:18 AM
by: meltyness
is this token friendly?
3/30/2026, 12:29:15 AM
by: meander_water
Probably does it to reduce context for regex/git history searches
3/30/2026, 12:03:16 AM
by: dboreham
But it doesn't.
3/30/2026, 1:38:40 AM
by:
3/30/2026, 12:48:09 AM
by: fragmede
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).
3/30/2026, 12:15:09 AM
by: TZubiri
tbf, that's claude's workspace<p>do not share a workspace with the llm, or with anybody for that matter.<p>How would the llm even distinguish what was wrote by them and what was written by you ?
3/30/2026, 12:08:18 AM
by: irishcoffee
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.<p>This whole LLM thing is a blast, huh?
3/30/2026, 12:32:20 AM
by: nickphx
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?
3/29/2026, 11:58:26 PM
by: imta71770
[dead]
3/30/2026, 1:54:41 AM
by: MeetRickAI
[dead]
3/30/2026, 12:15:09 AM
by: ryguz
[dead]
3/30/2026, 12:36:39 AM
by: mistM
[dead]
3/29/2026, 11:23:07 PM
by: xorgun
[dead]
3/29/2026, 11:31:59 PM
by: draw_down
Hope they don’t auto-close this one in two weeks
3/30/2026, 12:13:16 AM
by: claudiug
no more developers, all code is written alone /s
3/30/2026, 12:05:45 AM
by: BoorishBears
Truly is a brave new world we're in<p>-<p>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.<p>The idea a natural request can get Claude to invoke potentially destructive actions on a timer is silly<p><a href="https://code.claude.com/docs/en/scheduled-tasks#set-a-one-time-reminder" rel="nofollow">https://code.claude.com/docs/en/scheduled-tasks#set-a-one-ti...</a><p>What would it cost if the /loop command was required instead of optional?
3/29/2026, 11:28:21 PM
by: throw5
Isn't this a natural consequence of how these systems work?<p>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.<p>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.<p>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.<p>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.
3/30/2026, 12:00:58 AM
by: boutell
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.<p>Oh, but maybe allowing it to do remote git operations is a necessary trigger.
3/29/2026, 11:30:06 PM