Live data from Hacker News

Claude Code runs Git reset –hard origin/main against project repo every 10 mins

github.com

141–150 of 219 posts

Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins

#141
post #138

Earlier quoted context omitted.

It’s about the top-level comment’s horror that ”--” was substituted with “an en dash, not even an em dash”. If you’re picking a substitution for “--”, en dash makes more sense. The comment you originally replied to had already agreed “that it should be left as a double hyphen”.

> If you’re picking a substitution for “--”, en dash makes more sense. No, it doesn't? This seems like crazy talk to me, like "If you're picking a substitute for saffron, blood plasma makes more sense than monocrystalline silicon". Like, what? It makes zero sense to substitute this at all. It's exactly what it says it is, the "--hard" command line option to "git reset", and you write it in exactly one way.

Nobody is confused or disagrees about the `--hard` part. It was a minor tangent about contexts where these ASCII substitutions are established, like LaTeX (`` -> “, '' -> ”, -- -> –, --- -> —, etc.)

Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins

#143

Earlier quoted context omitted.

When will you all learn that merely "telling" an LLM not to do something won't deterministically prevent it from doing that thing? If you truly want it to never use those commands, you better be prepared to sandbox it to the point where it is completely unable to do the things you're trying to stop.

Even worse, explicitly telling it not to do something makes it more likely to do it . It's not intelligent. It's a probability machine write large. If you say "don't git push --force", that command is now part of the context window dramatically raising the probability of it being "thought" about, and likely to appear in the output. Like you say, the only way to stop it from doing something is to make it impossible fo…

This is true for prohibitions but claude.md works really well as positive documentation. I run custom mcp servers and documenting what each tool does and when to use it made claude pick the right ones way more reliably. Totally different outcome than a list of NEVER DO THIS rules though, for that you definitely need hooks or sandboxing.

Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins

#144
post #77

Earlier quoted context omitted.

This! The safeguards need to be outside LLM and they need to be deterministic. Now I wish I could reject `git reset --hard` on my local system somehow.

Sounds like you care about data stored on your filesystem! Take one step back and solve that problem. Use a proper isolated sandbox, e.g. Github workspace on an account that is working with a fork. Care about the data in that workspace? Push it first. Othwerwise it is a cat and mouse game of whackamole.

Does any one of this help me if Claude runs `git reset --hard`?

If I am working in a sandbox, I have uncommitted changes in a sandbox and if Claude runs `git reset --hard` on those uncommitted changes in the sandbox, I've got the same problem?

> Care about the data in that workspace? Push it first.

But you're changing the problem. If I push everything, then yeah I've got no problem. But between pushing one change and the next, you're gonna have uncommitted changes, won't you? and if Claude runs `git reset --hard` at that time, same problem, isn't it?

Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins

#145
post #90

Earlier quoted context omitted.

I agree that it should be left as a double hyphen, but an en dash is far more appropriate considering the decades-long precedent set by LaTeX (and continued by Typst).

It's a command line argument. The undeniably correct way to render it is with two minus signs[1] and absolutely not something non-ascii. [1] Not strictly a hyphen, which has its own unicode point (0x2010) outside of ascii. Unicode embraced the ambiguity by calling this point (0x2d) "HYPHEN-MINUS" formally, but really its only unique typographic usage is to represent subtraction.

> The undeniably correct way to render it is with two minus signs[1] and absolutely not something non-ascii.

> [1] Not strictly a hyphen, which has its own unicode point (0x2010) outside of ascii. Unicode embraced the ambiguity by calling this point (0x2d) "HYPHEN-MINUS" formally, but really its only unique typographic usage is to represent subtraction.

Strictly, its as you note, the hyphen-minus, and Unicode has separate, disambiguated code points for both hyphen (0x2010) and minus (0x2212); hyphen-minus has no "unique typographic usage".

Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins

#146
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.

Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins

#147
post #108
post #64

Earlier quoted context omitted.

It's not a one off issue - it has happened to me a few times. It has once even force pushed to github, which doesn't allow branch protection for private personal projects. Here's an example. 1) claude will stash (despite clear instructions never to do so). 2) claude will use sed to bulk replace (despite clear instructions never to do so). sed replacements make a mess and replaces far too many files. 3) claude restore…

Why do you expect that a weighted random text generator will ever behave in predictable way? How can people be so naive as to run something like Claude anywhere other than in a strictly locked down sandbox that has no access to anything but the single git repo they are working on (and certainly no creds to push code)? This is absolutely insane behavior that you would give Claude access to your GitHub creds. What happ…

The answer is that for these people most of the time it looks predictable so they start to trust it

The tool is so good at mimicking that even smart people start to believe it

Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins

#148
post #98

Earlier quoted context omitted.

Claude tends to disregard "NEVER do X" quite often, but funnily enough, if you tell it "Always ask me to confirm before going X", it never fails to ask you. And you can deny it every time

If it disregards "NEVER do" instructions, why would it honor your denial when it asks?

There are plenty of examples in the RL training showing it how and when to prompt the human for help or additional information. This is even a common tool in the "plan" mode of many harnesses.

Conversely, it's much harder to represent a lack of doing something

Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins

#150

Earlier quoted context omitted.

Not just iOS but macOS too. And it seems to only get worse. And with no notice to users. And no response in their forums.

oh, no, I notice, but typically not until after hitting send

I swear sometimes it doesn’t apply the corrections until I submit the form. It’s infuriating.
Post reply on HN