fallow
v2.75.0
Published
Codebase intelligence for TypeScript and JavaScript. Finds unused code, duplication, circular dependencies, complexity hotspots, and architecture drift. Optional runtime intelligence layer (Fallow Runtime) adds production execution evidence. Rust-native,
Maintainers
Readme
fallow
Codebase intelligence for TypeScript and JavaScript, built in Rust.
Static analysis finds what is connected. Runtime intelligence finds what actually runs. Both land in the same report. The free static layer analyzes your codebase for unused files, exports, dependencies, and types, detects circular dependencies, finds duplicated code blocks, surfaces complexity hotspots, and enforces architecture boundaries. An optional paid runtime layer (Fallow Runtime) adds production execution evidence so you can delete and refactor with confidence. 5-41x faster than knip v5 (2-18x faster than knip v6), 8-29x faster than jscpd for duplication detection, with no Node.js runtime dependency.
Static analysis is free and open source. Runtime intelligence is the paid team layer.
Installation
npm install --save-dev fallow # or: pnpm add -D fallow / yarn add -D fallow / bun add -d fallowInstalls the fallow CLI plus the companion fallow-lsp and fallow-mcp binaries in your project.
The package also ships a version-matched Agent Skill under skills/fallow.
TanStack Intent discovers it from node_modules automatically:
npx @tanstack/intent list
npx @tanstack/intent load fallow#fallowFor one-off CLI use without project-local skill discovery, run npx fallow.
Parsing fallow's JSON output in TypeScript? Import the typed shapes:
import type { CheckOutput, FallowJsonOutput } from "fallow/types";The types are generated from the same schema as the VS Code extension and pin to the CLI version you install. See docs.fallow.tools for the full output contract.
Usage
fallow # All analyses -- zero config, sub-second
fallow dead-code # Unused code only
fallow dupes # Duplication detection -- find copy-paste clones
fallow dupes --mode semantic # Catch clones with renamed variables
fallow health # Complexity metrics -- cyclomatic + cognitive
fallow fix --dry-run # Preview auto-removal of unused exports and depsWhat it finds
- Unused files -- not reachable from any entry point
- Unused exports -- exported symbols never imported elsewhere
- Unused types -- type aliases and interfaces never referenced
- Unused dependencies -- packages in
dependenciesnever imported - Unused devDependencies -- dev packages not referenced
- Unused enum members -- enum values never referenced
- Unused class members -- class methods and properties never referenced (tracks instance usage:
const svc = new MyService(); svc.greet()countsgreetas used) - Unresolved imports -- import specifiers that cannot be resolved
- Unlisted dependencies -- imported packages missing from
package.json - Duplicate exports -- same symbol exported from multiple modules
- Circular dependencies -- import cycles in the module graph
- Type-only dependencies -- production deps only used via
import type
Code duplication
fallow dupes # Default: mild mode
fallow dupes --mode semantic # Catch clones with renamed variables
fallow dupes --threshold 5 # Fail CI if duplication exceeds 5%
fallow dupes --save-baseline # Save current duplication as baseline4 detection modes (strict, mild, weak, semantic), clone family grouping with refactoring suggestions, baseline tracking, and cross-language TS/JS matching.
Framework support
95 built-in plugins covering Next.js, Nuxt, Remix, Qwik, SvelteKit, Gatsby, Astro, Angular, NestJS, AdonisJS, Expo Router, Vite, Webpack, Vitest, Jest, Playwright, Cypress, Storybook, ESLint, TypeScript, Tailwind, UnoCSS, Prisma, Drizzle, Convex, Turborepo, Hardhat, and many more. Auto-detected from your package.json.
Configuration
Create a config file in your project root, or run fallow init:
// .fallowrc.json
{
"$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"
}
}Also supports TOML (fallow init --toml creates fallow.toml).
Documentation
License
MIT
