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…
Even even worse, angry all-caps shouting will make it more stupid, because it pushes you into a significantly stupider vector subspace full of angry all-caps shouting. The only thing that can possibly save you then is if you land in the even tinier Film Crit Hulk sub-subspace. I touch on this a bit in the piece I wrote for normies, it helped a lot of people I know understand the tech a bit better.
Claude Code runs Git reset –hard origin/main against project repo every 10 mins
201–210 of 219 posts
Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins
#202From 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.
"I built" is probably doing a lot of work here. Odds are it was some vibe-coded tool.
Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins
#203Earlier 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 is never a guarantee with GenAI. If you need to be sure, sandbox it.
Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins
#204Earlier quoted context omitted.
I'd been using cursor at work for a year or two now, figured I'd try it on a personal project. I got to the point where I needed to support env-vars, and my general pattern is `source ./source-me-local-auth` => `export SOME_TOKEN="$( passman read some-token.com/password )"` ...so I wrote up the little dummy script and it literally just says: "Hrm... I think I'll delete these untracked files from the working directory…
> but it lead to some interesting discussion w/ the AI like... Huh? What do you think this is accomplishing? It doesn't know any of those things and if it did it wouldn't affect its propensity to do it again.
...and replying to a sibling; yes, I did add it to `.gitignore` (but that's not a guarantee of it going crazy again), and was super surprised that it truly deleted it rather than "safely" doing `mv ... .trash/*` or something.
The reason to dig into the agent reasoning is that I have to treat myself as if I were the one in error (which as you pointed out, I was!), and determine the cause of it along with prevention.
Again; interesting times!
Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins
#205Let'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"
Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins
#206Earlier 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.
Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins
#207Earlier quoted context omitted.
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 sep…
Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins
#208Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins
#209I 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 ` or asked claude to create a cron task that runs every 10 minutes and refreshes & resets git.
Probably something innocuous like “Sync with the server periodically to get the latest” Tracks for what we can infer
If anybody has suggestions for how to do this with LLMs (short of maintaining CLAUDE_wall_of_shame.md), please share.
Edit: for the record, yes I do run a linter, and generally try not to impose bikeshedding or soapboxes on my peers. It's just that there are certain patterns that I personally am not going to commit under my own username as the engineer of record.
Edit 2: I saw another comment recommending "Always confirm with me before doing $x" (and then always denying). Seems like it might work.
Re: Claude Code runs Git reset –hard origin/main against project repo every 10 mins
#210Earlier 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…