AI Coding Agents Can Only Add Code? Dev Shares Refactoring Workarounds
julianharris · x · 2026-08-01
Developer Julian Harris shares his practical experience regarding the observation that AI coding agents are often "add-only." He notes that the only time he successfully gets an AI to refactor is by using a two-step strategy:
- DELETE existing code: Force the relevant tests to fail.
- Implement new features: With the old code gone, the AI has nothing to link to and is forced to build the new implementation from scratch.
He quotes a tweet from developer Victor Taelin to illustrate the point: when asked to remove an unnecessary function, the AI stubbornly refused, inventing justifications for why it was needed. This highlights the current limitations of AI coding tools in understanding and cleaning up complex code logic.
More from coding & agent
- Hands-on Comparison: GPT-5.6 Excels at Code Maintenance, Claude at Greenfield Coding — iskander · 2026-08-01
- LangChain Introduces ReviewBench: A Benchmark for Code Review Agents — LangChain · 2026-08-01
- Neocarta Open Source: Solving Upstream Pain Points for Text-to-SQL Agents — JeremyCMorgan · 2026-08-01
- Hands-on Tutorial: Build an Observable Job Search Agent with LangGraph — dl_weekly · 2026-08-01
- LangChain Launches ReviewBench: A Benchmark for Code Review Agents — LangChain · 2026-08-01
- GitHub Trending: A Curated Repository for AI Automated Research Lifecycle — tom_doerr · 2026-08-01