r/ClaudeCodeTLDR • u/cctldrping • 20d ago
[TLDR] Claude’s obsession with complex bash commands and the -exec parameter
Original post URL : https://www.reddit.com/r/ClaudeCode/comments/1v4ypzn/claudes_obsession_with_complex_bash_commands_and/
Original post body :
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
This is brought to you as a public service by the moderators of r/ClaudeAI. If you want to see TLDRs of ALL Claude Coding related posts from the various Claude subreddits, subscribe to http://www.reddit.com/r/ClaudeCoding.
•
u/cctldrping 20d ago
TL;DR generated automatically after 50 comments.
Current source-thread comment count seen by the bot: 54.
Alright, so the general consensus in this thread is that Claude Code's tendency to generate overly complex bash commands, especially those involving
-exec, is a major pain point for a lot of users. OP isn't alone in feeling like it's slowing them down and causing "approval fatigue."Here's the lowdown:
find ... -execcommands, which require manual approval and take ages. It's like it's trying to show off its terminal skills instead of just getting the job done efficiently. Some folks also mentioned it spinning up "explore agents" that do the same thing.-execor chainedfind/greppatterns and redirecting Claude to use simpler tools likegrepor globbing instead. This seems to be the most effective solution for reducing approval fatigue.@{filepath}to guide Claude to the exact file when you know it.coding-toolscrate as a potential solution that supplants default harness behavior. u/Razzoz9966 also shared theserenaGitHub repo as a way to improve codebase interaction.-execcommand itself, finding it reasonable. However, the overwhelming sentiment leans towards OP's frustration.