4 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 28d 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 28d 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 28d 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 28d 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 28d 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 28d agoWhat does this question have to do with the linked article?
- Neywiny 28d 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 27d 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 27d 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 28d agoActually, yes. Probably this https://github.com/anthropics/claude-code/issues/88041#issuecomment-5385012523 https://github.com/anthropics/claude-code/issues/88041#issue...
- nullbio 28d 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 28d agoYou are attributing too much agency. They just vibe code the thing and hope for the best probably.
- k4rli 28d agoThe comments there just seem like agents talking to each other.
- worldsavior 28d 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 28d agoThe comments on this issue are unbearable.
- mavamaarten 28d 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 28d agoI have a hook that auto-denies when it sees 'python -c "', ' awk ', ' sed ', and '&&'
- mavamaarten 27d agoAnd find --exec too.
- IgorPartola 22d agoIt can still invoke them in subagents and does this.
- chris_money202 28d agoFunny enough this gets around content exclusion filters my company has set (for things like missing copyrights), so i actually like it
- 0x457 28d 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 28d agoBecause Anthropic told it to do that :-( https://news.ycombinator.com/item?id=49373083 https://news.ycombinator.com/item?id=49373083