Live data from Hacker News

AI Agents and the Refactoring That Never Happens

rosenfeld.page

1–10 of 76 posts

Re: AI Agents and the Refactoring That Never Happens

#4
> Here’s the problem. AI agents are not bound by human context limits in the same way. An agent can read the tangled function, trace every caller, and make sense of the mess that would have stopped a human cold. It can add the next branch correctly, and the one after that, working confidently inside code that no human on the team fully understands anymore.

They're not bound by the same limits but they're still bound by some limits, yeah?

I'm not an AI expert, so I don't honestly understand why LLM driven agents are as good as they are. But my impression is "trace every caller", most of the time, is still an approximation. Once the code has gotten convoluted enough, cases are going to get dropped.

Re: AI Agents and the Refactoring That Never Happens

#5
I've found that access to coding agents has helped me be far less tolerant of bad code patterns that can be refactored.

Refactoring used to have a very real cost - it was substantial amounts of time that would have to be carved away from working on new features.

Now I can spot a potential refactor, fire off a prompt in an asynchronous coding agent (or on a worktree or whatever), then come back 20 minutes later and either accept it, poke it a bit, or abandon it. Costs me almost nothing.

Re: AI Agents and the Refactoring That Never Happens

#7
post #5

I've found that access to coding agents has helped me be far less tolerant of bad code patterns that can be refactored. Refactoring used to have a very real cost - it was substantial amounts of time that would have to be carved away from working on new features. Now I can spot a potential refactor, fire off a prompt in an asynchronous coding agent (or on a worktree or whatever), then come back 20 minutes later and ei…

And for me, it has created a giant pile of unmaintainable code from my coworkers because of stupid management people that think they can code.

Refactoring was never a substantial amounts of time for me before llms. Before I could spot a potential refactor and refactor it in 20 minutes and less. Never abandon it. Just constant improvement to the point the previous tech startup that I was working for just drive from itself (I am still paid a a few hours per months for it)

Re: AI Agents and the Refactoring That Never Happens

#8
I find the basic premise for low level code quality to be true, in my experience, but counterintuitively I can now police the overall structure and system architecture MUCH more heavily.

As ever, no one is willing to allocate time for this, but (with unlimited work tokens) I can parallel path massive cleanup refactors all the time now.

Re: AI Agents and the Refactoring That Never Happens

#9
This is pretty spot on imo. Although otoh I feel like I don't need to be able to reason as deeply about a system because of the ability of an agent to dig through a code base. Personally I believe I'm still looking for that new balance. It's a little like driving a car in a neighborhood you know, vs one where you constantly need to be looking down at a map or gps. It's much more comfortable driving around the places you're familiar with, but you can't know everywhere.

Re: AI Agents and the Refactoring That Never Happens

#10
post #5

I've found that access to coding agents has helped me be far less tolerant of bad code patterns that can be refactored. Refactoring used to have a very real cost - it was substantial amounts of time that would have to be carved away from working on new features. Now I can spot a potential refactor, fire off a prompt in an asynchronous coding agent (or on a worktree or whatever), then come back 20 minutes later and ei…

All sorts of efforts that used to be put off indefinitely can now be handled largely by LLMs. Yesterday I took a codebase (~50 source files) and spawned a sub-agent (GLM 5.3 Flash) for every single file. Each file was analyzed for test coverage issues, inconsistencies between comments and implementations, and all call sites against the implementation. Then issues were aggregated. I reviewed the list manually, had Opus and K3 review as well to prune the list, and then had a commit made for every minor issue found. 70 commits with maybe 30 minutes of manual work.

Not exactly a refactor, but high degrees of consistency are what I strive for in a codebase. LLMs get confused by inconsistencies, as do humans.

Post reply on HN