← Reddit

Stuck in a loop of audits and refactors

Reddit · zndr-cs · May 9, 2026
A developer of a 20,000-line self-hosted procurement tracker has entered a cycle where using AI tools to audit the codebase and subsequently fixing identified issues only results in new problems emerging in the next audit. The developer questions whether this endless loop of refactoring represents genuine architectural debt or whether the AI is generating spurious findings that do not actually require remediation.

Detailed Analysis

A developer maintaining a self-hosted procurement tracker of approximately 20,000 lines of code has surfaced a widely relatable problem in the r/ClaudeAI community: the phenomenon of infinite audit loops when using large language models like Claude and OpenAI's Codex for iterative code review. The user describes a cycle in which each round of AI-generated findings is addressed, only for the next audit to surface a fresh batch of concerns — consistently framed in language suggesting real but manageable debt, such as "solid foundation, but carrying real organizational debt in component sizing, state management, and access control consistency." The post captures both the genuine utility and the structural limitation of applying generative AI to open-ended quality evaluation tasks.

The core dynamic at play reflects a fundamental property of how LLMs approach code review: they are optimized to find and articulate problems rather than to converge on a state of completeness. A 20,000-line codebase of sufficient complexity will always present opportunities for re-characterization — components that were appropriately sized in one architectural frame can be described as oversized in another, and state management patterns that satisfied one audit criterion may fall short of a different heuristic surfaced in the next pass. This is not necessarily hallucination in the technical sense, but rather a kind of analytical drift, where the model surfaces legitimately observable patterns without a stable, project-specific definition of "good enough" against which to measure them. The absence of a fixed target means the audit process has no natural termination condition.

The community response to posts like this one frequently distinguishes between two failure modes: genuine architectural debt that warrants remediation, and cosmetic or theoretical debt that carries no meaningful impact on functionality, maintainability, or performance in the actual deployment context. For a self-hosted internal tool — as opposed to a public-facing, multi-team product — many of the concerns that LLMs reliably surface, such as component granularity or access control consistency, may represent best practices for large engineering organizations that simply do not apply at single-developer scale. Claude and similar models are trained on a broad corpus that skews toward enterprise and open-source conventions, which can cause them to evaluate hobbyist or small-scale codebases against standards that are contextually mismatched.

This situation also points to a broader challenge in the productization of AI coding assistants: the lack of a persistent project context and acceptance criteria means each audit session is effectively stateless with respect to prior remediation work. The model does not "know" that the state management issue it flagged in a previous session was addressed and consciously deemed sufficient — it re-evaluates from first principles each time. This is a product design gap that several AI coding tool developers are actively working to address through persistent memory, project-level configuration, and the ability to define and lock in architectural decisions as explicit constraints. Until such mechanisms mature, developers who use LLMs for iterative code health work benefit from establishing their own written standards document that they feed back into each audit session, effectively giving the model a fixed target rather than allowing it to generate its own.

The broader trend this post reflects is the growing tension between AI tools' capacity to surface infinite incremental improvements and the finite human capacity to evaluate, prioritize, and act on them. As LLMs become more deeply integrated into development workflows, the risk of what might be called "AI-induced refactor paralysis" — where the sheer volume and continuity of machine-generated suggestions displaces productive forward development — is an emerging and underexamined cost. The value of Claude and similar tools in code review contexts is real, but is most effectively realized when bounded by human judgment about scope, deployment context, and the diminishing returns of successive optimization cycles.

Read original article →