Skip to main content

Run Claude Code in a fix-break loop until your codebase is clean

Project description

  ███████╗████████╗ ██████╗██╗  ██╗
  ██╔════╝╚══██╔══╝██╔════╝██║  ██║
  █████╗     ██║   ██║     ███████║
  ██╔══╝     ██║   ██║     ██╔══██║
  ███████╗   ██║   ╚██████╗██║  ██║
  ╚══════╝   ╚═╝    ╚═════╝╚═╝  ╚═╝  loop

Run Claude Code in a scan-fix-break loop until your codebase is clean.


┌─ etch loop v0.2.0  . ───────────────────────────────────────────────┐
│                                                                      │
│  -  iteration  1                                                     │
│  +  scanner    issues found   src/auth.py:42 — no empty token check  │
│  +  fixer      committed      fix(edge): guard empty token in auth   │
│  x  breaker    issues         unguarded access still reachable       │
│                                                                      │
│  -  iteration  2                                                     │
│  +  scanner    issues found   src/auth.py:61 — missing None check    │
│  +  fixer      committed      fix(edge): null guard on session obj   │
│  >  breaker    running        ░░░░░░▓▒ ░░░░░░░░░░░░░░░░░░░░░░░░░░   │
│                                                                      │
├──────────────────────────────────────────────────────────────────────┤
│  iterations 2   fixes 2   breaker issues 1   1m 48s elapsed         │
└──────────────────────────────────────────────────────────────────────┘

install

uv tool install etch-loop

usage

etch init                        # analyze codebase with Claude, write prompt files
etch run                         # start the loop
etch run "the auth module"       # focus on a specific area
etch run -n 5                    # max 5 iterations
etch run --dry-run               # preview prompt, don't run
etch run --verbose               # show full Claude output

how it works

Each iteration has three phases: scan → fix → break.

  1. Scanner reads the codebase and outputs a specific list of issues — file paths, line numbers, descriptions
  2. If the scanner finds nothing, the loop stops
  3. Fixer receives the scanner's list and fixes those exact issues, then commits
  4. Breaker adversarially reviews the full codebase, looking for anything missed or newly introduced
  5. If the breaker finds nothing, the loop stops — clean pass
  6. If the breaker finds something, it's fed back to the next iteration's fixer
┌─ done ───────────────────────────────────────────────────┐
│                                                          │
│  iterations      3                                       │
│  fixes           3                                       │
│  breaker issues  1                                       │
│  elapsed         2m 44s                                  │
│                                                          │
└──────────────────────────────────────────────────────────┘

etch init

etch init runs Claude against your codebase before writing any files. It reads your source, detects the languages and structure, and generates three prompt files tailored to your project — no placeholders to edit.

┌─ etch init v0.2.0 ───────────────────────────────────────┐
│  >  analyzing  ░░░░░▓▒ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░   │
│  +  analyzed codebase                                    │
│  +  SCAN.md                                              │
│  +  ETCH.md                                              │
│  +  BREAK.md                                             │
└──────────────────────────────────────────────────────────┘

SCAN.md — tells the scanner what to look for and how to report findings.

ETCH.md — tells the fixer how to fix things: surgical, no refactoring, one fix per commit.

BREAK.md — tells the breaker to scan the full codebase adversarially and report anything that could go wrong.

All three files are editable. Use etch run "focus description" to narrow the scope without editing files.


requirements

  • Python 3.11+
  • claude CLI installed and authenticated
  • A git repository (etch-loop commits each fix automatically)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

etch_loop-0.3.2.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

etch_loop-0.3.2-py3-none-any.whl (23.0 kB view details)

Uploaded Python 3

File details

Details for the file etch_loop-0.3.2.tar.gz.

File metadata

  • Download URL: etch_loop-0.3.2.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for etch_loop-0.3.2.tar.gz
Algorithm Hash digest
SHA256 3a2db114ea33fcb86e09855fa998a06ae179e277915d2b8bef1ddbfb94842ca9
MD5 9ada82bca465f9a17c32a6fb6348f64b
BLAKE2b-256 dbf1f948e7fee0631ad0ad7d7967402fdb28c2c8083b9ba33171ec3f4ea481a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for etch_loop-0.3.2.tar.gz:

Publisher: workflow.yml on lauenborg/etch-loop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file etch_loop-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: etch_loop-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 23.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for etch_loop-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4055d6fa609479522d00db82e2b4526957fea2ffae5fe0feb712ae296f453966
MD5 4f258a8553c314d97d0ec8e22903cc7b
BLAKE2b-256 818e842688890a6b0d923e01920d0b668cd4e601e077f37494223cfe900d86e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for etch_loop-0.3.2-py3-none-any.whl:

Publisher: workflow.yml on lauenborg/etch-loop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page