Live data from Hacker News

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

github.com

171–180 of 219 posts

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

#172
post #68
post #62

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.

double hyphens – triple hyphens —

For me on iOS:

Double hyphens —

Triple hyphens —-

Actual em dash (typed with more effort, but HN changes it) —

The triple hyphens has a gap in it separating the autocorrected en dash and the hyphen.

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

#173

Earlier quoted context omitted.

You underestimate just how annoying iOS autocomplete can be.

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.

I’ve been using Cotypist on macOS [1].

Sometimes it feels like it’s reading my mind when I’m typing.

[1]: https://cotypist.app/

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

#174

Earlier quoted context omitted.

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.

Yes but this is probabilistic. Skill, documentation etc help by giving it the information it needs. You are then in the more correct probability distribution. Fine for docs, tips etc, but not good enough for mandatory things.

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

#175
post #64

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?

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…

[dead]

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

#177

Earlier quoted context omitted.

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.

"more reliably" is still not "reliably".

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

#179
post #64

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?

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…

Like for humans, teaching the good way to do things works better than forbidding a few bad behaviours.

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

#180
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…

Claude Code hooks are deterministic; the agent can’t bypass them [1].

For example you force a linter to run or for tests to run.

Claude Code defaults to running in a sandbox on macOS and Linux. Claude Cowork runs in a Linux VM.

[1]: https://code.claude.com/docs/en/hooks-guide

Post reply on HN