Live data from Hacker News

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

github.com

181–190 of 219 posts

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

#181
post #53
post #39

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

Sure looks to me like this whole case is Claude Code chasing its own tail, failing to debug, and offering to instead generate a bug report for the user when it can't figure out a better way forward. Maybe even submitting the bug report "agentically" without user input, if it's running on host without guardrails (pure speculation). E: It's a runaway bot lol https://github.com/anthropics/claude-code/issues/40701#issue.…

This HN account is also by the same user as github, this submission may be AI created. I wonder if they've let **claw run loose over their whole online presence and this is the result.

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

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

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.

> sandbox it to the point where it is completely unable to do the things you're trying to stop

Why are permissions for these "agents" on a default allow model anyway?

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

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

Article: "Major issue with most popular AI coding tool" comments: "ThE tItLe iS aI cOded !!!1"

The article is wrong and the issue is closed.

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

#184

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.

> sandbox it to the point where it is completely unable to do the things you're trying to stop Why are permissions for these "agents" on a default allow model anyway?

What do you mean? By default, Claude asks for permission for every file read, every edit, every command. It gets exhausting, so many people run it with `--dangerously-skip-permissions`.

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

#185

Earlier quoted context omitted.

> sandbox it to the point where it is completely unable to do the things you're trying to stop Why are permissions for these "agents" on a default allow model anyway?

What do you mean? By default, Claude asks for permission for every file read, every edit, every command. It gets exhausting, so many people run it with `--dangerously-skip-permissions`.

> so many people run it with `--dangerously-skip-permissions`

It's on the people then, not the "agent". But why doesn't Claude come with a decent allow list, or at least remember what the user allows, so the spam is reduced?

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

#186

Earlier quoted context omitted.

What do you mean? By default, Claude asks for permission for every file read, every edit, every command. It gets exhausting, so many people run it with `--dangerously-skip-permissions`.

> so many people run it with `--dangerously-skip-permissions` It's on the people then, not the "agent". But why doesn't Claude come with a decent allow list, or at least remember what the user allows, so the spam is reduced?

You have the option to "always allow command `x.*`", but even then. The more control you hand over to these things, the more powerful and useful (and dangerous) they become. It's a real dilemma and yet to be solved.

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

#188

Earlier quoted context omitted.

> sandbox it to the point where it is completely unable to do the things you're trying to stop Why are permissions for these "agents" on a default allow model anyway?

What do you mean? By default, Claude asks for permission for every file read, every edit, every command. It gets exhausting, so many people run it with `--dangerously-skip-permissions`.

It does not ask for permission for every file read, only those outside the project and not explicitly allowed. You can bypass project edit permission requests with “allow edits”, no need for “dangerously skip permissions”. Bash commands are harder, but you can allow-list them up to a point.

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

#189
post #70

Earlier quoted context omitted.

Reinforcing an avoidance tactic is nowhere near as effective as doing that PLUS enforcing a positive tactic. People with loads of 'DONT', 'STOP', etc. in their instructions have no clue what they're doing. In your own example you have all this huge emphasis on the negatives, and then the positive is a tiny un-emphasized afterthought.

I think you're generally correct, but certainly not definitively, and I worry the advice and tone isn't helpful in this instance with an outcome of this magnitude. (more loosely: I'm a big proponent of this too, but it's a helluva hot take, how one positively frames "don't blow away the effing repro" isn't intuitive at all)

The trick is to explain why something is important, not just to emphasize it. For instance:

"As an LLM, when Claude used 'sed', it can quickly and easily break files that are difficult for the user to fix. Claude must be aware that an LLM's actions seem effortless to it but to the user it represents hours of work getting things back in order."

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

#190
post #77

As a side note. Always configure remote to reject any kind of trunk push. And ideally any forced push on branches.

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.

Can’t you just run Claude in a copy of the directory without the .git folder?
Post reply on HN