LLMs write code that accretes: duplicated blocks, dead files, stale docs, structural sprawl. CodeEraser measures it, judges it, and gates it with a score that is only allowed to get better.
$ ce check --roast check score 925/1000 | axes 0:64 1:0 2:298 3:0 4:0 5:0 6:165 | 564 candidates ratchet: 0 added, 0 removed, 0 over, 0 tolerance drawn -> pass note: 10 blocks collapsed into existing members, 314 intra-file pairs off the sim table roast: suspiciously clean. who did you pay?
Real output: CodeEraser judging its own repository. The ratchet only shrinks: every violation is banked in a baseline, and new entropy fails the gate.
| Without CodeEraser | With CodeEraser | |
|---|---|---|
| writes refused before they reached disk | 0 | 2 |
| duplicate clone blocks left behind | 4 | 0 |
| duplicated doc segments | 1 | 0 |
| removals still owed | 1 | 0 |
| check score | 871 | 979 |
One seven-step task, two identical copies of the seed; the only variable is whether CodeEraser is in the loop — the write-time guard, the Stop audit, and, once the audit refuses, the eraser acting on its own plan. Both runs still end red — not on the same things.
The seed is demo/seed/, a small cent-exact invoicing service in Python and TypeScript, measured clean by the same gates before either run; the task adds discounts, a compact report, CSV and JSON output, and money formatting in the API.



ce join prints.GitHub Releases: GUI + CLI + core, five platformsbrew install skymanbp/codeeraser/codeerasercargo install codeeraserce setup # or /plugin marketplace add skymanbp/CodeEraser@releasece update --yesce update swaps ce and ce-core only after both SHA256 pins verify; the GUI has its own update screen.
ce setup, AppImage / dmg users run it oncece update compares the latest tag against this build (exit 0 / 1 / 2); --yes replaces ce and ce-core after both SHA256 pins verify (never a copy the plugin or cargo owns, which name their own update), and --installer saves the verified GUI installer. The GUI has an update screen; in Claude Code, /codeeraser:update.
ce check . --fail-under 911 # ratchet + floor; exit 1 turns the pipeline redce precommit # staged net LOC + touched duplicatesce mcp # every report family as a read-only tool for any agentThe gate. One 0–1000 score over seven axes, a shrink-only ratchet against the banked baseline, and a hard floor for CI.
T1/T2 clone detection via winnowing fingerprints, with a clone-block budget your repo can only ratchet down.
T3 near-clones judged by tree edit distance in the Haskell core, renamed and reshaped copies included.
Liveness verdicts on the cached reference graph: no kept in-edge and no entry flag means dead, and the gate says so.
Beside it, the unmentioned-declaration advisory, which never reddens a gate.
Duplicated prose across docs and comments, judged by exact Jaccard over live segments.
Tree-scale entropy: layout divergence, doc staleness, redundancy and modularity axes over the whole repository.
Size, complexity and readability per file and function, the classic metrics core-graded against the global table or the file's own [[rules.class]] lines.
Your score across mainline history, cached per commit, rebuildable, honest about direction.
The deterministic two-phase eraser: dead files, verbatim document twins and whole-unit exact clones.
Planned first, applied only from a clean worktree, never by asking a model to rewrite code.
Change heat over a git window, attributed per unit, so you see how much of a file is being rewritten rather than added to.
The three-signal join: churn, duplication and liveness folded into one verdict, so a hot duplicated dead corner names itself.
The same-role advisor: integer BM25 over term bags the index already holds, with the core deciding which candidates play the query's role.
A deterministic offline retrieval, advice only, never a gate.
A Datalog over the index’s own facts: ask a question and every answer comes with its derivation; write architecture constraints as assertions and ce rules is a gate that exits on the first violation.
Judged in the core, labelled back by the CLI.
Dead code inside one function: statements no path reaches, stores no path reads, locals nothing reads.
The core walks the control-flow graph; a finding is a verdict only in a language whose blind-reviewed precision exam passed, and an unused parameter is always advice.
How a clone group would fold into one function: the places its members differ become parameters, and the core answers the parameter count, the member worth keeping, the lines saved, and feasible or why not.
Advice only, never a gate.
How the directories depend on each other: the layers, the cheapest arcs to cut out of their cycles, the file clusters and the files outside their cluster's directory, each directory's fan-in, fan-out and instability, and what a change to a named file reaches.
Advice only, never a gate.
As a Claude Code plugin: duplicate writes intercepted at the moment of writing, a write you let through at ask recorded once it lands, audits at stop, health at session start.
Every verdict is integer or exact-rational arithmetic over measured facts, and every rule is cited to the line that implements it. One rule per row, each linked to its derivation.
t = window + kgram - 1 = 26 + 25 - 1 = 50 tokens
cloneDecidesWith (num, den) t n1 n2 = (mx - t) * den >= num * mx where mx = max n1 n2score = max 0 (scoreScale - raw `div` (violCostNeutral * wTotal)) tolerated(c) = max (c * tolNum `div` tolDen) (c + tolAbs)
50 ms907 ms650 ms0.00 per 500 edits17/17 scoped (100%)Every number is produced by replay (cli/tests/it/bench.rs and bench_backfill.rs) from one source, contracts/bench/bench.json — never hand-filled.
Complete evaluation dashboard →
docs/diagrams/architecture.en.json; every component cites its source files. Open the full-size SVG.Open the component-level stack and its enforcement map →
All fifteen release binaries (five platforms × ce / ce-core, plus the five
GUI installers) are pinned by SHA256 in plugin/bin/manifest.env;
the tag phase verifies every pin, waits for a green CI on the tagged commit, and refuses
an unexpected asset before anything publishes. SHA256SUMS covers the set for
offline checking. Code signing is deliberately out of scope; the hash chain is the permanent
anchor. This repository gates itself with its own tool on every commit.