frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

AI Agents and the Refactoring That Never Happens

https://www.rosenfeld.page/articles/programming/2026_09_02_ai_agents_and_the_refactoring_that_never_happens/
12•rosenfeld•55m ago

Comments

dgellow•39m ago
> AI agents don’t get lost

Thats… not my experience. Like, not at all. They very regularly get lost

Sivart13•33m ago
> 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.

dgellow•4m ago
They also very often do not actually read the fucking files! Even after specifying to „read in full the fucking files“. LLMs are so lazy, they take any shortcut they can.

Sorry, just thinking about it is reviving my frustration…

simonw•32m ago
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.

rafaelRiv•26m ago
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)

simonw•16m ago
Does that code at least come with tests?
Kiro•11m ago
I've never met a single developer saying refactors are easy. It's always a minefield.

In the only scenario where that could actually be true you wouldn't have coworkers creating unmaintainable code with LLMs now.

teaearlgraycold•23m ago
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.

beastman82•32m ago
I've had the opposite experience where we're refactoring the gnarliest shit anyone's ever seen because AI can actually understand it well enough to decompose, test, refactor, etc.
glaslong•24m ago
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.

_superposition_•24m ago
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.
taude•21m ago
I don't know, our backlog of refactoring, before AI, never really happened either.

I've yet to work at a place that bothered with much refactoring over adding the thirtieth conditional to new feature....

moezd•19m ago
AI agents get lost all the time, particularly if the codebase is already sprawling out of control.

Your discipline only pays off if you already understand your code and/or established clear baseline for your standards before launching into a feature development mania. And it needs to be enforced every turn, or the firehose of code generation knocks the front door down easily.

joshstrange•10m ago
Meanwhile I'm over here refactoring as much as I can from years (or decades) of human-slung code. Turning the mess I either inherited, helped create, or built on top of into something clean and pristine might be my favorite LLM use. Same for personal projects, codebases that evolved over many years when I happened to have time that weren't kept quite as "clean" as I wish that finally been cleaned up.

I've always _wanted_ my code to be clean and easy to follow but life, deadlines, shifting-priorities, etc have stood in the way of that. Now I can finally realize my personal nirvana.

That said, I've had to steer models away from too-heavy of abstraction or similar because it made the code too hard to follow.

_fat_santa•2m ago
I've personally adopted doing multiple refactoring passes after any large code implementation done by AI. In pretty much any scenario where I'm adding code using AI, it's 1 turn to add the feature and and then another 4-5 turns to refactor and clean everything up.

Often times it's not even that the code is bad but rather that it's overengineered. I see it happen so much that I'm tempted to actually go the other way on a toy project. Like what would Claude or Codex come up with if I told it I wanted an enterprise grade, globally scalable, compliant and auditable tic-tac-toe game.

What's My Number?

https://drorspei.com/whatsmynumber/
1•henrydark•25s ago•0 comments

I rented a car, and within hours my driver's license was for sale

https://arstechnica.com/security/2026/09/my-drivers-license-is-one-of-153-million-for-sale-on-a-n...
1•chha•1m ago•0 comments

Chinese Cars Could Be Huge in U.S., and That's the Problem, Officials Say

https://www.nytimes.com/2026/08/31/business/chinese-cars-us-sales-ban.html
3•bookofjoe•2m ago•1 comments

Assault Rifle in an Open-Cockpit Plane: Ukraine's Unlikely Drone Hunters [video]

https://www.youtube.com/watch?v=gBxQixJfOzk
2•JumpinJack_Cash•2m ago•0 comments

Finger: The 1971 Social network that never died

https://en.andros.dev/blog/54572bc7/finger-the-1971-social-network-that-never-died/?_hsenc=p2ANqt...
1•rmason•3m ago•0 comments

New things for regular expressions in PostgreSQL: pg_tre and pg_re2

https://www.depesz.com/2026/08/25/new-things-for-regular-expressions-in-postgresql-pg_tre-and-pg_...
1•fanf2•4m ago•0 comments

Pushing the Limits of Serving DeepSeek-V4-Pro

https://www.lmsys.org/blog/2026-08-19-deepseek-v4-pro-engine-optimization-h20/
1•gmays•5m ago•0 comments

How A Tweet Changed My Life

https://hugorcd.com/writing/how-a-tweet-changed-my-life
1•rmason•5m ago•0 comments

Woman Who Exposed FBI Official for Working with Russian Oligarch Found Dead

https://www.newsweek.com/allison-guerriero-michael-mcgonigal-fbi-exposed-working-russian-oligarch...
4•1e1a•7m ago•0 comments

Show HN: Mousetrapped: Cursor Recovery Utility for macOS- Open Source

https://github.com/uncSoft/Mousetrapped
1•uncSoft•8m ago•0 comments

Why Is Staff Scheduling Hard?

https://www.mjc2.com/staff-planning-complexity.htm
1•dualarte•9m ago•0 comments

Svelte Custom Renderers

https://svelte-custom-renderers.com/
1•dabinat•11m ago•0 comments

Show HN: AlparAI – Autonomous Swarm OS with Quantum Verification

https://www.alparai.com/en
1•ercumenterden•11m ago•0 comments

Vidact – a compiler that turns React into direct DOM operations

https://www.vidact.dev/
1•mohebifar•12m ago•0 comments

Show HN: AI coach that adapts workouts and meals to your injuries and

https://rizin.app/
1•wowinter15•12m ago•0 comments

The Death of Educational Content on YouTube (Fern) [video]

https://www.youtube.com/watch?v=-Gnrp_caPvo
1•K3UL•13m ago•1 comments

RonanRX (YC S26) – Full Stack Pharmaceutical Company for Personalized GLP-1s

https://ronanrx.com/
1•lloydarmbrust•13m ago•1 comments

The First Pancake (2021)

https://www.gkogan.co/first-pancake/
1•gk1•14m ago•0 comments

The Ceiling Was Never the Model

https://www.pinecone.io/blog/the-ceiling-was-never-the-model/
1•gk1•14m ago•0 comments

Wise Application to Charter a Subsidiary National Trust Bank [pdf]

https://www.occ.gov/topics/charters-and-licensing/interpretations-and-decisions/2026/cd1381.pdf
1•toomuchtodo•16m ago•0 comments

Show HN: Local business leads, one API call away

https://sensecollect.com
1•chrislxy•17m ago•0 comments

MapQuest is now the No. 1 U.S. app after bucking Trump's 'Lake America' renaming

https://techcrunch.com/2026/09/02/mapquest-is-now-the-no-1-u-s-app-after-bucking-trumps-lake-amer...
2•speckx•21m ago•0 comments

Pedagogical Provinces in Dangerous Times

https://peterberard.substack.com/p/pedagogical-provinces-in-dangerous
1•EthanHeilman•21m ago•0 comments

Disclosure Pilot AI

https://github.com/p-dirac/disclosure-pilot-ai
1•p-dirac•21m ago•0 comments

Lean AI Formalization Leaderboard

https://lean-lang.org/eval/legacy/
1•frozenseven•22m ago•0 comments

`Co-Authored-By: Claude Opus 5` contradicts this being a hand-written manifesto

https://github.com/jimmitchell/indiewebispunk.net/issues/1
2•speckx•25m ago•0 comments

Copy Remote File Contents to Local System Clipboard with OSC 52

https://anandprashant.com/posts/copy-remote-file-contents-to-local-system-clipboard-with-osc-52
1•primaprashant•25m ago•0 comments

Made a free tool that shows any Reddit user's history, deleted and removed posts

https://deletedby.com
2•Mobile-Spread•26m ago•1 comments

Music Theory for Programmers

https://runjs.app/blog/music-theory-for-programmers
2•birdculture•27m ago•0 comments

1Password wades into a right-wing mess after funding a Linux project

https://www.theverge.com/tech/988536/1password-dhh-linux-controversy
11•cdrnsf•27m ago•0 comments