Quick start: find unused code with fallow
Run fallow with npx and get a first list of unused code, duplication, and complexity hotspots in a TypeScript or JavaScript project in under a minute.
In under a minute, you get a list of unused code, duplication, and complexity hotspots in your project. Everyone starts with the same command. At the end, pick the integration that fits your work.
1. Run fallow
From your project root, run:
npx fallow
This command runs these analyses in one pass:
- Dead code: unused files, exports, dependencies, and more
- Architecture: import cycles, boundary violations, and rule-pack policy violations
- Duplication: repeated logic across files
- Health: complexity hotspots and refactor targets
Built-in plugins cover Next.js, Vite, Ember, Wuchale, Jest, Tailwind, PandaCSS, Contentlayer, tap, tsd, and more. The first run needs no configuration.
2. Run the focused commands you'll use most
npx fallow dead-code # Cleanup candidates
npx fallow architecture # Import cycles, boundaries, and policy rules
npx fallow dupes # Repeated logic
npx fallow health # Complexity and refactor targets
npx fallow review # Advisory review brief over changed files (always exits 0)
npx fallow fix --dry-run # Preview automatic cleanup
dead-codereports unused files, exports, types, and dependencies. See the dead code guide.architecturereports circular dependencies, re-export cycles, package cycles, boundary violations, and rule-pack policy violations. Seefallow architecture.dupesfinds AST-based duplicates in the defaultmildmode. To also find clones with renamed variables, add--mode semantic. See the duplication guide.healthreports complexity findings, maintainability per file, hotspots, and ranked refactor targets. See the health explanation.fix --dry-runshows the automatic cleanup without changing files. To apply it, remove--dry-run. See the auto-fix guide.
To clean up or refactor TypeScript, add --type-aware when aliases,
re-exports, class contracts, packages, or exact consumers affect the
decision. This optional semantic pass is slower. See
Type-aware TypeScript analysis.
3. Pick your next step
Does your existing repo have a backlog of findings? Follow Adopt Fallow in an existing repo for a step-by-step cleanup. Then come back here to set up CI or VS Code.
Get real-time diagnostics, Code Lens above exports, and one-click fixes.
Use fallow as a PR and merge gate, with SARIF or MR annotations.
Add MCP to give Claude Code, Cursor, and other agents structured tool calls.
Add production execution data to fallow health.
Optional: create a config
Fallow works without a config file. To customize it, run:
npx fallow init
fallow init detects your project structure and writes a config for it. It also adds .fallow/ to your .gitignore.
{
"$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json",
"entry": ["src/workers/*.ts", "scripts/*.ts"],
"ignorePatterns": ["**/*.generated.ts"],
"rules": {
"unused-files": "error",
"unused-exports": "warn",
"unused-types": "off"
}
}Optional: Fallow Cloud
The static layer of fallow is free and open source (MIT). To learn which code actually executed in production, add Fallow Cloud, the paid product. A single local capture is free. The trial below turns on continuous and multi-capture monitoring for 30 days:
npx fallow license activate --trial --email [email protected]
npx fallow coverage setup
npx fallow health --runtime-coverage ./coverage
Before you start, read Static analysis vs production data to learn how the two layers differ. Then follow the runtime coverage guide for the setup.
FAQ
Does fallow need an account or network access?
No. The static analysis needs no account, and it runs on your machine. These are the only network requests:
- Telemetry, which is opt-in and off by default. See Telemetry.
- A background check for a newer release, in local terminal runs only. Set
FALLOW_UPDATE_CHECK=offto turn it off. SeeFALLOW_UPDATE_CHECK. - The commands that you run on purpose, for example Fallow Cloud commands and the model download of
fallow similar-code setup --local.
Fallow rejects a config that extends an https: URL, unless you pass --allow-remote-extends.
Does fallow run the TypeScript compiler?
No. The default analysis parses the code with Oxc and does not need Node.js or the TypeScript compiler. To confirm a finding with the TypeScript checker, add --type-aware. See Type-aware TypeScript analysis.
Do I need a config file?
No. Built-in plugins find the entry points of common frameworks and tools. Add a config only to change the defaults. Run fallow init to write one.
Does fallow change my files?
The analysis commands do not change your source files. Fallow writes its cache to .fallow/. Only fallow fix removes code, and fallow fix --dry-run shows the changes first. See Auto-fix.
Why does fallow exit with code 0 when it finds issues?
Bare fallow with a machine format, such as --format json or --format sarif, reports and does not gate. It exits with code 0 when it finds issues. To fail the run, pass --fail-on-issues or --ci. Focused commands such as fallow dead-code exit with code 1 in every format when a finding has error severity. See Exit codes.