codehelion finds duplicated logic in Rust, C and C++, and keeps tracking the same duplication from one scan to the next. It reads sources as they are, with no build, no compilation database and no network, and names every finding by an identifier derived from its content, so a decision you made about a duplicate stays attached to it through unrelated edits. Nothing leaves the machine, and the tool does not run the code it reads.
Reach for it when you need to:
- Scan a tree you cannot easily build — mixed Rust, C and C++, vendored code or a half-finished port, read by one error-tolerant lexer with no compiler.
- Pay down duplication over months — record where you start in a baseline, suppress what you decided to keep, and see what each later scan adds.
- Stop new copies in CI — fail on duplication the baseline does not carry, not on a percentage, and upload SARIF to a code-scanning view.
- Keep paired files in step — declare a seam such as two frontends or an en/ja document pair, and
guardreports a change that touched one side only. - Explain why a binary or WASM module grew — split its code bytes between your code and the toolchain, total template bodies under one name stem, and compare two builds.
📖 Documentation · Getting started · Limitations
codehelion is pre-1.0. Fast and Structural scanning, the text and JSON reports and
artifact analyzeare settled; the rest can change between releases (Maturity). Report security issues through SECURITY.md.
Structural mode, run against codehelion's own tree, showing the first two groups:
codehelion scan · structural mode · ~/src/codehelion
#1 0.56 type-1 ×2 109 tokens 64f5bc34
├─ ◆ corpus/synthetic/rust/seed.rs:30-49 values_equal
└─ corpus/synthetic/rust/type1.rs:35-54 values_equal
#2 0.54 type-1 run ×2 106 tokens 53c92308
├─ ◆ crates/codehelion-cli/src/scan/structural.rs:159-171 run_with
└─ crates/codehelion-cli/src/scan.rs:61-73 run
... and 1305 more groups (--limit 0 lists every one)
seams: frontend-c-cpp 12 asymmetric changes, 7 breaches (last 6e014d86), 394 findings
readme-en-ja 1 asymmetric change, 1 breach (last 634aa5c9)
artifact-fixture-scripts 3 asymmetric changes, 1 breach (last 6f5d63c3)
1,702 groups (type-1 85, type-2 204, type-3 1413) · 395 suppressed · sorted by priority
supplemental: 556 siblings (--show-siblings; 116 dropped by search ceilings), 1,000 near misses (--show-near-misses; 6,746 dropped by the retention cap)
569 files, 220,783 lines, 1,167,009 tokens · run 12 (replay: codehelion report --run 12)
◆ the occurrence a group is measured against · "run" a repeated stretch of statements, not a whole unit · ×N the number of occurrences
open one: codehelion explain 64f5bc34 · list every group: --limit 0
Every field is explained in Reading a report.
- Build-free scanning — an error-tolerant lexer reads Rust, C and C++ directly, so a mixed-language tree is scanned once on one basis; Semantic mode adds compiler evidence through separate helpers. Analysis modes
- Stable finding IDs — content fingerprints rather than line numbers, so the same input gives the same IDs in the same order and suppressions and baselines hold across refactors. Stable identifiers · Baselines · Suppression
- Evidence, not one score — lexical, structural, control-flow, type and API similarity reported separately, with a measure the mode cannot take shown as absent. Reading a report · Clone types
- An ordered report — on eight labelled snapshots of real projects nothing false reaches the first ten findings (p@10 1.0000, MAP 0.9163); read end to end, precision is 0.6154. Accuracy
- Seams and CI gates —
guardchecks files that must change together, and with a baseline,scan --fail-on-findingsgates on what a change added. Seam tracking · Continuous integration - Artifact size — WASM, ELF, Mach-O and PE/COFF read without running them: code bytes by owner, the functions that keep toolchain code linked in, name stems, compressed size, and a comparison of two builds. Artifact analysis
- Local by construction — no network and no execution of the scanned tree, enforced by lints and dependency policy, and every resource ceiling that fires is counted in the report. Local execution and trust
Every release attaches a prebuilt, self-contained codehelion binary with SQLite bundled, and SHA256SUMS beside it.
| platform | archive |
|---|---|
| Linux x86-64 | codehelion-<version>-linux-x86_64.tar.gz |
| Linux ARM64 | codehelion-<version>-linux-aarch64.tar.gz |
| macOS Apple silicon | codehelion-<version>-macos-aarch64.tar.gz |
| Windows x86-64 | codehelion-<version>-windows-x86_64.zip |
cargo install codehelion # from source; requires Rust 1.98 or newerSemantic mode also needs a helper per language. See Getting started for the helpers and codehelion doctor.
codehelion scan --mode structural # read the tree, report the duplication
codehelion explain 64f5bc34 # open one group
codehelion artifact analyze app.wasm # where the bytes of a build go→ Getting started · The command line
make check # format-check + lint + boundary checks + test + doc
make eval # detection accuracy over the corporamake help lists the rest. Conventions and guardrails are in CONTRIBUTING.md.
- Learn — Introduction · Getting started · Analysis modes · Glossary
- Reading the output — Reading a report · Clone types · Grouping · Stable identifiers
- Using it on a project — The refactoring loop · Baselines · Suppression · Configuration · Seam tracking · Continuous integration · The command line
- Artifacts — Artifact analysis · Calibration
- Details — Limitations · Accuracy · Local execution and trust · Architecture
codehelion measures maintainability, not size: removing a reported clone need not make the built artifact smaller. It does not claim to find every copy, prove semantic equivalence, check coding style or vulnerabilities, or refactor code for you, and it has no GUI or hosted service. See Limitations.