3 ms·
For some reason Claude Code keeps using awk, sed, and even Python to do basic file editing. Anyone know why that changed with the 5 series?
by IgorPartola 3mo ago
For some reason Claude Code keeps using awk, sed, and even Python to do basic file editing. Anyone know why that changed with the 5 series?
- rcfox 3mo agoI've noticed that too. Maybe the normal Write tool has to output the entire file and this is an attempt to reduce token usage?
- pjm331 3mo agoThe Edit tool has been notoriously tricky to get right - it seems they have maybe branched out but I think morphllm started specifically with the pitch that they trained a small model to be good at editing files - most of their testimonials are about that But I think it’s mostly a solved problem in frontier models and the bash tool usage is more likely an attempt to be more token efficient - I’ve noticed it used for making mechanical bulk edits that would be numerous “edit” tool uses otherwise
- troupo 3mo ago> this is an attempt to reduce token usage? Wouldn't generating a Python script to edit files waste more tokens than using the built-in tool?
- sznio 3mo agodepends on the breadth of the edit. anything that involves multiple files might be better done with python (e.g. renaming a function, along with changing all call sites.)
- ryeguy 3mo agoWhat does this question have to do with the linked article?
- Neywiny 3mo agoBecause they're thinking like I did going into the article. Harnesses like Claude expose "tools" to the agent. I usually use Cline but I'm giving up on it for this exact reason. Cline tells the model "you tell me to write a file, I'll get it done" and then it messes everything up, causes tones of errors, and the model goes "wow that's a broken tool. I'm going to write a python script to write the file instead"
- reneeh 3mo agoCline just recently fully upgraded their harness, see here: https://x.com/cline/status/2095897914493243512?s=20 https://x.com/cline/status/2095897914493243512?s=20 Try if you have a better experience now!
- Neywiny 3mo agoThey said as of aug 23rd it's 100% rollout. I've noticed 0 improvement. If anything a downgrade. The agents often refuse to use the tools after 1 try because the results are so trash. An open ticket that shows my biggest gripe with the write tool https://github.com/cline/cline/issues/13276 https://github.com/cline/cline/issues/13276 I guess the mistake count is down though. But that's because it's bypassing all the tools and just running commands
- nijave 3mo agoActually, yes. Probably this https://github.com/anthropics/claude-code/issues/88041#issuecomment-5385012523 https://github.com/anthropics/claude-code/issues/88041#issue...
- nullbio 3mo agoThey love adding flags to fix issues that users have without telling their users about the flags. It very much feels like: As long as our staff can have a good user experience, we're happy. We don't care about anyone else.
- LtWorf 3mo agoYou are attributing too much agency. They just vibe code the thing and hope for the best probably.
- k4rli 3mo agoThe comments there just seem like agents talking to each other.
- worldsavior 3mo agoThat's because they code their AI tool with AI so they just didn't notice what it added and they forgot about it.
- Maxion 3mo agoThe comments on this issue are unbearable.
- mavamaarten 3mo agoOh and don't forget: it keeps chaining a bazillion commands together so any whitelisted commands still need approval because they're nested in such a convoluted way.
- albrewer 3mo agoI have a hook that auto-denies when it sees 'python -c "', ' awk ', ' sed ', and '&&'
- mavamaarten 3mo agoAnd find --exec too.
- IgorPartola 2mo agoIt can still invoke them in subagents and does this.
- chris_money202 3mo agoFunny enough this gets around content exclusion filters my company has set (for things like missing copyrights), so i actually like it
- 0x457 3mo agoThese file edits are faster and easier for the model to do than "regular" edits. The model is told to use them when auto mode is enabled. The problem is when you go from plan to auto to anything but auto, that preference sticks. There is an option to opt-out: https://github.com/anthropics/claude-code/issues/88041#issuecomment-5385012523 https://github.com/anthropics/claude-code/issues/88041#issue... This won't save you from it chaining 500 bash commands with git push --force somewhere in the middle.
- yencabulator 3mo agoBecause Anthropic told it to do that :-( https://news.ycombinator.com/item?id=49373083 https://news.ycombinator.com/item?id=49373083