Discussion about this post

User's avatar
Lakshmi Narasimhan's avatar

The diff-only refactoring point is underrated. When you're running AI agents against a large codebase, the default behavior is to rewrite entire files — which makes code review nearly impossible and introduces subtle regressions. Constraining the agent to diff-only output forces it to reason about minimal changes, and as a side benefit, it burns way fewer tokens.

I've been using this pattern with Claude Code on production repos: give it the specific function to modify, the constraint to only change what's necessary, and explicit instructions not to "improve" surrounding code. The output quality goes up dramatically when you narrow the scope.

No posts

Ready for more?