frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Ask HN: How do you get coding agents to clean up after changing direction?

3•BearBest•59m ago
I've noticed the same failure mode across most coding agents.

When an implementation runs into a problem, such as a function not meeting the requirement, the agent often writes a replacement. If the overall approach changes, it starts a new path. If only a detail needs adjustment, it may add another helper or class.

What it rarely does is remove the code and data definitions added for the abandoned approach. After a few iterations, the result may work, but it contains stale branches, unused helpers, redundant logic, and fields that no longer serve a purpose.

I've started thinking this needs an explicit project-level rule for agents responsible for implementation and fixes:

``` After changing an implementation approach or fixing an issue, review the code logic and data definitions touched by the change. Keep only items that are still required. Remove unused functions, redundant logic, and data fields that are no longer needed. ```

A git-commit skill can be a useful trigger for this check, but the cleanup should remain part of the implementation process rather than the responsibility of a commit skill.

How are others handling this? do you add an explicit cleanup phase after each correction, enforce it during review, or rely on tooling to catch the leftovers?

Comments

quietraster•6m ago
direction changes leave so much agent debris behind. has a cleanup checklist worked better than another agent pass?

Gemini for Go Developers: Building Agents in Go

https://danicat.dev/posts/gemini-for-go-developers-part-3-building-agents/
1•eigenBasis•6m ago•0 comments

iCloud+ Includes Apple TV, Arcade, and Curated Music Stations in 100 Countries

https://www.macrumors.com/2026/09/15/icloud-plus-includes-apple-tv-arcade-100-countries/
1•calme_toi•6m ago•1 comments

Omarchy ships its own Linux kernel in v4.0.4

https://github.com/omacom/omarchy/releases/tag/v4.0.4
2•djfergus•8m ago•0 comments

Organizing Context in a Multi-Agent Harness

https://www.langchain.com/blog/organizing-context-in-a-multi-agent-harness
1•gemanor•8m ago•0 comments

Never-again – so your AI agent stops repeating mistakes you fixed

https://github.com/malaysherasia-ai/claude-never-again
1•malaysherasia-a•9m ago•0 comments

There is NO realistic scenario where AI wipes out all of humanity

https://twitter.com/RichardSocher/status/2099889673153683766
1•tosh•10m ago•1 comments

Senate Blocks Cryptocurrency Regulation

https://www.latimes.com/world-nation/story/2026-09-15/senate-blocks-cryptocurrency-regulation-as-...
3•1vuio0pswjnm7•13m ago•0 comments

A backtest can pose a question its own data cannot answer

https://research.creativebyzuniga.com/rsi2/
1•CilantroCo•13m ago•0 comments

Potemkin Understanding in Large Language Models (2025)

https://arxiv.org/abs/2506.21521
1•mpweiher•13m ago•0 comments

Text Recognition techniques for premodern Italian and Devanāgarī manuscripts

https://uniqueatpenn.wordpress.com/2026/09/11/2025-2026-sims-fellows-applying-escriptoriums-handw...
1•bryanrasmussen•18m ago•1 comments

A Super-Accurate Clock Using a Tiny Microcontroller

https://hackaday.com/2026/09/15/a-super-accurate-clock-using-a-tiny-microcontroller/
2•fork-bomber•19m ago•0 comments

The structure and lasting impact of the Roman road system

https://www.nature.com/articles/s41467-026-75453-3
4•geox•23m ago•0 comments

Jev means structured output is interesting again

https://www.seangoedecke.com/jev-means-structured-output-is-interesting-again/
3•dondraper36•23m ago•0 comments

Qwen3.8 Max – Cost per task higher than Astra on Artificial Analysis

https://artificialanalysis.ai/models/qwen3-8-max
1•mydreamof•27m ago•1 comments

COBOL dev won .NET hackathon with help from AI

https://www.theregister.com/ai-and-ml/2026/09/15/cobol-dev-won-net-hackathon-with-help-from-ai-an...
3•theanonymousone•28m ago•1 comments

Valeriepieris Circle

https://en.wikipedia.org/wiki/Valeriepieris_circle
1•edward•32m ago•0 comments

Show HN: Point at anything in your app, say what you want, get a spec

https://dhamark.com/try
1•Femina•33m ago•0 comments

Show HN: LaunchPad – I built a Launchpad to replace macOS Apps

1•zhangchioulin•34m ago•0 comments

UK mathematician debunks myth around Parthenon's optical illusions

https://www.theguardian.com/science/2026/sep/16/uk-mathematician-debunks-myth-parthenon-optical-i...
1•trocado•36m ago•0 comments

The Gap Will Grow

https://backnotprop.substack.com/p/the-gap-will-grow
1•ramoz•38m ago•0 comments

The secret formula for Apple's rounded corners (2023)

https://arun.is/blog/apple-rounded-corners/
1•guynamedloren•39m ago•0 comments

Dense vs. Moe Models: Active Parameters, Throughput, and When to Choose Each

https://developer.nvidia.com/blog/dense-vs-moe-models-active-parameters-throughput-and-when-to-ch...
1•pretext•39m ago•0 comments

Nightmare Eclipse revelaved his identity

https://twitter.com/MSNightmare2000/status/2099381382925447545
1•croes•39m ago•0 comments

Secret Life of Circuits – Illustrated Guide to Electronic Circuit Design

https://nostarch.com/secret-life-of-circuits
2•alibarber•42m ago•0 comments

Sanders: "If AI is coming for workers, it should bring a 4-day workweek with it"

https://fortune.com/2026/09/15/bernie-sanders-ai-four-day-workweek-bill/
2•Markoff•45m ago•1 comments

Ask HN: How do you test an app from a region you're not physically in?

1•Stranger5901•47m ago•1 comments

Attribution-Based Control in AI Systems

https://attribution-based-control.ai/
1•handfuloflight•50m ago•0 comments

Why WordPress Is Still the #1 CMS in 2026

https://wpaudit.cc/blog/why-wordpress-is-the-worlds-number-one-cms-2026/
1•mysticmetal•53m ago•0 comments

Apple M5 Ultra Geekbench

https://browser.geekbench.com/v7/cpu/354092
2•7777777phil•55m ago•0 comments

Roundtables: Could AI kill us all?

https://www.technologyreview.com/2026/09/15/1143936/roundtables-will-ai-really-kill-us-all/
1•joozio•56m ago•0 comments