r/ClaudeCode • • 8d ago

Rant YOU DON'T SAY

Post image
633 Upvotes

64 comments sorted by

•

u/AutoModerator 8d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

84

u/jr1565 8d ago

The Gang Learns About Hooks

16

u/szkarpaty 8d ago

Yeah, rules are just suggestions otherwise.

6

u/jr1565 8d ago

yeah its counting on claude to read the rule every time and apply it properly from prose, its gonna go poorly eventually

2

u/imp_12189 8d ago

Hooks cost more tokens tho, cause it's count as input tokens from you.

2

u/karol207 8d ago

Running a shell script isn't itself a model call. A hook that sends a long message back into context can add tokens; one that just checks a condition and exits quietly is a different case.

1

u/nate-078 4d ago

The gang learns that hooks can't stop all stupidity, bht yeah, this one.

106

u/N-partEpoxy 8d ago

What's the reason for the no-scripts rule?

118

u/GregsWorld 8d ago

Guessing you've never had claude's python scripts straight up delete half of a document before... or get in an infinite loop waiting for a thing which has already completed.

45

u/N-partEpoxy 8d ago

The first one, probably, but Claude restores it from the repo so it's not really an issue. The second one, about once a week, but the idle wait doesn't waste tokens, which are the bottleneck for me, so it isn't a big deal either.

9

u/GregsWorld 8d ago

Yeah it's a non issue though I've also had claude include it in commits by mistake and fail to restore it and make a right mess.

but the idle wait doesn't waste tokens

It will cost you more if it takes long enough that your query gets bumped out of the 5 minute cache?

12

u/WisestAirBender 8d ago

What Claude code are you guys using? Never saw it make these kinds of blunders.

2

u/PutYourLifeinRice 8d ago

Try making it ssh on a colab machine and run jobs there. 95% of the time it is impeccable. But it gets it wrong sometimes. And ive only noticed it with colab

2

u/GregsWorld 8d ago

Most of the time it'll correct itself so you'd never notice if you aren't reading the commands it's running but it's constantly making "oops" mistakes whether that's broken scripts or failed commands etc.. 

1

u/IamTheEddy Developer 8d ago

It makes broken scripts on the first try less frequently than a human would so I don’t really see it as an issue. Usually the script to edit files will use less significantly less tokens then editing manually

1

u/GregsWorld 7d ago

Sure but humans aren't often writing scripts to edit files so that's an apples to oranges comparison.

4

u/N-partEpoxy 8d ago

True. But don't many commands it runs take longer than five minutes anyway?

4

u/GregsWorld 8d ago

Yup it will, the 1 hour cache is the more important one to look out for

17

u/a-r-c 8d ago

it can do that with the edit/write tool too lol

I trimmed your file to 0 bytes. Sorry.

that's a real quote from claude 😭

it was able to be regenerated, but still lmao

6

u/Single_Blueberry 8d ago

Doesn't take a script for Claude to mess up a rm.

If you run an AI agent on a machine without a backup and restore strategy in mint condition, you'll burn your fingers eventually.

5

u/Rintaroukazuma 7d ago

I have a proxmox server that it uses containers and vms to do actual testing and coding, it seems to be containing any mistakes well

2

u/Old_Flounder_8640 7d ago

NVIDIA/Openshell

1

u/Nikolcho18 5d ago

Any tips for setting up my proxmox family server with llm agents and a harness? I have limited time because of work and other projects, but Microsoft are dicks and nuked some services I was relying on. My only option is to replicate them on my half abandoned overkill proxmox system.

Generally I am looking to use 3 4tb drives that I have for storage and backup. Two of them mirrored as zfs on the server and the third one as a backup at another location.

1

u/Rintaroukazuma 5d ago

Honestly if you're using Claude, I have it create a plan for what you need and then have it deploy that on the proxmox server. I have Claude ssh into mine to do changes. It's a homelab setup so I can deal with small issues

1

u/Nikolcho18 5d ago

Sounds good. How do you protect yourself during the initial stages of the setup from stuff like the dreaded misuse of rm? I will set up backups once everything is set and in place of course, though I am going to be adjusting a system I set up manually about two summers ago, not starting from scratch.

I will be using antigravity in one way or another, by the way.

Thanks for the advice!

1

u/Rintaroukazuma 5d ago

You can setup permissions in automode for rm, I have it set so that it prompts me in Claude code to approve before it runs the command. Usually I ask it to check the system so that it knows config context, hardware setup etc. when it needs sudo I have it create scrips that I need to run manually instead of executing everything itself. So far no issues at all, but after initial setup coding in a container is pretty safe.

2

u/Nikolcho18 5d ago

Thanks!

4

u/YET_BOII 8d ago

I fucked up my pc last week because of that lol

1

u/Old_Flounder_8640 7d ago

Linux or MacOs?

2

u/Right-Somewhere5572 5d ago

You are normal for nor mentioning the forbidden name

2

u/YET_BOII 4d ago

The forbidden "W" OS 0_0

2

u/Fulgurata 8d ago

Never had the first one actually, Claude is obsessed with backups. Half the time I can't get him to delete anything, he'll refuse and make me a a script to run myself that does it.

I've had Deepseek do it, the Claude supervisor restored from backups half an hour later and I learned about it through a footnote in my daily summary the next day.

1

u/nezvanovova 7d ago

My Claude never did that, I think Opus 5 once deleted half my repo, but it was in Git because I'm a normal person.

0

u/eeyoredragon 8d ago

Craig, stop

15

u/shadersreloaded 8d ago

The amount of third/fourth tries my Claude had to make is insane because it keeps trying to do everything in Bash commands and Python, breaks the heredoc and quoting 9999 times before giving up, instead of just FUCKING using the edit tool

2

u/aknps 8d ago

That is the time to switch to pi.dev

1

u/Sick-Little-Monky 5d ago

Today I finally caved and got it to set up auto deny "sed * -i" commands in an effort to prevent entire files converting to LF EOLs. Later an agent said I denied its attempt to modify a file, so it added a to-do to try again if I asked. You just can't win. There's always another corner case.

32

u/avk5143 8d ago

Having an instruction like "Please don't do X" in your CLAUDE.md file is about as effective as giving instructions to a kid with ADHD.

Use hooks or build your own static analyzer to enforce deterministic rules.

26

u/Prinzka 8d ago

It loves using anything but edit to edit files

9

u/opmopadop 8d ago

I did xyz and it errored, adding it to HAZARDS.md now.

It's already there, I should have caught that.

9

u/plain_meridian 8d ago • Bravo

CLAUDE.md is a suggestion, a hook is a rule. Learned that the hard way

26

u/permissionBRICK 8d ago

Why on gods earth not just let it do scripted edits?

41

u/bzbub2 8d ago

live image of op

14

u/Creative_Shape_5813 8d ago

it's too token efficient otherwise

10

u/tech_is______ 8d ago

when I first got Claude, I asked it to setup my claude.md and project rules cause I didn't know better. This was one of those rules. Along with no sub agents. Fast forward and it can't write scripts and at one point made a hilarious joke about having to do the work itself like a fool. when I asked why it said it was a rule I made and what a difference getting rid of those made.

I still have no idea why opus 4.6 thought those would make good default rules.

3

u/GergelyKiss 7d ago

I think at that point LLMs made unreliable edits especially when nearing their context window limits, so having it write a script that cleanly fails was beneficial.

2

u/Bladder-Splatter 6d ago

They did! Opus 4.6 was the first model I used that didn't give out garbage or syntax errors in *most* of its output. We've leapfrogged again with 5.5 but it's kinda horrifying how bad things were at one stage where it felt like getting working output was a gacha pull even if you set dozens of rules preventing it from relearning the same mistakes over and over.

5

u/DiscipleofDeceit666 Researcher 8d ago

It’s much much harder to audit

1

u/Fulgurata 8d ago

This yep. People act like only giving the agent access to a specific repo and toolset somehow constrains it's access and risk. Not so much if any of those tools can write to a py or ps file... Of course, you can go so far as to lock users into a chat interface and they'll just smuggle code through the clipboard. 

11

u/DevOnTheStreets 8d ago

No hook usage huh? 🤔

15

u/Global_Knee5354 8d ago

That was an honest mistake, and you're right to push back on that.

2

u/EverydayLentils 8d ago

Claude tried that but that day I was using Windows without python on the command line. Finally realized "python is not installed on this machine" and wrote some of the worst code I ever saw.

1

u/kim-el 8d ago

let me guess. fable 5.2?

1

u/m-in 8d ago

It does this all the time BTW. That’s how I can tell it’s a real post lol.

1

u/LibrarianOk3701 8d ago

I don't know why it always prefers bash or python scripts over just writing or editing files with its tools lol

1

u/Capt_korg 7d ago

Well, I like Claude's honesty.

1

u/Keepcompany-DEV 7d ago

For stuff like that it makes way more sense to throw script execution denials I tot he sessions settings file instead of just telling it. That's what those files are for.

1

u/Additional-Gur-397 7d ago

If I were to give Claude a pet name, it would be "Captain Hindsight" (from a South Park episode). It seems to be great at recognizing what it did wrong in retrospect, including not obeying claude.md, maybe greater even than it is at doing things right in the first place.

1

u/m_therex Developer 5d ago

Who would have thought....guess the Edit tool is called Edit for a reason, no? 🙃

1

u/pedrofuentesz 8d ago

It wants to spend extra tokens waiting for scripts

-1

u/cheyumaama 8d ago

Is it opus 5.5? He's gotten dumb as shit ever since fable 5.2 came out. His whole personality reads like a beta male now. He keeps apologizing for mistakes, keeps saying "a correction to my earlier statement" etc. It's like anthropic fucked him just to get us to use fable 5.2. Terrible. 

1

u/Radio_Wave_Man 3d ago

I mean if that's how you talk to it, no wonder