Find structural drift before it becomes the next refactor.
Reforge is a local CLI for repository-level code review. It finds duplicated implementations, oversized responsibilities, dependency tangles, and architecture drift—including patterns introduced gradually by coding agents.
Every finding identifies its rule and relevant source locations, with measurements or a value-flow witness when the rule produces them. Coverage records what Reforge could and could not analyze. Reforge does not upload source code, assign a health score, or claim that a finding is a bug.
Try the agent-code Playground → · Open an example report →
Install the latest release on Linux or macOS:
curl -fsSL https://raw.githubusercontent.com/LyleMi/Reforge/main/scripts/install.sh | shOr install only the CLI from crates.io:
cargo install reforge-cli --lockedThen analyze a repository:
reforge analyze .With no configuration, the CLI runs Codebase analysis with four preview advisories: large files, long functions, dependency cycles, and similar functions. They are review prompts, not CI failures. Create a versioned starter configuration to tune or disable them:
reforge init
reforge analyze . --output html --output-file reforge-report.htmlWindows PowerShell and pinned-version installation are covered in the installation guide.
| Area | Examples |
|---|---|
| Responsibilities | Large files, long or complex functions, deep nesting, broad public surfaces |
| Duplication | Similar functions, repeated literals, repeated test setup, overlapping type shapes |
| Architecture drift | Dependency cycles, generic buckets, parallel implementations, boundary bypasses |
| Repository consistency | Naming drift, stale compatibility paths, TODO/FIXME clusters |
Codebase analysis supports Rust, JavaScript, TypeScript/TSX, Vue, Python, Go, Java, C#, Kotlin, PHP, Ruby, Bash, and PowerShell. Dependency rules also recognize C and C++.
Implementation duplication: 3 related items
Rule: reforge.codebase.shadowed_abstraction
Locations: forms/legacy_email_validator.py:1
forms/signup_email_validator.py:1
shared/email_validator.py:1
Measurement: group size 3 (threshold 3)
Guidance: Consolidate shared behavior or make separate variants explicit.
The evidence makes a finding inspectable; it does not decide the refactor for you. An empty report is meaningful only for the languages, capabilities, and rules marked as observed in Coverage.
Export JSON or SARIF for CI and code-scanning integrations:
reforge analyze . --output sarif --output-file reforge.sarif --reproducibleAll current core rules are preview and advisory-only. The --gate options apply
only to rules that later satisfy Reforge's calibration contract, become stable,
and are explicitly enforced; preview findings do not fail CI.
Dataflow is opt-in and intended for exact value-path and declared-boundary inspection:
reforge analyze . --analysis dataflow --output json --reproducible
reforge analyze . --analysis codebase --analysis dataflow --reproducibleSee the Dataflow guide for its configuration and coverage limits.
Reforge is a Rust 2024 workspace. Run the complete validation gate with:
scripts/check-ci.shOr run the core checks directly:
cargo fmt --all -- --check
cargo clippy --locked --workspace --all-targets --all-features -- -D warnings
cargo test --locked --workspace --all-targets --all-features