SuperAPIAI Directory

CodeEraser

github.com · AI coding

CodeEraser is a deterministic tool for suppressing the uncontrolled proliferation of code and documentation in LLM-assisted programming. It rejects writes that duplicate code or make files too long before they are written to disk, and provides scanning, scoring, CI gating, and pre-commit checks. It supports code in thirteen languages including Python, TypeScript, Rust, and Go, as well as duplicate detection for Markdown and HTML documents. It is available in multiple forms: CLI, GUI, Claude Code plugin, pre-commit, and CI, and never calls any model throughout.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

CodeEraser is positioned as "an eraser against the code and documentation entropy increase caused by LLMs." It targets the drift problems common in LLM-assisted codebases: the same function written twice, the same paragraph pasted into three files, files that only grow and never shrink. Its core idea is to reject writes that would cause these problems before they land on disk, and the entire judgment process introduces no model.

Main capabilities

  • Write-time clone guard: if a write copies code that already exists in the code tree, the write is rejected, and the rejection message identifies the duplicated region.
  • File length guard: if a write makes a file exceed 750 lines, it is rejected; for files already over that line count, writes that do not increase length are allowed, so files can be split up gradually.
  • Document duplicate detection: for document duplicates that remain after rewriting, judgment uses 5-word shingles, Jaccard ≥ 0.80, or 50-word verbatim contiguous fragments.
  • Near-duplicate clones: candidates are produced by MinHash/LSH, then judged by the core using tree edit distance TSED ≥ 0.85.
  • Liveness analysis: a reference graph is built according to the per-language parsing ladder, four categories of verdicts and confidence codes are given, and unreferenced files are listed.
  • Gate scoring: 0–1000 points, representing the proportion of lines in the code tree not named by any finding; seven axes can name lines (size, complexity, clones, document duplication, unreferenced, change frequency, circular dependencies), six are counted by default, and the unreferenced axis is counted only when named in the configuration; subject to the ADR-006 ratchet constraint of only shrinking and not growing, growth must satisfy max(+2%, +10 lines) or a named rebuild.
  • Other capabilities include same-role suggestions, Datalog queries and rules, dead code within functions, merge suggestions, architecture and structure axes, tombstone remnants, erasure, and more.

Supported languages AST judgment uses twelve tree-sitter grammars, covering Python, TypeScript/TSX, Rust, Go, Haskell, C, C++, Java, Lua, R, Markdown, and HTML (thirteen language codes in total); JS, CSS, Vue, Svelte, shell, and YAML are only size-judged; .txt is only document-duplicate-judged. T4 clones are not within the promised scope.

Usage

  • Installers: five GUI installers (NSIS / AppImage / dmg) are provided per version, bundling the GUI, ce, and the ce-core judgment core; the Windows installer will run ce setup (AppImage / dmg users must run it manually once), used to integrate with Claude Code. The fifteen artifacts are deliberately left unsigned; verify them with sha256sum -c --ignore-missing SHA256SUMS.
  • Homebrew / winget: brew install skymanbp/codeeraser/codeeraser; winget install skymanbp.CodeEraser (available after the winget-pkgs merge).
  • Claude Code plugin: /plugin marketplace add skymanbp/CodeEraser@release, then /plugin install codeeraser@codeeraser.
  • CLI-only or building from source: place ce and ce-core side by side in PATH; cargo install codeeraser builds only ce, while ce-core must be obtained from a release or built with GHC 9.14.1 + cabal; ce looks up the core in the order CE_CORE_BIN → sibling ce-core → PATH, with --core <path> taking precedence.
  • Update: ce update checks the latest release and replaces the binaries with pinned versions in two phases (--yes).
  • Output defaults to English; switch to Chinese via --lang zh, CE_LANG=zh, or [ui] lang = "zh"; [[rules.class]] in ce.toml can set line counts and ratchet tolerances separately for a given glob set.

Three forms Every capability reaches the CLI, the GUI, and the plugin with the MCP server at the same time; otherwise it is a named omission; the face_parity gate derives these sets from the code.

Tech stack Rust 1.94.1 (edition 2024): tree-sitter 0.27 with twelve grammars, rusqlite 0.40 (index schema 17 / GRAPH_REV 28 / MENTION_REV 4), one daemon per project. Haskell (GHC 9.14.1): ce-core carries all judgment families. Tauri 2: the GUI is built on the same crate. The unified wire is NDJSON over stdio (proto 10.0.0, sixteen families); the daemon uses its own protocol (2.4.0).

Use cases Suited to teams that write code with LLM agents and want to prevent duplicate code and file bloat; it can intercept at write time, reject merges in CI, have the Stop audit reject turns under [guard] mode = "deny", and have pre-commit reject commits (by default both only log and do not reject).

Limitations and caveats

  • PreToolUse shapes behavior but is not a security wall: shell writes can bypass it; CI and the Stop audit in deny mode are the backstop. Probes match writes against the index's current state and do not refresh the index; files created or modified outside Write/Edit become duplicate sources on the next full run. Hooks fail open and log a degradation on internal errors or when the hook envelope exceeds 4 MiB.
  • Advice rather than adjudication: symbol-level liveness, ce similar, ce merge, and ce arch never fail the gate; guard-type checks stay in observe until they have their own false-positive record.
  • Scoring is by line rather than by finding count; the same line named by multiple findings counts only once; unreferenced does not mean unused, and by default it is only listed and does not fail, nor does it constitute permission to delete; ce erase does not delete whole files, only erases byte-for-byte identical document fragments.
  • Scores are not comparable across switches of [[rules.class]], named rebuilds that move softLine, and specific versions (v0.7.3 → v1.0.0, v1.2.0 → v1.3.0, v1.3.x → v1.4.0, v1.6.0 → v1.7.0, v1.7.4 → v1.8.0, v1.8.0 → v1.9.0, v1.9.x → v1.10.0, v1.10.1 → v1.10.2; 1.9.1/1.9.2 are comparable with 1.9.0, 1.10.1 with 1.10.0, and 1.10.3 with 1.10.2).
  • Releases build five targets; ce setup will not wire up from a non-logged-in user's elevated account (exit code 13); judging this repository requires the cli/tests submodules to be in place.
  • A single request wire is at most 134,217,728 charsections; if exceeded, batch them; oversized entries are rejected by name rather than truncated.

License Apache-2.0, see LICENSE for details; third-party list see NOTICE (regenerated by CI and gated). The test suite is located at skymanbp/CodeEraser-tests and requires cloning with --recurse-submodules. "CodeEraser"™ is a trademark of skymanbp; under Apache-2.0 §6, the license covers the code, not the name.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools