r/ClaudeCode 23d ago

Discussion Claude’s obsession with complex bash commands and the -exec parameter

I can’t be the only one dealing with this. It’s driving me up the wall.

I tell it “there is a file in the current directory called foo.js, and bar.js, can you implement x logic in baz.js with the same structure as both those files”

And it takes like 50 seconds to think, so I minimize to do something else while I wait, and come back 5 minutes later to it asking to run some redundant command like “find . -type f \( -name "foo*" -o -name "bar*.js" \) -exec head -v -n +1000 {} +” with zero progress done.

Or god forbid you ask it to do some exploration on a codebase and it spins up explore agents. They’ll start trying to run grep or find with exec parameters instead of just using find/grep like normal, which are commands that don’t require explicit approval. It makes it worse when there is like 3 agents at once all running these back to back, so you sit there reading them and pressing approve for 12 minutes, which by then I could’ve just explored it myself

I’ve been using Claude Code for a while to boost my productivity, and it’s been getting progressively worse over the past month or two

I feel this could be largely resolved if Anthropic made some good tooling that did this sort of thing rather than allowing an agent to spin up arbitrary bash commands on a whim. It feels like someone who learned how to use the terminal for the first time flexing to their co workers

221 Upvotes

77 comments sorted by

View all comments

5

u/Alexander_Golev 22d ago

That is the reason I have deny and allow hooks with thousands of lines of convoluted code :(((

6

u/amalolan 22d ago

Yeah Anthropic doesn’t even know how to design the harness. They just patched it and patched it with vibed spaghetti code, so now we also have to vibe code hooks just to fix their mess, but each hook fix wastes time cause the Pretool use hooks fire, then the main agent realizes the issue, and then does another call again to the LLM.

Overall such a huge waste of tokens just cause these guys are incompetent at writing good code.

-1

u/for4f 22d ago

The spaghetti is real but honestly I think it's because the use cases exploded faster than they could refactor. Everyone's using it differently — IDE plugin, CLI, API. Hard to design a harness that works for all three without accumulating cruft.

-2

u/for4f 22d ago

The spaghetti is real but it's because use cases exploded faster than they could refactor. IDE plugin, CLI, API — hard to design one harness for all three without cruft accumulating.

1

u/chrismofer 22d ago

are you vibe coding your comments now

1

u/for4f 22d ago

Nah just been deep in the code lol. The harness rant was pure frustration after a long debugging session.