I Made a CLI That Yells at Your Code Until It Gets an A

Dev.to / 4/29/2026

📰 NewsDeveloper Stack & InfrastructureSignals & Early TrendsTools & Practical Usage

Key Points

  • The article introduces a new CLI tool, `npx fix-hairball`, designed to repeatedly review and clean a codebase until it reaches an “A” quality grade.
  • The tool works by running an AI-driven quality check loop: it collects feedback from multiple AI reviewers, synthesizes the useful criticisms, parallelizes proposed fixes, applies them, and reruns tests/checks.
  • Its motivation is that AI coding often increases code clutter—adding redundant helpers, unnecessary compatibility shims, bloated tests, and unused abstractions—while not necessarily deleting or refactoring effectively.
  • The author frames the tool around a cleanup philosophy: keep code small, remove abstractions that only exist due to prior structure, and eliminate “legacy compatibility” added too recently.
  • The author notes that the CLI won’t make users better engineers, but it may improve repository quality and readability by intentionally performing the cleanup loop.

AI coding is great until your repo starts looking like it was assembled during a fire drill.

So I made this:

npx fix-hairball

It reviews your codebase, gives it a grade, fixes the worst parts, reviews it again, and keeps going until it gets an A.

Basically:

D -> C -> B -> A

but with more terminal output and fewer feelings.

Why?

Because AI agents love writing code.

They do not always love deleting code.

They will happily create:

  • a helper for the helper
  • a compatibility shim for code written 11 minutes ago
  • a 700-line test file
  • three “shared” abstractions used once
  • a function named like it has a mortgage

fix-hairball exists to run the cleanup loop on purpose.

What It Does

Under the hood, it runs:

npx commands-com quality --until A

It asks multiple AI reviewers what is wrong, synthesizes the useful complaints, splits the fixes into parallel tasks, applies them, runs checks, then does it again.

Very glamorous.

Mostly it deletes things.

The Philosophy

If code can be clean in 50 lines, it should not be 200.

If an abstraction exists only because yesterday’s abstraction got lonely, it should go.

If the repo has “legacy compatibility” for something created this morning, everybody needs a walk.

Try It

npx fix-hairball

It will not make you a better engineer.

But it may make your repo look like one was involved.