The housekeeper loop

A conservative code-project cleanup that proves one small opportunity is safe, makes the smallest useful change, and keeps it onl…

Eric Lott 2.2k updated 1mo ago
Claude CodeGeneric
View source ↗

A conservative code-project cleanup that proves one small opportunity is safe, makes the smallest useful change, and keeps it only after existing checks pass.

Use when

Use this when a code project has accumulated small maintenance problems—unused code, stale files, duplicated logic, broken links, old comments, inconsistent names, or confusing organization—but broad deletion would be risky.

The loop

Review [repository or code project] for dead code, meaning unreachable or unused code; stale files or comments; unused dependencies; duplication; broken links; inconsistent names; and confusing structure. Protect unrelated, active, uncommitted, generated, and uncertain work. Prove one low-risk cleanup, make the smallest coherent change, then rerun the build, tests, runtime checks, and diff review. Keep only verified improvements. Stop when none remain, progress stalls, verification is unavailable, or approval is required. Return changes, evidence, and deferred candidates.

Steps

  • Inspect the current code-project state and identify active branches, uncommitted edits, generated files, configuration, and other work that must not be disturbed.
  • Collect possible cleanups, then use code references, configuration, documentation, tests, or runtime behavior to prove one candidate is genuinely low risk.
  • Make the smallest useful change and run the existing build, tests, application checks, and diff review; keep it only when behavior stays intact and no unrelated work changes.
  • Repeat until no confirmed low-risk cleanup remains, progress stalls, verification is unavailable, or the next candidate needs approval.

Verification

No confirmed low-risk cleanup remains, and existing behavior still passes. Every retained cleanup is supported by direct evidence, relevant builds and tests pass, the application still runs where applicable, unrelated work is untouched, and uncertain candidates are deferred rather than deleted.

Why it works

One proven cleanup at a time keeps the work easy to review and undo. Requiring evidence before deletion—and protecting uncertain files and edits—prevents a tidy-up pass from removing code that is active but poorly understood.

Maintain The housekeeper loop?

Let people know it's listed here — add the badge (live metrics, light/dark aware) or a plain link to your README or docs.

The housekeeper loop on getagentictools
[![The housekeeper loop on getagentictools](https://getagentictools.com/badge/loops/housekeeper-loop.svg)](https://getagentictools.com/loops/housekeeper-loop?ref=badge)