# Table of Contents - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [fallow: codebase intelligence for TypeScript and JavaScript](#fallow-codebase-intelligence-for-typescript-and-javascript) - [Unknown](#unknown) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Getting Started Fallow documentation [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Fallow is **codebase intelligence for TypeScript and JavaScript**. Use the free static layer to find unused code, duplication, complexity hotspots, architecture drift, and feature-flag branches across your module graph. Add the optional runtime layer when you want to know what actually executed in production. Static intelligence (free) -------------------------- MIT-licensed and open source. Understand how your code is wired. Runtime intelligence (optional) ------------------------------- Paid team layer. Understand what actually ran in production. [​](https://docs.fallow.tools/#start-here) Start here -------------------------------------------------------- 1 [](https://docs.fallow.tools/#) Run Fallow without installing npx fallow No config needed for the first run. 2 [](https://docs.fallow.tools/#) Read the three analyses Dead code, duplication, and complexity, in one pass. 3 [](https://docs.fallow.tools/#) Go deeper npx fallow dead-code npx fallow dupes npx fallow health npx fallow fix --dry-run [​](https://docs.fallow.tools/#what-fallow-helps-you-do) What Fallow helps you do ------------------------------------------------------------------------------------ Delete cold code ---------------- Remove unused files, exports, and dependencies with confidence. Reduce duplication ------------------ Find repeated logic before it spreads. Prioritize refactors -------------------- Use complexity and health analysis to focus cleanup work. Add runtime evidence -------------------- See hot paths, cold paths, and runtime-backed deletion evidence. [​](https://docs.fallow.tools/#pick-your-workflow) Pick your workflow ------------------------------------------------------------------------ CLI --- Best place to start. Works locally, in CI, and in agent loops. VS Code ------- Real-time diagnostics, Code Lens, and one-click fixes in the editor. MCP and agents -------------- Structured tool calling for Claude Code, Cursor, and other agents. [​](https://docs.fallow.tools/#understand-the-two-layers) Understand the two layers -------------------------------------------------------------------------------------- Static analysis answers: **what is connected to what?** Runtime intelligence answers: **what actually ran?** They meet in `fallow health`. Static vs runtime intelligence ------------------------------ Read the mental model before you set up runtime collection. [​](https://docs.fallow.tools/#most-used-pages) Most-used pages ------------------------------------------------------------------ Quick start ----------- Configuration ------------- CI integration -------------- CLI reference ------------- Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/index.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/) [InstallationInstall Fallow via npx, npm, pnpm, yarn, cargo, or a prebuilt binary. Binaries for macOS, Linux, and Windows.\ \ Next](https://docs.fallow.tools/installation) ⌘I --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/fix#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow fix [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Automatically remove unused exports and dependencies from your codebase. Fallow modifies your source files in place, so treat this like a refactoring tool. Always commit your changes before running `fallow fix`. This gives you a clean rollback point if anything unexpected happens. Use `--dry-run` first to preview exactly what will be removed before applying any changes. fallow fix [​](https://docs.fallow.tools/cli/fix#options) Options --------------------------------------------------------- | Flag | Description | | --- | --- | | `--dry-run` | Preview changes without applying | | `--yes, --force` | Skip confirmation (required in non-TTY) | | `-f, --format ` | Output format: `human` (default), `json` | [​](https://docs.fallow.tools/cli/fix#what-gets-fixed) What gets fixed ------------------------------------------------------------------------- * **Unused exports**: the `export` keyword is removed, keeping the declaration * **Unused dependencies**: removed from `package.json` when they are not imported by another workspace * **Unused enum members**: removed from the enum declaration Unused files and class members are not auto-fixed. Use `fallow dead-code` to find those. [​](https://docs.fallow.tools/cli/fix#examples) Examples ----------------------------------------------------------- Preview changes Apply fixes # See what would be removed fallow fix --dry-run # JSON output for scripting fallow fix --dry-run --format json [​](https://docs.fallow.tools/cli/fix#example-output) Example output ----------------------------------------------------------------------- $ fallow fix Would remove export from src/components/Card/index.ts:1 `CardFooter` Would remove export from src/providers/trpc-provider/index.tsx:12 `TRPCProvider` Would remove export from src/server/jobs/queue.ts:61 `enqueueJobDelayed` Would remove export from src/server/jobs/queue.ts:206 `sweepStuckProcessingJobs` Would remove export from src/server/jobs/queue.ts:276 `getDeadLetterJobs` Would remove `@trpc/react-query` from dependencies 6 changes to apply. Proceed? [y/N] y ✓ Applied 6 fixes (5 exports, 1 dependency) [​](https://docs.fallow.tools/cli/fix#see-also) See also ----------------------------------------------------------- Auto-fix -------- Details on what fallow can and cannot auto-fix. Dead code analysis ------------------ Understand the full range of dead code fallow detects. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/fix.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/fix) [Previous](https://docs.fallow.tools/cli/audit) [fallow watchCLI reference for fallow watch. Re-run unused code analysis automatically when files change for continuous feedback during development.\ \ Next](https://docs.fallow.tools/cli/watch) ⌘I On this page * [Options](https://docs.fallow.tools/cli/fix#options) * [What gets fixed](https://docs.fallow.tools/cli/fix#what-gets-fixed) * [Examples](https://docs.fallow.tools/cli/fix#examples) * [Example output](https://docs.fallow.tools/cli/fix#example-output) * [See also](https://docs.fallow.tools/cli/fix#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/config#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow config [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Print the resolved configuration and the path of the config file that was loaded. Useful for debugging “why isn’t my config being applied?” especially in monorepos where multiple `.fallowrc.json` files may be in play. fallow config By default, prints the loaded config path on the first line followed by the JSON-serialized config (with `extends` resolved): $ fallow config loaded config: /repo/.fallowrc.json { "entry": ["src/main.ts"], "ignorePatterns": ["dist/**"], "duplicates": { "ignoreImports": true }, ... } [​](https://docs.fallow.tools/cli/config#options) Options ------------------------------------------------------------ | Flag | Description | | --- | --- | | `--path` | Print only the config file path, one line, no JSON. Easier to consume from shell scripts. | The global `--config ` flag is honored: if you pass it, that path is loaded directly instead of walking the directory tree. [​](https://docs.fallow.tools/cli/config#exit-codes) Exit codes ------------------------------------------------------------------ | Code | Meaning | | --- | --- | | `0` | A config file was found and loaded | | `2` | Error (failed to parse, explicit `--config` path missing, etc.) | | `3` | No config file was found; defaults are in effect | [​](https://docs.fallow.tools/cli/config#examples) Examples -------------------------------------------------------------- ### [​](https://docs.fallow.tools/cli/config#verify-which-config-the-lsp/cli-picked-up) Verify which config the LSP/CLI picked up In a monorepo, when running fallow from inside a sub-package: cd packages/app fallow config --path # /repo/.fallowrc.json (root config inherited — sub-package has none of its own) If a sub-package has its own config, that path is printed instead (first-match-wins). ### [​](https://docs.fallow.tools/cli/config#use-an-explicit-config-file) Use an explicit config file fallow --config ./my-config.json config ### [​](https://docs.fallow.tools/cli/config#pipe-to-jq-for-further-inspection) Pipe to jq for further inspection fallow config | tail -n +2 | jq '.duplicates' The first line (`loaded config: ...`) is on stdout above the JSON, so `tail -n +2` skips it. ### [​](https://docs.fallow.tools/cli/config#detect-%E2%80%9Cno-config%E2%80%9D-in-scripts) Detect “no config” in scripts if ! fallow config --path > /tmp/fallow-cfg-path 2>/dev/null; then echo "no fallow config found, will use defaults" fi [​](https://docs.fallow.tools/cli/config#related) Related ------------------------------------------------------------ * [Configuration overview](https://docs.fallow.tools/configuration/overview) : supported config file names and the full schema * [Monorepo configuration](https://docs.fallow.tools/configuration/workspaces) : how config discovery works in workspaces Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/config.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/config) [Previous](https://docs.fallow.tools/cli/list) [Global flagsGlobal CLI flags available on every fallow command, including root, config, format, cache, threads, workspace, changed-workspaces, score, trend, and snapshot options.\ \ Next](https://docs.fallow.tools/cli/global-flags) ⌘I On this page * [Options](https://docs.fallow.tools/cli/config#options) * [Exit codes](https://docs.fallow.tools/cli/config#exit-codes) * [Examples](https://docs.fallow.tools/cli/config#examples) * [Verify which config the LSP/CLI picked up](https://docs.fallow.tools/cli/config#verify-which-config-the-lsp%2Fcli-picked-up) * [Use an explicit config file](https://docs.fallow.tools/cli/config#use-an-explicit-config-file) * [Pipe to jq for further inspection](https://docs.fallow.tools/cli/config#pipe-to-jq-for-further-inspection) * [Detect “no config” in scripts](https://docs.fallow.tools/cli/config#detect-%E2%80%9Cno-config%E2%80%9D-in-scripts) * [Related](https://docs.fallow.tools/cli/config#related) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/init#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow init [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Create a configuration file for your project. The generated config includes a `$schema` field so your editor can provide autocomplete and validation. Most projects don’t need a config file. Fallow works out of the box by auto-detecting entry points and frameworks. Only create one if you need custom entry points, rules, or ignore patterns. Fallow’s init command auto-detects your project setup and tailors the generated config accordingly: * **TypeScript**: Detects `tsconfig.json` and enables TypeScript-aware defaults * **Monorepo**: Detects workspace configurations (npm, yarn, pnpm) and includes workspace patterns * **Frameworks**: Detects installed frameworks (Next.js, Remix, Vite, etc.) and adds appropriate entry point patterns fallow init [​](https://docs.fallow.tools/cli/init#options) Options ---------------------------------------------------------- | Flag | Description | | --- | --- | | `--toml` | Generate `fallow.toml` instead of `.fallowrc.json` | | `--hooks` | Scaffold a pre-commit git hook that runs fallow on changed files | | `--branch ` | Base branch for the hook (requires `--hooks`, default: auto-detected via git or `main`) | [​](https://docs.fallow.tools/cli/init#pre-commit-hook) Pre-commit hook -------------------------------------------------------------------------- Use `--hooks` to scaffold a git hook that checks changed files before each commit: fallow init --hooks Fallow detects your hook manager and writes to the right location: 1. **Husky** — adds to `.husky/pre-commit` 2. **Lefthook** — adds to `lefthook.yml` 3. **Bare hooks** — writes `.git/hooks/pre-commit` The generated hook: * Includes a binary guard (`command -v fallow`) so commits still work when fallow isn’t installed * Runs `fallow dead-code --changed-since --fail-on-issues --quiet` * Prints a success message that mentions `git commit --no-verify` for bypassing the hook ### [​](https://docs.fallow.tools/cli/init#custom-base-branch) Custom base branch By default, the hook uses the auto-detected base branch (or `main` as fallback). Override with `--branch`: fallow init --hooks --branch develop [​](https://docs.fallow.tools/cli/init#gitignore) Gitignore -------------------------------------------------------------- `fallow init` automatically adds `.fallow/` to your project’s `.gitignore`. The `.fallow/` directory contains machine-local data (parse cache, regression baselines, snapshots) that should not be committed. * If `.gitignore` exists and already contains `.fallow/`, nothing changes * If `.gitignore` exists without it, the entry is appended * If `.gitignore` doesn’t exist, it is created [​](https://docs.fallow.tools/cli/init#output) Output -------------------------------------------------------- The generated config includes a `$schema` field for IDE autocomplete. Editors like VS Code will provide inline validation and suggestions automatically. By default, creates `.fallowrc.json`: { "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json", "rules": {} } With `--toml`, creates `fallow.toml`. [​](https://docs.fallow.tools/cli/init#see-also) See also ------------------------------------------------------------ Configuration overview ---------------------- Full reference for all configuration options. Quickstart ---------- Get started with fallow in under a minute. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/init.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/init) [Previous](https://docs.fallow.tools/cli/watch) [fallow migrateCLI reference for fallow migrate. Automatically convert your existing knip or jscpd configuration to fallow's config format.\ \ Next](https://docs.fallow.tools/cli/migrate) ⌘I On this page * [Options](https://docs.fallow.tools/cli/init#options) * [Pre-commit hook](https://docs.fallow.tools/cli/init#pre-commit-hook) * [Custom base branch](https://docs.fallow.tools/cli/init#custom-base-branch) * [Gitignore](https://docs.fallow.tools/cli/init#gitignore) * [Output](https://docs.fallow.tools/cli/init#output) * [See also](https://docs.fallow.tools/cli/init#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/coverage#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow coverage [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. `fallow coverage` groups the paid Runtime Coverage workflow commands: fallow coverage setup # resumable first-run flow fallow coverage upload-inventory # push a static function inventory `setup` is the guided first-run path: license check, sidecar install, recipe generation, health handoff. It is intentionally resumable: run it once to bootstrap, follow the generated recipe, then run it again after traffic has been captured. `upload-inventory` is the CI step that unlocks the `Untracked` filter in the dashboard by pairing the runtime V8/Istanbul data (what actually ran) with the AST view of every function that exists. [​](https://docs.fallow.tools/cli/coverage#setup) `setup` ------------------------------------------------------------ The setup flow performs four steps: 1. check license state 2. locate or install `fallow-cov` 3. write a framework-specific collection recipe to `docs/collect-coverage.md` 4. if coverage already exists, hand off directly to `fallow health --runtime-coverage ` fallow coverage setup fallow coverage setup --non-interactive fallow coverage setup --yes ### [​](https://docs.fallow.tools/cli/coverage#flags) Flags | Flag | Description | | --- | --- | | `-y, --yes` | Accept prompts automatically. Useful for local setup when you want fallow to continue without confirmation prompts. | | `--non-interactive` | Print instructions instead of prompting. Useful in CI, remote shells, or agent workflows. | [​](https://docs.fallow.tools/cli/coverage#what-setup-detects-automatically) What setup detects automatically ---------------------------------------------------------------------------------------------------------------- `fallow coverage setup` inspects `package.json`, lockfiles, and scripts to tailor the instructions: | Detection | Purpose | | --- | --- | | Framework | Chooses a recipe for Next.js, NestJS, Nuxt, SvelteKit, Astro, Remix, plain Node services, or a generic fallback. | | Package manager | Uses `packageManager`, lockfiles, or both to choose install commands for npm, pnpm, yarn, or bun. | | Coverage artifact | Detects existing `coverage/coverage-final.json`, `.nyc_output/coverage-final.json`, or JSON-containing V8 directories. | | Sidecar binary | Resolves `FALLOW_COV_BIN`, `FALLOW_COV_BINARY_PATH`, project-local shims, package-manager bin lookups, `~/.fallow/bin/fallow-cov`, and `PATH`. | If the project does not match a built-in framework recipe, fallow still writes a fallback `docs/collect-coverage.md` with a link to the public coverage docs for manual setup. [​](https://docs.fallow.tools/cli/coverage#generated-recipe) Generated recipe -------------------------------------------------------------------------------- The generated `docs/collect-coverage.md` recipe typically looks like: 1. Remove any old dump directory: rm -rf ./coverage 2. Build the app 3. Start the app with NODE_V8_COVERAGE=./coverage ... 4. Exercise the routes or jobs you care about 5. Stop the app and run: fallow coverage setup Framework-aware script selection means fallow prefers existing `build`, `start`, or `preview` scripts when they exist and falls back to common framework commands otherwise. [​](https://docs.fallow.tools/cli/coverage#typical-flow) Typical flow ------------------------------------------------------------------------ fallow license activate --trial --email you@company.com fallow coverage setup # Follow docs/collect-coverage.md, then: fallow coverage setup On the second run, if coverage is present, setup runs the actual analysis for you: fallow health --runtime-coverage ./coverage [​](https://docs.fallow.tools/cli/coverage#sidecar-installation) Sidecar installation ---------------------------------------------------------------------------------------- If `fallow-cov` is missing, setup tells you exactly what it checked and suggests the correct install command for your package manager, for example: pnpm add -D @fallow-cli/fallow-cov You can also bypass auto-discovery by setting either explicit-override env var to a binary path. Resolution order is `FALLOW_COV_BIN` first, then `FALLOW_COV_BINARY_PATH`, then project-local auto-discovery. Both fail hard with a clear error if the configured path does not exist (they never silently fall through to the next step). `FALLOW_COV_BINARY_PATH` exists for air-gapped enterprise installs, Linux distro-packaged sidecars, and Docker multi-user setups where `~/.fallow/bin` is not writable. ### [​](https://docs.fallow.tools/cli/coverage#sidecar-signature-verification) Sidecar signature verification Every sidecar spawn runs an Ed25519 signature check against the compiled-in public key. The sidecar binary must ship with an adjacent `.sig` file. A missing, wrong-length, or invalid signature fails hard with exit code 4 rather than executing an unverified binary. There is no warn-and-run mode and no opt-out env var. If verification fails, install the signed distribution: pnpm add -D @fallow-cli/fallow-cov [​](https://docs.fallow.tools/cli/coverage#upload-inventory) `upload-inventory` ---------------------------------------------------------------------------------- `fallow coverage upload-inventory` walks every JS/TS source in the project and POSTs a static function inventory (one row per declaration, expression, arrow, or method) to fallow cloud. The server computes `inventory − runtime-seen = untracked` for the matching git SHA, which lights up the dashboard’s **Untracked** filter. This is the only fallow subcommand that does network I/O outside of `fallow license`. `check`, `dupes`, and `health` stay offline. fallow coverage upload-inventory \ --api-key $FALLOW_API_KEY \ --project-id acme/web ### [​](https://docs.fallow.tools/cli/coverage#defaults-and-inference) Defaults and inference | Flag | Default | | --- | --- | | `--api-key` | `$FALLOW_API_KEY` | | `--api-endpoint` | `$FALLOW_API_URL` or `https://api.fallow.cloud` | | `--project-id` | `$GITHUB_REPOSITORY`, then `$CI_PROJECT_PATH`, then `git remote get-url origin` parsed to `owner/repo` | | `--git-sha` | `git rev-parse HEAD` | ### [​](https://docs.fallow.tools/cli/coverage#flags-2) Flags | Flag | Description | | --- | --- | | `--api-key ` | Fallow cloud bearer token. **Prefer `$FALLOW_API_KEY` on shared CI runners** — passing secrets on the command line may be visible to other processes via `ps` and can leak into shell history or process audit logs. | | `--api-endpoint ` | Override the base URL. Useful for staging and on-prem deployments. | | `--project-id ` | Project identifier, `owner/repo` form. | | `--git-sha ` | Commit SHA this inventory is keyed to. Max 64 chars; `[A-Za-z0-9._-]` only. | | `--allow-dirty` | Silence the warning when the working tree has uncommitted changes. | | `--exclude-paths ` | Additional globs to skip, applied after the configured fallow ignore rules. Repeatable. | | `--path-prefix ` | Prefix prepended to every emitted `filePath` so the static inventory matches the path shape the runtime beacon reports. Required for containerized deployments: the beacon reports V8’s absolute path inside the container (e.g. `/app/src/foo.ts`) while the walker emits repo-relative paths (`src/foo.ts`) by default. Must start with `/` and use POSIX separators. Common values: `/app` (typical Dockerfile), `/workspace` (Buildpacks / Cloud Run), `/usr/src/app` (older Node images), `/var/task` (Lambda), `/home/runner/work//` (GitHub Actions). | | `--dry-run` | Print what would be uploaded and exit. No network call. | | `--ignore-upload-errors` | Treat upload failures as warnings (exit 0). Validation errors still fail hard. | ### [​](https://docs.fallow.tools/cli/coverage#function-naming) Function naming Inventory entries use names that match `oxc-coverage-instrument` byte-for-byte so the runtime join succeeds. Precedence: 1. Parent context (method key, variable binding, property key, `export default`). 2. The function’s own `id` (`function foo() {}`, named function expression). 3. `(anonymous_N)` where `N` is a file-scoped monotonic counter. TypeScript declaration files (`*.d.ts`, `*.d.mts`, `*.d.cts`, `*.d.tsx`) and overload signatures with no body are intentionally skipped: they have no runtime footprint, so including them would pollute the dashboard with permanently `untracked` entries. ### [​](https://docs.fallow.tools/cli/coverage#path-prefix-containerized-deployments) Path prefix (containerized deployments) The runtime beacon reports V8’s `filePath` as it sees it at runtime. In a container, that is the path inside the image (e.g. `/app/src/foo.ts` when the Dockerfile sets `WORKDIR /app`). The static inventory walker, running in CI against the checkout, emits repo-relative paths (`src/foo.ts`) by default. The server joins runtime and inventory on the exact `(filePath, functionName)` pair; if the two sides don’t share a prefix shape, the Untracked filter never lights up and the dashboard surfaces a `mismatched` state. The fix: pass `--path-prefix` matching your deployed `WORKDIR`: fallow coverage upload-inventory --path-prefix /app Common values by deployment target: | Target | Prefix | | --- | --- | | Docker image with `WORKDIR /app` (most Node services) | `/app` | | Cloud Run / Buildpacks | `/workspace` | | Older official Node images | `/usr/src/app` | | AWS Lambda | `/var/task` | | GitHub Actions default checkout | `/home/runner/work//` | After upload, the server samples up to 100 recent runtime rows and reports the overlap with the inventory. The CLI prints a yellow warning if overlap < 50% with an example mismatch, and the dashboard renders a configuration-needed state on the repo detail page until the prefix is corrected. ### [​](https://docs.fallow.tools/cli/coverage#exit-codes) Exit codes | Code | Meaning | When it fires | | --- | --- | --- | | `0` | ok | Upload succeeded, or `--dry-run`, or `--ignore-upload-errors` downgraded a transient failure. | | `7` | network | DNS, TLS, connect, or transport failure. | | `10` | validation | Missing API key, unresolvable project-id, zero functions in walk. | | `11` | payload too large | Inventory exceeds the server’s 200,000-function cap. Scope with `--exclude-paths`. | | `12` | auth rejected | 401 / 403 from the server. Rotate the token or widen its scope. | | `13` | server error | 5xx after retries, or other non-2xx status. | ### [​](https://docs.fallow.tools/cli/coverage#example-ci-job-github-actions) Example CI job (GitHub Actions) - name: Upload function inventory to fallow cloud run: | npx fallow coverage upload-inventory env: FALLOW_API_KEY: ${{ secrets.FALLOW_API_KEY }} ### [​](https://docs.fallow.tools/cli/coverage#dry-run-output) Dry-run output fallow coverage upload-inventory (dry run) project-id: acme/web git-sha: a1b2c3d4e5f6... functions: 14,280 endpoint: https://api.fallow.cloud/v1/coverage/acme/web/inventory first 5 of 14,280 entries: src/index.ts:1 bootstrap src/index.ts:12 (anonymous_1) src/user.ts:3 createUser src/user.ts:18 default src/user.ts:42 (anonymous_5) ... and 14,275 more [​](https://docs.fallow.tools/cli/coverage#see-also) See also ---------------------------------------------------------------- License commands ---------------- Start a trial, refresh a token, or inspect feature status. Runtime coverage ---------------- Learn what runtime coverage adds and how it differs from static reachability. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/coverage.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/coverage) [Previous](https://docs.fallow.tools/cli/license) [fallow flagsCLI reference for fallow flags. Detect feature flag patterns, environment variable gates, SDK calls, and config-based toggles across your codebase.\ \ Next](https://docs.fallow.tools/cli/flags) ⌘I On this page * [setup](https://docs.fallow.tools/cli/coverage#setup) * [Flags](https://docs.fallow.tools/cli/coverage#flags) * [What setup detects automatically](https://docs.fallow.tools/cli/coverage#what-setup-detects-automatically) * [Generated recipe](https://docs.fallow.tools/cli/coverage#generated-recipe) * [Typical flow](https://docs.fallow.tools/cli/coverage#typical-flow) * [Sidecar installation](https://docs.fallow.tools/cli/coverage#sidecar-installation) * [Sidecar signature verification](https://docs.fallow.tools/cli/coverage#sidecar-signature-verification) * [upload-inventory](https://docs.fallow.tools/cli/coverage#upload-inventory) * [Defaults and inference](https://docs.fallow.tools/cli/coverage#defaults-and-inference) * [Flags](https://docs.fallow.tools/cli/coverage#flags-2) * [Function naming](https://docs.fallow.tools/cli/coverage#function-naming) * [Path prefix (containerized deployments)](https://docs.fallow.tools/cli/coverage#path-prefix-containerized-deployments) * [Exit codes](https://docs.fallow.tools/cli/coverage#exit-codes) * [Example CI job (GitHub Actions)](https://docs.fallow.tools/cli/coverage#example-ci-job-github-actions) * [Dry-run output](https://docs.fallow.tools/cli/coverage#dry-run-output) * [See also](https://docs.fallow.tools/cli/coverage#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/dupes#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow dupes [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Detect copy-pasted code blocks across your entire codebase using suffix-array analysis. Start with the default `mild` mode. Use `semantic` when you want to catch clones with renamed variables. fallow dupes [​](https://docs.fallow.tools/cli/dupes#options) Options ----------------------------------------------------------- ### [​](https://docs.fallow.tools/cli/dupes#detection) Detection | Flag | Description | | --- | --- | | `--mode ` | Detection mode: `strict`, `mild` (default), `weak`, `semantic` | | `--min-tokens ` | Minimum tokens per clone (default: 50) | | `--min-lines ` | Minimum lines per clone (default: 5) | | `--skip-local` | Only report cross-directory duplicates | | `--cross-language` | Strip TS types for TS to JS matching | | `--ignore-imports` | Exclude import declarations from clone detection | ### [​](https://docs.fallow.tools/cli/dupes#output) Output | Flag | Description | | --- | --- | | `-f, --format ` | Output format: `human` (default), `json`, `sarif`, `compact`, `markdown`, `codeclimate` | | `--top ` | Show only the N largest clone groups. Groups are sorted by line count descending. Summary stats reflect the full project, not just the shown groups. | | `--quiet` | Suppress progress output | | `--threshold ` | Fail if duplication exceeds N% | | `--group-by ` | Partition the report into per-group sections. `MODE`: `owner` (CODEOWNERS), `directory` (first path component), `package` (workspace), or `section` (GitLab `[Section]` headers). Each clone group is attributed to its largest owner (most instances; alphabetical tiebreak), so a group split 2 src / 1 lib appears under `src`. JSON adds `grouped_by` plus a `groups` array of per-bucket dedup-aware `stats`, attributed `clone_groups` (each carrying `primary_owner` and per-instance `owner`), and `clone_families`. SARIF results carry `properties.group` and CodeClimate issues carry a top-level `group` field. Compact and markdown fall back to ungrouped output with a stderr note. | | `--explain` | Add metric explanations. In human format, explanations are always shown. In JSON format, adds a `_meta` object with metric descriptions and docs links. | | `--summary` | Print a one-line summary of duplication counts at the end of the run. In JSON format, adds a `summary` counts object. | ### [​](https://docs.fallow.tools/cli/dupes#incremental) Incremental | Flag | Description | | --- | --- | | `--changed-since ` | Only report duplication in files changed since a git ref | | `--baseline ` | Compare against a previously saved baseline file | | `--save-baseline ` | Save current duplication as a baseline file | ### [​](https://docs.fallow.tools/cli/dupes#monorepo-scoping) Monorepo scoping Both flags retain only clone groups where at least one instance is under a selected workspace root. The full cross-workspace index is still built; reported groups and the `duplication_percentage` stat are recomputed from the scoped slice. | Flag | Description | | --- | --- | | `-w, --workspace ` | Scope output to one or more workspaces. Supports exact package names, globs (`apps/*`, `@scope/*`) matched against both the package name and the workspace path, and `!`\-prefixed negation. Comma-separated values or repeated flag. | | `--changed-workspaces ` | Git-derived monorepo CI scoping: scope to workspaces containing any file changed since `REF` (e.g. `origin/main`). Mutually exclusive with `--workspace`. Missing ref is a hard error (exit 2), not silent full-scope fallback. | ### [​](https://docs.fallow.tools/cli/dupes#debugging) Debugging | Flag | Description | | --- | --- | | `--trace ` | Show all clones of code at a specific location | | `--performance` | Show pipeline timing breakdown | [​](https://docs.fallow.tools/cli/dupes#detection-modes) Detection modes --------------------------------------------------------------------------- Detection mode details Each mode progressively normalizes more syntax before comparing, trading precision for recall. | Mode | What it normalizes | Best for | | --- | --- | --- | | **strict** | Nothing: exact token match | Finding verbatim copies | | **mild** | Currently equivalent to strict (AST tokenization inherently strips whitespace) | General-purpose detection (default) | | **weak** | \+ string literal values | Catching copies with different messages | | **semantic** | \+ variable names and numeric values | Finding structural clones after renaming | As you move from `strict` to `semantic`, you’ll find more clones but also more potential false positives. Start with `mild` and increase sensitivity as needed. [​](https://docs.fallow.tools/cli/dupes#examples) Examples ------------------------------------------------------------- Default analysis Filtering Advanced detection CI integration Debugging # Mild mode (default) fallow dupes [​](https://docs.fallow.tools/cli/dupes#example-output) Example output ------------------------------------------------------------------------- $ fallow dupes --top 3 ● Duplicates (3 clone groups) 5,433 lines 2 instances deno/lib/types.ts:45-5477 src/types.ts:45-5477 914 lines 2 instances deno/lib/__tests__/string.test.ts:8-921 src/__tests__/string.test.ts:7-920 42 lines 3 instances src/features/forecasting/server/procedures/analytics.ts:141-181 src/features/forecasting/server/procedures/cashflow.ts:153-194 src/features/forecasting/server/procedures/income.ts:590-631 Identical code blocks detected via suffix-array analysis — https://docs.fallow.tools/explanations/duplication#clone-groups ✓ 27,255 lines (19.4%) duplicated across 398 files (0.23s) $ fallow dupes --threshold 15 ● Duplicates (3 clone groups) 5,433 lines 2 instances deno/lib/types.ts:45-5477 src/types.ts:45-5477 914 lines 2 instances deno/lib/__tests__/string.test.ts:8-921 src/__tests__/string.test.ts:7-920 42 lines 3 instances src/features/forecasting/server/procedures/analytics.ts:141-181 src/features/forecasting/server/procedures/cashflow.ts:153-194 src/features/forecasting/server/procedures/income.ts:590-631 Identical code blocks detected via suffix-array analysis — https://docs.fallow.tools/explanations/duplication#clone-groups ✗ 27,255 lines (19.4%) duplicated across 398 files (0.23s) Duplication (19.4%) exceeds threshold (15%) [​](https://docs.fallow.tools/cli/dupes#json-output) JSON output ------------------------------------------------------------------- ### [​](https://docs.fallow.tools/cli/dupes#mirrored_directories) `mirrored_directories` When fallow detects directory pairs that are largely duplicated (e.g., a `deno/` mirror of `src/`), the JSON output includes a `mirrored_directories` array: { "mirrored_directories": [\ {\ "dir_a": "deno/lib",\ "dir_b": "src",\ "shared_files": ["client.ts", "handlers.ts", "types.ts", "utils.ts"],\ "total_lines": 6347\ }\ ] } Each entry identifies two directories with significant overlap, the shared filenames, and the total duplicated lines across those files. [​](https://docs.fallow.tools/cli/dupes#see-also) See also ------------------------------------------------------------- Duplication analysis -------------------- How fallow’s detection engine works. Configuration ------------- Set default modes and thresholds in your config. Migrating from jscpd -------------------- Coming from jscpd? See the migration guide. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/dupes.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/dupes) [Previous](https://docs.fallow.tools/cli/dead-code) [fallow healthCLI reference for fallow health. Analyze function complexity, per-file maintainability, git-churn hotspots, refactoring targets, static coverage gaps, and runtime runtime coverage.\ \ Next](https://docs.fallow.tools/cli/health) ⌘I On this page * [Options](https://docs.fallow.tools/cli/dupes#options) * [Detection](https://docs.fallow.tools/cli/dupes#detection) * [Output](https://docs.fallow.tools/cli/dupes#output) * [Incremental](https://docs.fallow.tools/cli/dupes#incremental) * [Monorepo scoping](https://docs.fallow.tools/cli/dupes#monorepo-scoping) * [Debugging](https://docs.fallow.tools/cli/dupes#debugging) * [Detection modes](https://docs.fallow.tools/cli/dupes#detection-modes) * [Examples](https://docs.fallow.tools/cli/dupes#examples) * [Example output](https://docs.fallow.tools/cli/dupes#example-output) * [JSON output](https://docs.fallow.tools/cli/dupes#json-output) * [mirrored\_directories](https://docs.fallow.tools/cli/dupes#mirrored_directories) * [See also](https://docs.fallow.tools/cli/dupes#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/flags#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow flags [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Detect feature flag patterns in your codebase. Fallow identifies environment variable flags (`process.env.FEATURE_*`), SDK calls (LaunchDarkly, Statsig, Unleash, GrowthBook), and config object patterns (opt-in). Reports flag locations, detection confidence, and cross-references with dead code findings. Use `fallow flags --format json` for structured output that agents and scripts can parse. Combine with `--top N` to focus on the most common flags. fallow flags [​](https://docs.fallow.tools/cli/flags#options) Options ----------------------------------------------------------- ### [​](https://docs.fallow.tools/cli/flags#output) Output | Flag | Description | | --- | --- | | `--top ` | Show only the top N flags | | `-f, --format ` | Output format: `human` (default), `json`, `sarif`, `compact`, `markdown`, `codeclimate` | | `-q, --quiet` | Suppress progress output | | `--explain` | Add metric explanations. In JSON format, adds a `_meta` object with descriptions and docs links. | | `--summary` | Print a one-line summary of flag counts at the end of the run. In JSON format, adds a `summary` counts object. | ### [​](https://docs.fallow.tools/cli/flags#scoping) Scoping | Flag | Description | | --- | --- | | `-r, --root ` | Project root directory (default: current working directory) | | `-c, --config ` | Path to config file (default: auto-detected) | | `-w, --workspace ` | Scope output to a single workspace package | | `--changed-since ` | Only report flags in files changed since a git ref | | `--production` | Production mode: exclude test/story/dev files | ### [​](https://docs.fallow.tools/cli/flags#performance) Performance | Flag | Description | | --- | --- | | `--no-cache` | Disable incremental caching (force full re-parse) | | `--threads ` | Number of parser threads (default: available parallelism) | | `--performance` | Show pipeline timing breakdown | ### [​](https://docs.fallow.tools/cli/flags#ci) CI | Flag | Description | | --- | --- | | `--ci` | CI mode: equivalent to `--format sarif --fail-on-issues --quiet` | | `--fail-on-issues` | Exit with code 1 if flags are found | | `--sarif-file ` | Write SARIF output to a file (in addition to `--format`) | | `--group-by ` | Group output by `owner` (CODEOWNERS), `directory` (first path component), `package` (workspace package), or `section` (GitLab CODEOWNERS `[Section]` headers). See [global flags](https://docs.fallow.tools/cli/global-flags#grouped-output)
. | ### [​](https://docs.fallow.tools/cli/flags#regression) Regression | Flag | Description | | --- | --- | | `--baseline ` | Compare against a previously saved baseline file | | `--save-baseline ` | Save current results as a baseline file | | `--fail-on-regression` | Fail if flag count increased beyond tolerance vs a regression baseline | | `--tolerance ` | Allowed increase: `"2%"` (percentage) or `"5"` (absolute). Default: `"0"` | | `--regression-baseline ` | Path to regression baseline file (default: `.fallow/regression-baseline.json`) | | `--save-regression-baseline ` | Save current flag counts as a regression baseline | [​](https://docs.fallow.tools/cli/flags#detection-categories) Detection categories ------------------------------------------------------------------------------------- Fallow detects three categories of feature flag patterns: | Category | What it finds | Examples | | --- | --- | --- | | **Environment variable flags** | `process.env.*` checks used as feature gates | `process.env.FEATURE_NEW_UI`, `process.env.ENABLE_DARK_MODE` | | **SDK calls** | Feature flag SDK method calls from known providers | LaunchDarkly `variation()`, Statsig `checkGate()`, Unleash `isEnabled()`, GrowthBook `isOn()` | | **Config object patterns** | Object property lookups used as boolean guards (opt-in) | `config.featureX`, `settings.enableNewFlow` | Each detected flag includes a confidence level indicating how certain fallow is that the pattern represents a feature flag. [​](https://docs.fallow.tools/cli/flags#examples) Examples ------------------------------------------------------------- Basic analysis CI integration Scoping # Detect all feature flags fallow flags # Show only the top 10 flags fallow flags --top 10 [​](https://docs.fallow.tools/cli/flags#json-output) JSON output ------------------------------------------------------------------- $ fallow flags --format json { "schema_version": 3, "version": "2.51.0", "elapsed_ms": 116, "feature_flags": [], "total_flags": 0 } ### [​](https://docs.fallow.tools/cli/flags#key-fields) Key fields | Field | Type | Description | | --- | --- | --- | | `schema_version` | integer | JSON schema version (currently 3) | | `version` | string | Fallow version that produced the output | | `elapsed_ms` | integer | Analysis duration in milliseconds | | `feature_flags` | array | Detected feature flag patterns | | `total_flags` | integer | Total number of detected flags | [​](https://docs.fallow.tools/cli/flags#mcp-tool) MCP tool ------------------------------------------------------------- The `feature_flags` MCP tool wraps `fallow flags --format json --quiet --explain`: Example request { "tool": "feature_flags", "arguments": { "top": 10 } } The response always includes `_meta` explanatory metadata (the MCP wrapper enables `--explain` by default). Returns the same JSON envelope as the CLI. See [MCP integration](https://docs.fallow.tools/integrations/mcp) for setup instructions. [​](https://docs.fallow.tools/cli/flags#see-also) See also ------------------------------------------------------------- Dead code analysis ------------------ Cross-references feature flags with dead code findings. Global flags ------------ Flags available on every fallow command. MCP integration --------------- Use fallow tools from AI coding agents. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/flags.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/flags) [Previous](https://docs.fallow.tools/cli/coverage) [fallow auditCLI reference for fallow audit. Combined dead code, complexity, and duplication analysis scoped to changed files, with a pass/warn/fail verdict for PR quality gates and AI-generated code review.\ \ Next](https://docs.fallow.tools/cli/audit) ⌘I On this page * [Options](https://docs.fallow.tools/cli/flags#options) * [Output](https://docs.fallow.tools/cli/flags#output) * [Scoping](https://docs.fallow.tools/cli/flags#scoping) * [Performance](https://docs.fallow.tools/cli/flags#performance) * [CI](https://docs.fallow.tools/cli/flags#ci) * [Regression](https://docs.fallow.tools/cli/flags#regression) * [Detection categories](https://docs.fallow.tools/cli/flags#detection-categories) * [Examples](https://docs.fallow.tools/cli/flags#examples) * [JSON output](https://docs.fallow.tools/cli/flags#json-output) * [Key fields](https://docs.fallow.tools/cli/flags#key-fields) * [MCP tool](https://docs.fallow.tools/cli/flags#mcp-tool) * [See also](https://docs.fallow.tools/cli/flags#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/migrate#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow migrate [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Auto-migrate your existing knip and/or jscpd configuration to fallow. The migrate command reads your current config, translates it to fallow’s format, and writes a new config file. If both knip and jscpd configs exist in your project, fallow merges them into a single unified config. Use `--dry-run` to preview the generated config before writing anything to disk. fallow migrate [​](https://docs.fallow.tools/cli/migrate#options) Options ------------------------------------------------------------- | Flag | Description | | --- | --- | | `--toml` | Output as `fallow.toml` instead of `.fallowrc.json` | | `--dry-run` | Preview the generated config without writing | | `--from ` | Path to the config file to migrate | [​](https://docs.fallow.tools/cli/migrate#what-it-detects) What it detects ----------------------------------------------------------------------------- Fallow auto-detects: * `knip.json`, `knip.jsonc`, `.knip.json`, `.knip.jsonc`, `knip.ts`, `knip.config.ts` * `knip` field in `package.json` TypeScript config files (`knip.ts`, `knip.config.ts`) are detected but cannot be parsed. Convert to `knip.json` first, then re-run migrate. * `.jscpd.json` * `jscpd` field in `package.json` [​](https://docs.fallow.tools/cli/migrate#examples) Examples --------------------------------------------------------------- Auto-detect Output format Specific file # Detect config files and migrate fallow migrate # Preview without writing fallow migrate --dry-run Warnings are shown for any config fields that can’t be migrated automatically. [​](https://docs.fallow.tools/cli/migrate#see-also) See also --------------------------------------------------------------- Migrating from knip ------------------- Detailed comparison and migration guide from knip. Migrating from jscpd -------------------- Detailed comparison and migration guide from jscpd. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/migrate.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/migrate) [Previous](https://docs.fallow.tools/cli/init) [fallow listCLI reference for fallow list. Inspect discovered files, entry points, active plugins, and architecture boundary zones to debug configuration and verify project setup.\ \ Next](https://docs.fallow.tools/cli/list) ⌘I On this page * [Options](https://docs.fallow.tools/cli/migrate#options) * [What it detects](https://docs.fallow.tools/cli/migrate#what-it-detects) * [Examples](https://docs.fallow.tools/cli/migrate#examples) * [See also](https://docs.fallow.tools/cli/migrate#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/global-flags#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands Global flags [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. These flags are available on every fallow command (`dead-code`, `check`, `dupes`, `health`, `flags`, `fix`, `watch`, `list`, `init`, `migrate`). [​](https://docs.fallow.tools/cli/global-flags#reference) Reference ---------------------------------------------------------------------- | Flag | Description | | --- | --- | | `-r, --root ` | Project root directory (default: current working directory) | | `-c, --config ` | Path to config file (default: auto-detected) | | `-f, --format ` | Output format: `human` (default), `json`, `sarif`, `compact`, `markdown`, `codeclimate`. Alias: `--output` | | `-q, --quiet` | Suppress progress bars and status messages | | `--no-cache` | Disable incremental caching (force full re-parse) | | `--threads ` | Number of parser threads (default: available parallelism) | | `--changed-since ` (alias: `--base`) | Only report issues in files changed since this git ref | | `--baseline ` | Compare against a previously saved baseline file | | `--save-baseline ` | Save the current results as a baseline file | | `--fail-on-regression` | Fail if issue count increased beyond tolerance vs a regression baseline | | `--tolerance ` | Allowed increase: `"2%"` (percentage) or `"5"` (absolute). Default: `"0"` | | `--regression-baseline ` | Path to regression baseline file (default: `.fallow/regression-baseline.json`) | | `--save-regression-baseline ` | Save current issue counts as a regression baseline | | `--production` | Production mode: exclude test/story/dev files, only start/build scripts | | `--production-dead-code` | Per-analysis production mode for dead-code in bare combined runs and `fallow audit`. See [Per-analysis production mode](https://docs.fallow.tools/cli/global-flags#per-analysis-production-mode)
. | | `--production-health` | Per-analysis production mode for health in bare combined runs and `fallow audit`. | | `--production-dupes` | Per-analysis production mode for duplication in bare combined runs and `fallow audit`. | | `-w, --workspace ` | Scope output to one or more workspaces. Accepts exact names, globs matched against both the package name AND the workspace path (`apps/*`, `@scope/*`), and `!`\-prefixed negations (`!apps/legacy`). Values can be comma-separated (`-w web,admin`) or the flag can be repeated. Quote patterns containing `!` or glob chars to avoid shell expansion. | | `--changed-workspaces ` | Git-derived monorepo CI scoping: scope output to workspaces containing any file changed since `REF` (e.g. `origin/main`, `HEAD~1`). Auto-derives the workspace set from `git diff` so CI jobs don’t hand-maintain a `--workspace` list. Mutually exclusive with `--workspace`. A missing ref or non-git directory is a hard error (exit 2), not a silent full-scope fallback. Root-only diffs map to 0 workspaces and exit 0 with no issues. | | `--performance` | Show pipeline timing breakdown | | `--explain` | Include metric definitions in JSON output (`_meta` object). Always enabled for MCP | | `--ci` | CI mode: equivalent to `--format sarif --fail-on-issues --quiet` | | `--fail-on-issues` | Exit with code 1 if issues are found | | `--sarif-file ` | Write SARIF output to a file (in addition to the primary `--format` output) | | `--group-by ` | Group output by CODEOWNERS ownership (`owner`), first directory component (`directory`), workspace package (`package`), or GitLab CODEOWNERS section (`section`). When active, all output formats partition issues into labeled groups. | | `--summary` | Print a one-line summary of issue counts at the end of the run. In JSON format, adds a `summary` counts object to the output. | | `--only ` | Run only specific analyses when no subcommand is given | | `--skip ` | Skip specific analyses when no subcommand is given | | `--score` | Compute health score (0-100 with letter grade) in combined mode. Enables the health delta header in PR comments. Also available on [`fallow health`](https://docs.fallow.tools/cli/health)
. | | `--trend` | Compare current health metrics against the most recent saved snapshot. Implies `--score`. Also available on [`fallow health`](https://docs.fallow.tools/cli/health)
. | | `--save-snapshot [PATH]` | Save a vital signs snapshot for trend tracking. Default path: `.fallow/snapshots/.json`. Forces file-scores and hotspot computation. Also available on [`fallow health`](https://docs.fallow.tools/cli/health)
. | [​](https://docs.fallow.tools/cli/global-flags#loaded-config-disclosure) Loaded config disclosure ---------------------------------------------------------------------------------------------------- When fallow loads a config file (either auto-discovered or via `--config`), it prints a single line to **stderr**: loaded config: /repo/.fallowrc.json This makes it obvious which `.fallowrc.json` is in effect, especially in monorepos where multiple configs may exist. The line is suppressed when: * `--quiet` is set * `--format` is anything other than `human` (`json`, `sarif`, `compact`, `markdown`, `codeclimate`) For deeper inspection (the resolved config with `extends` merged), use the dedicated [`fallow config`](https://docs.fallow.tools/cli/config) subcommand. [​](https://docs.fallow.tools/cli/global-flags#examples) Examples -------------------------------------------------------------------- # Analyze a project in a different directory fallow dead-code -r /path/to/project # Use a specific config file fallow dead-code -c configs/fallow-strict.json # JSON output with no progress messages fallow dead-code -f json --quiet # Limit parallelism to 4 threads fallow dead-code --threads 4 # Scope to a single workspace package fallow dead-code -w @myorg/ui # Scope to whichever workspaces changed since origin/main (CI primitive) fallow --changed-workspaces origin/main # Show timing breakdown fallow dead-code --performance # Group issues by CODEOWNERS ownership fallow dead-code --group-by owner # Group issues by top-level directory fallow dead-code --group-by directory # Group issues by workspace package fallow dead-code --group-by package # Group issues by GitLab CODEOWNERS section fallow dead-code --group-by section # Health score in combined mode fallow --score # Save a snapshot and track trends fallow --save-snapshot fallow --trend [​](https://docs.fallow.tools/cli/global-flags#per-analysis-production-mode) Per-analysis production mode ------------------------------------------------------------------------------------------------------------ Bare combined runs (`fallow` with no subcommand) and `fallow audit` accept three per-analysis production flags so you can enable production mode for one analysis without forcing it on the others: # Treat health as production-only, leave dead-code and dupes in full-tree mode fallow --production-health # Audit changed files with production-only health fallow audit --base main --production-health The matching environment variables `FALLOW_PRODUCTION_DEAD_CODE`, `FALLOW_PRODUCTION_HEALTH`, and `FALLOW_PRODUCTION_DUPES` accept the same set of values as `FALLOW_PRODUCTION` (`true`, `false`, `1`, `0`, `yes`, `no`, `on`, `off`). The `production` config field also accepts a per-analysis object: { "production": { "deadCode": false, "health": true, "dupes": false } } **Precedence (highest to lowest)**: CLI flags (`--production`, `--production-{dead-code,health,dupes}`), per-analysis env var (`FALLOW_PRODUCTION_HEALTH`, etc.), global env var (`FALLOW_PRODUCTION`), config (`production: { ... }` or `production: true`). The legacy boolean form (`--production`, `production: true`, `FALLOW_PRODUCTION=true`) is unchanged and still applies to every analysis. The per-analysis CLI flags are rejected when used with a subcommand other than `audit` (e.g. `fallow dead-code --production-health` errors). Use the bare command or the per-analysis env vars in that case. [​](https://docs.fallow.tools/cli/global-flags#grouped-output) Grouped output -------------------------------------------------------------------------------- The `--group-by` flag partitions all issues into labeled groups. This works with every output format and every subcommand. | Mode | Grouping | Requires | | --- | --- | --- | | `owner` | CODEOWNERS file ownership. Auto-probes `CODEOWNERS`, `.github/CODEOWNERS`, `.gitlab/CODEOWNERS`, `docs/CODEOWNERS`. First owner on multi-owner lines wins. | A CODEOWNERS file (or set `codeowners` in config) | | `directory` | First path component (e.g. `src/utils/foo.ts` groups under `src`) | Nothing | | `package` | Workspace package name (e.g. `@myorg/ui`). Issues are grouped by the package they belong to. | A monorepo with workspace packages | | `section` | GitLab CODEOWNERS `[Section]` header name. Distinct sections stay in distinct groups even when they share a default reviewer, so teams with one shared lead reviewer across many sections get per-section triage instead of one giant bucket. | A GitLab-style CODEOWNERS file with at least one `[Section]` header | With `--format json`, the output shape changes to a grouped envelope: { "grouped_by": "owner", "total_issues": 12, "groups": [\ { "key": "@frontend-team", "total_issues": 8, "unused_files": [], "unused_exports": [] },\ { "key": "@backend-team", "total_issues": 4, "unused_exports": [] }\ ] } For `--group-by section`, each group also carries an `owners` array with the section’s default owners: { "grouped_by": "section", "total_issues": 6, "groups": [\ {\ "key": "billing",\ "owners": ["@core-reviewers", "@alice", "@bob"],\ "total_issues": 2,\ "unused_exports": []\ },\ {\ "key": "notifications",\ "owners": ["@core-reviewers", "@alice", "@bob"],\ "total_issues": 1,\ "unused_exports": []\ }\ ] } Section and owner groups are not interchangeable: `owner` collapses all sections that share a lead reviewer into a single bucket, while `section` preserves the `[Section]` headers as stable group keys across reviewer rotation. Set a custom CODEOWNERS path via the `codeowners` field in `.fallowrc.json` if your file isn’t in a standard location. [​](https://docs.fallow.tools/cli/global-flags#incremental-caching) Incremental caching ------------------------------------------------------------------------------------------ Fallow caches parsed file data between runs to skip unchanged files. On the second run, only modified files are re-parsed. The rest are loaded from cache. **How it works:** 1. Each file is hashed with [xxh3](https://github.com/Cyan4973/xxHash) (extremely fast, non-cryptographic) 2. If the hash matches the cached version, parsing is skipped entirely 3. The module graph is rebuilt from cached + freshly-parsed data Use `--performance` to see cache hit rates and per-stage timings. This is helpful for diagnosing slow runs. fallow dead-code --performance Discovery 12ms (142 files) Parsing 48ms (23 parsed, 119 cached) Resolution 15ms Analysis 8ms Total 83ms Use `--no-cache` to force a full re-parse. This is useful after major refactors or when debugging unexpected results. fallow dead-code --no-cache `--no-cache` makes every run a cold start. Use it only for debugging unexpected results. [​](https://docs.fallow.tools/cli/global-flags#see-also) See also -------------------------------------------------------------------- Environment variables --------------------- Set defaults for format and quiet mode via environment variables. Configuration ------------- Full config file reference for project-level settings. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/global-flags.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/global-flags) [Previous\ \ fallow configShow the resolved fallow config and which file was loaded. Mirrors eslint --print-config and dprint output-resolved-config.](https://docs.fallow.tools/cli/config) ⌘I On this page * [Reference](https://docs.fallow.tools/cli/global-flags#reference) * [Loaded config disclosure](https://docs.fallow.tools/cli/global-flags#loaded-config-disclosure) * [Examples](https://docs.fallow.tools/cli/global-flags#examples) * [Per-analysis production mode](https://docs.fallow.tools/cli/global-flags#per-analysis-production-mode) * [Grouped output](https://docs.fallow.tools/cli/global-flags#grouped-output) * [Incremental caching](https://docs.fallow.tools/cli/global-flags#incremental-caching) * [See also](https://docs.fallow.tools/cli/global-flags#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/watch#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow watch [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Watch mode re-runs unused code analysis automatically when files change, giving you continuous feedback as you edit. Use watch mode during refactoring sessions. Each save immediately re-runs the analysis. fallow watch Fallow watches your project files and re-analyzes with debouncing when changes are detected. Press `Ctrl+C` to stop. Watch mode supports all [global flags](https://docs.fallow.tools/cli/global-flags) (like `--format`, `--production`, `--quiet`). Check-specific flags like `--unused-exports` or `--fail-on-issues` are not available. [​](https://docs.fallow.tools/cli/watch#options) Options ----------------------------------------------------------- All [global flags](https://docs.fallow.tools/cli/global-flags) are supported: fallow watch --format compact fallow watch --production fallow watch --quiet [​](https://docs.fallow.tools/cli/watch#examples) Examples ------------------------------------------------------------- Basic watch Filtered watch fallow watch [​](https://docs.fallow.tools/cli/watch#example-output) Example output ------------------------------------------------------------------------- $ fallow watch Watching 1,008 files for changes... [10:23:15] File changed: src/server/jobs/queue.ts [10:23:15] Re-analyzing... ● Unused exports (2) src/server/jobs/queue.ts :61 enqueueJobDelayed :206 sweepStuckProcessingJobs Exported symbols with zero references — https://docs.fallow.tools/explanations/dead-code#unused-exports ✗ 2 issues (0.04s) [10:23:42] File changed: src/server/jobs/queue.ts [10:23:42] Re-analyzing... No issues found (0.03s) ✓ [​](https://docs.fallow.tools/cli/watch#see-also) See also ------------------------------------------------------------- Unused code analysis -------------------- How fallow detects unused code. fallow dead-code ---------------- Full reference for all options available in watch mode. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/watch.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/watch) [Previous](https://docs.fallow.tools/cli/fix) [fallow initCLI reference for fallow init. Generate a .fallowrc.json or fallow.toml configuration file with schema support for editor autocomplete.\ \ Next](https://docs.fallow.tools/cli/init) ⌘I On this page * [Options](https://docs.fallow.tools/cli/watch#options) * [Examples](https://docs.fallow.tools/cli/watch#examples) * [Example output](https://docs.fallow.tools/cli/watch#example-output) * [See also](https://docs.fallow.tools/cli/watch#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/license#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow license [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Manage the local license used for paid runtime-coverage features. fallow license status Verification is offline against an Ed25519 public key compiled into the binary. Only the trial and refresh flows make network requests to `api.fallow.cloud`. [​](https://docs.fallow.tools/cli/license#subcommands) Subcommands --------------------------------------------------------------------- ### [​](https://docs.fallow.tools/cli/license#activate) `activate` Activate a local JWT or start a 30-day email-gated trial. fallow license activate --trial --email you@company.com fallow license activate eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9... fallow license activate --from-file ./license.jwt cat ./license.jwt | fallow license activate --stdin JWT input precedence is: 1. positional JWT argument 2. `--from-file ` 3. `--stdin` Whitespace is normalized before verification, so copied multiline tokens still work. #### [​](https://docs.fallow.tools/cli/license#flags) Flags | Flag | Description | | --- | --- | | `--trial` | Start a 30-day email-gated trial instead of reading a JWT locally. Requires `--email`. Rate-limited to **5 requests per hour per IP**; in CI or behind a shared NAT, start the trial from a developer machine and set `FALLOW_LICENSE` on the runner. | | `--email ` | Email address for the trial flow. On success, fallow also prints the server-reported `trialEndsAt` ISO timestamp so you do not need to decode the JWT. | | `--from-file ` | Read a JWT from a file. | | `--stdin` | Read a JWT from standard input. | ### [​](https://docs.fallow.tools/cli/license#status) `status` Print the current license status, tier, seats, enabled features, and expiry state. fallow license status Example output: license: VALID, tier=trial seats=1 features=runtime_coverage days_until_expiry=29 → runtime_coverage: ENABLED If the token is expired but still in the grace window, fallow reports that explicitly and tells you to refresh it. If no token is present, the command suggests starting a trial. If the JWT includes a `refresh_after` claim (issued at `iat + 15 days` by `api.fallow.cloud`) and that timestamp has already passed, `status` appends a one-line refresh hint. This is a proactive nudge while the license is still valid, not an error. ### [​](https://docs.fallow.tools/cli/license#refresh) `refresh` Fetch a fresh JWT for the currently active license. fallow license refresh This is the preferred way to renew a token before the hard-fail window is reached. ### [​](https://docs.fallow.tools/cli/license#deactivate) `deactivate` Remove the local license file. fallow license deactivate [​](https://docs.fallow.tools/cli/license#storage-and-precedence) Storage and precedence ------------------------------------------------------------------------------------------- By default, the local token is stored at `~/.fallow/license.jwt`. On Unix, fallow writes the file with mode `0600` (owner read/write only) so other users on the same host cannot read the bearer token. Windows relies on the ACL of the containing directory. Lookup precedence is: 1. `FALLOW_LICENSE` 2. `FALLOW_LICENSE_PATH` 3. `~/.fallow/license.jwt` Use `FALLOW_LICENSE` on shared CI runners where writing to a user home directory is not desirable. [​](https://docs.fallow.tools/cli/license#exit-behavior) Exit behavior ------------------------------------------------------------------------- Common outcomes: | Situation | Result | | --- | --- | | Valid license | exit code `0` | | No license or hard-fail expired license | non-zero status | | Network failure during `--trial` or `refresh` | exit code `7` | | Malformed or truncated JWT | non-zero status with a verification error | ### [​](https://docs.fallow.tools/cli/license#actionable-error-messages) Actionable error messages When the backend returns a structured error envelope, fallow maps known `code` values to targeted hints instead of printing the raw HTTP body: | Operation + code | Message | | --- | --- | | `refresh` + `token_stale` | `your stored license is too stale to refresh. Reactivate with: fallow license activate --trial --email ` (fires when the stored JWT is more than 45 days past its `exp`) | | `refresh` + `invalid_token` | `your stored license token is missing required claims. Reactivate with: fallow license activate --trial --email ` | | `refresh` or `trial` + `unauthorized` | `authentication failed. Reactivate with: fallow license activate --trial --email ` | | `trial` + `rate_limit_exceeded` | `trial creation is rate-limited to 5 per hour per IP. Wait an hour or retry from a different network (in CI, start the trial locally and set FALLOW_LICENSE on the runner).` | For unknown codes, fallow surfaces the backend’s `message` field if present, otherwise the raw body. [​](https://docs.fallow.tools/cli/license#see-also) See also --------------------------------------------------------------- Runtime coverage ---------------- Understand what the paid runtime-coverage layer adds on top of health analysis. Coverage setup -------------- Guided first-run workflow that bootstraps the sidecar and writes a collection recipe. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/license.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/license) [Previous](https://docs.fallow.tools/cli/health) [fallow coverageCLI reference for fallow coverage. Run the resumable setup flow and push a static function inventory so the dashboard can surface untracked code.\ \ Next](https://docs.fallow.tools/cli/coverage) ⌘I On this page * [Subcommands](https://docs.fallow.tools/cli/license#subcommands) * [activate](https://docs.fallow.tools/cli/license#activate) * [Flags](https://docs.fallow.tools/cli/license#flags) * [status](https://docs.fallow.tools/cli/license#status) * [refresh](https://docs.fallow.tools/cli/license#refresh) * [deactivate](https://docs.fallow.tools/cli/license#deactivate) * [Storage and precedence](https://docs.fallow.tools/cli/license#storage-and-precedence) * [Exit behavior](https://docs.fallow.tools/cli/license#exit-behavior) * [Actionable error messages](https://docs.fallow.tools/cli/license#actionable-error-messages) * [See also](https://docs.fallow.tools/cli/license#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis/auto-fix#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis Auto-fix [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. `fallow fix` removes unused exports and unused dependencies from your codebase. In agent workflows, `fallow fix --yes --format json` cleans up dead code non-interactively after code generation. Always commit your changes before running `fallow fix`. Git lets you undo if needed. [​](https://docs.fallow.tools/analysis/auto-fix#recommended-workflow) Recommended workflow --------------------------------------------------------------------------------------------- 1 [](https://docs.fallow.tools/analysis/auto-fix#) Preview changes Run a dry run to see exactly what would be removed without making any changes. fallow fix --dry-run $ fallow fix --dry-run Would remove export from src/components/Card/index.ts:1 `CardFooter` Would remove export from src/providers/trpc-provider/index.tsx:12 `TRPCProvider` Would remove export from src/server/jobs/queue.ts:61 `enqueueJobDelayed` Would remove export from src/server/jobs/queue.ts:206 `sweepStuckProcessingJobs` Would remove export from src/server/jobs/queue.ts:276 `getDeadLetterJobs` Would remove `@trpc/react-query` from dependencies 6 fixes available (5 exports, 1 dependency). Run without --dry-run to apply. 2 [](https://docs.fallow.tools/analysis/auto-fix#) Review the output Check that every proposed removal is safe. Pay attention to exports consumed by external packages or dynamic imports that fallow can’t detect statically. fallow fix --dry-run --format json 3 [](https://docs.fallow.tools/analysis/auto-fix#) Apply fixes After reviewing the preview, apply the changes. In interactive terminals, fallow asks for confirmation before writing. fallow fix In CI or non-TTY environments, use `--yes` to skip confirmation: fallow fix --yes Agents typically use `fallow fix --yes --format json` to apply fixes non-interactively. The JSON output confirms exactly what was changed, so the agent can verify the result. 4 [](https://docs.fallow.tools/analysis/auto-fix#) Verify the result Run your build and tests to confirm nothing broke. npm run build && npm test [​](https://docs.fallow.tools/analysis/auto-fix#what-gets-fixed) What gets fixed ----------------------------------------------------------------------------------- * **Unused exports**: the `export` keyword is removed, keeping the declaration * **Unused dependencies**: removed from `package.json` when they are not imported by another workspace * **Unused enum members**: removed from the enum declaration Auto-fix does not delete entire files or remove unused class members. Use `fallow dead-code` to find those and remove them manually. [​](https://docs.fallow.tools/analysis/auto-fix#json-output) JSON output --------------------------------------------------------------------------- For scripting, CI, and agent workflows: fallow fix --dry-run --format json { "changes": [\ {\ "type": "remove-export",\ "file": "src/components/Card/index.ts",\ "symbol": "CardFooter",\ "line": 1\ },\ {\ "type": "remove-export",\ "file": "src/providers/trpc-provider/index.tsx",\ "symbol": "TRPCProvider",\ "line": 12\ },\ {\ "type": "remove-export",\ "file": "src/server/jobs/queue.ts",\ "symbol": "enqueueJobDelayed",\ "line": 61\ },\ {\ "type": "remove-export",\ "file": "src/server/jobs/queue.ts",\ "symbol": "sweepStuckProcessingJobs",\ "line": 206\ },\ {\ "type": "remove-export",\ "file": "src/server/jobs/queue.ts",\ "symbol": "getDeadLetterJobs",\ "line": 276\ },\ {\ "type": "remove-dependency",\ "package": "@trpc/react-query"\ }\ ], "summary": { "total_changes": 6, "exports_removed": 5, "dependencies_removed": 1 } } [​](https://docs.fallow.tools/analysis/auto-fix#see-also) See also --------------------------------------------------------------------- CLI: fix -------- Full reference for the `fallow fix` command and its flags. Dead Code Analysis ------------------ Understand what fallow detects before auto-fixing. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/analysis/auto-fix.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/analysis/auto-fix) [Previous](https://docs.fallow.tools/analysis/boundaries) [Runtime coverageMerge runtime coverage into fallow health to see which functions actually execute in production-like traffic, which stay cold, and which hot paths changed.\ \ Next](https://docs.fallow.tools/analysis/runtime-coverage) ⌘I On this page * [Recommended workflow](https://docs.fallow.tools/analysis/auto-fix#recommended-workflow) * [What gets fixed](https://docs.fallow.tools/analysis/auto-fix#what-gets-fixed) * [JSON output](https://docs.fallow.tools/analysis/auto-fix#json-output) * [See also](https://docs.fallow.tools/analysis/auto-fix#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/list#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow list [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Inspect what fallow discovered in your project. Use this command to debug configuration issues or verify that the right files, entry points, plugins, and boundary zones are being picked up. Use `fallow list --plugins` to verify which of the 90 built-in plugins are active for your project. fallow list [​](https://docs.fallow.tools/cli/list#options) Options ---------------------------------------------------------- | Flag | Description | | --- | --- | | `--files` | Show all discovered files | | `--entry-points` | Show entry point files | | `--plugins` | Show active plugins | | `--boundaries` | Show architecture boundary zones, rules, and per-zone file counts | | `-f, --format ` | Output format: `human` (default), `json` | [​](https://docs.fallow.tools/cli/list#examples) Examples ------------------------------------------------------------ Inspect plugins Inspect files Inspect boundaries # Show active plugins fallow list --plugins # JSON output for scripting fallow list --plugins --format json [​](https://docs.fallow.tools/cli/list#example-output) Example output ------------------------------------------------------------------------ $ fallow list --boundaries Boundaries: 4 zones, 4 rules Zones: app 3 files src/app/** features 12 files src/features/** shared 8 files src/components/**, src/hooks/**, src/lib/**, ... server 4 files src/server/** Rules: app → features, shared, server features → shared, server server → shared shared (isolated — no imports allowed) $ fallow list --plugins Active plugins: - nextjs - vite - vitest - playwright - storybook - eslint - typescript - tailwind - drizzle - commitlint - sentry $ fallow list --entry-points Found 42 entry points src/app/layout.tsx (Plugin: nextjs) src/app/page.tsx (Plugin: nextjs) src/instrumentation.ts (Plugin: nextjs) src/proxy.ts (Plugin: nextjs) src/lib/utils.test.ts (Plugin: vitest) e2e/auth.setup.ts (Plugin: playwright) .storybook/main.ts (Plugin: storybook) drizzle.config.ts (Plugin: drizzle) scripts/db-migrate.ts (PackageJsonScript) scripts/db-seed.ts (PackageJsonScript) ... Each entry point shows how it was discovered. The plugin name tells you which framework detected it. [​](https://docs.fallow.tools/cli/list#see-also) See also ------------------------------------------------------------ Built-in plugins ---------------- Full list of fallow’s 90 built-in framework plugins. Custom plugins -------------- Create plugins for frameworks fallow doesn’t cover yet. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/list.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/list) [Previous](https://docs.fallow.tools/cli/migrate) [fallow configShow the resolved fallow config and which file was loaded. Mirrors eslint --print-config and dprint output-resolved-config.\ \ Next](https://docs.fallow.tools/cli/config) ⌘I On this page * [Options](https://docs.fallow.tools/cli/list#options) * [Examples](https://docs.fallow.tools/cli/list#examples) * [Example output](https://docs.fallow.tools/cli/list#example-output) * [See also](https://docs.fallow.tools/cli/list#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/adoption#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Getting Started Adopt Fallow in an existing repo [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. This guide is for repositories that already have backlog: unused code, duplicates, complexity hotspots, and existing exceptions. By the end of this guide you will have: * a repo-level Fallow policy encoded in config * dead code fixed or intentionally modeled * duplication at or below your chosen threshold * complex functions refactored or consciously widened with a written justification * `fallow audit` enforcing the same policy on changed files [​](https://docs.fallow.tools/adoption#repo-clean-vs-pr-clean) Repo clean vs PR clean ---------------------------------------------------------------------------------------- These are different goals. Both matter. Do them in order. Repo clean (this guide) ----------------------- Full-repo analysis to understand and clean the whole codebase. Use `fallow`, `fallow dead-code`, `fallow dupes`, and `fallow health`. PR clean -------- Changed-files gate that enforces the policy on every PR. Use `fallow audit` after the repo is clean. Start with repo clean. Then turn on PR clean. [​](https://docs.fallow.tools/adoption#before-you-start) Before you start ---------------------------------------------------------------------------- Coming from knip? ----------------- Run `fallow migrate` first to port your knip config, then follow this guide. Large monorepo? --------------- Apply this flow per workspace package. Use `fallow --workspace ` and a shared root config. [​](https://docs.fallow.tools/adoption#1-first-run-get-the-whole-picture) 1\. First run: get the whole picture ----------------------------------------------------------------------------------------------------------------- From your project root: npx fallow Then the focused commands you will use during cleanup: npx fallow dead-code # Cleanup candidates npx fallow dupes # Repeated logic npx fallow health # Complexity and refactor targets If you do not yet have a config file: fallow init `fallow init` auto-detects your project structure (package manager, workspaces, frameworks) and generates a tailored starting config. It also adds `.fallow/` to your `.gitignore`. [​](https://docs.fallow.tools/adoption#2-decide-the-project-policy-before-triage) 2\. Decide the project policy before triage -------------------------------------------------------------------------------------------------------------------------------- Do not start by suppressing findings one by one. That path turns into an ever-growing list of inline exceptions and no coherent policy. Not the policy owner? Run section 3 first on a branch, then bring the findings into the policy discussion. Fallow output is a good forcing function for the “what do we actually care about” conversation. First decide, as a team: * what counts as a real entry point (workers, scripts, route files, dynamically loaded modules) * which files are generated or out of scope * which packages are public APIs that ship exports outside the repo * which dependencies are runtime-provided or intentionally retained * which health thresholds you actually want to enforce * whether duplication should warn or fail A reasonable starting point: { "$schema": "https://raw.githubusercontent.com/fallow-rs/fallow/main/schema.json", "ignorePatterns": ["**/*.generated.ts", "**/*.d.ts"], "rules": { "unresolved-imports": "error", "unlisted-dependencies": "error", "unused-exports": "warn" } } Rules you do not list inherit their defaults. Health thresholds default to `maxCyclomatic: 20` and `maxCognitive: 15`; override in a `health` block only when your repo’s realistic baseline differs. Use `warn` during rollout when you need visibility without blocking CI. Promote rules to `error` as the backlog shrinks. See the [rules reference](https://docs.fallow.tools/configuration/rules) for every issue type and severity. [​](https://docs.fallow.tools/adoption#3-work-findings-in-the-right-order) 3\. Work findings in the right order ------------------------------------------------------------------------------------------------------------------ Use this order for most existing repos. Each step removes noise that would otherwise distort the next step. 1 [](https://docs.fallow.tools/adoption#) Fix unresolved imports and unlisted dependencies High confidence, low debate. These are real bugs waiting to happen and should be cleared first. npx fallow dead-code --unresolved-imports npx fallow dead-code --unlisted-deps 2 [](https://docs.fallow.tools/adoption#) Delete unused files Unreachable files are usually safe cleanup. Use `fallow list --entry-points` to sanity-check reachability before deleting anything you are unsure about. npx fallow dead-code --unused-files npx fallow list --entry-points 3 [](https://docs.fallow.tools/adoption#) Remove unused dependencies Remove dead packages early. This reduces noise in later steps and speeds up installs. npx fallow dead-code --unused-deps 4 [](https://docs.fallow.tools/adoption#) Clean up unused exports, types, enum members, and class members Usually the biggest category. Fix real dead code. Model intentional API surface with visibility tags or config instead of suppressing it. Hand this step to an agent using the [prompt in section 8](https://docs.fallow.tools/adoption#8-clean-up-with-an-agent) : the findings are mechanical but the decisions (delete vs. mark `@public` vs. add to `entry`) benefit from code-aware judgement. npx fallow dead-code --unused-exports --unused-types Add `--unused-enum-members` and `--unused-class-members` when you want to focus on those categories explicitly. See the [`fallow dead-code` reference](https://docs.fallow.tools/cli/dead-code) for every filter flag. 5 [](https://docs.fallow.tools/adoption#) Consolidate duplication Merge repeated logic into shared helpers. Only ignore generated or template-heavy files when the duplication is genuinely intentional. npx fallow dupes npx fallow dupes --mode semantic # also catch renamed-variable clones 6 [](https://docs.fallow.tools/adoption#) Split health hotspots `fallow health` output includes Hotspots and Targets sections that rank the worst offenders. Use those to prioritize. Do not bike-shed every file above the mean. npx fallow health [​](https://docs.fallow.tools/adoption#4-match-the-reason-to-the-right-mechanism) 4\. Match the reason to the right mechanism -------------------------------------------------------------------------------------------------------------------------------- Do not default to inline suppression. Pick the mechanism that matches the reason. ### [​](https://docs.fallow.tools/adoption#external-or-public-api) External or public API Exports consumed outside the repo (published libraries, SDKs, public packages). Prefer, in order: * `@public`, `@internal`, `@beta`, `@alpha` JSDoc visibility tags on the export * [`publicPackages`](https://docs.fallow.tools/configuration/overview#publicpackages) as the coarse switch for “this whole package is external API” * [`ignoreExports`](https://docs.fallow.tools/configuration/overview#ignoreexports) only when file-level or export-level exceptions cannot be expressed any other way `publicPackages` and visibility tags are complementary, not alternatives: `publicPackages` marks the package as externally consumed; `@public`/`@internal` tags distinguish public API from internal helpers that happen to be exported for cross-file use. ### [​](https://docs.fallow.tools/adoption#framework-or-runtime-discovered-entry-points) Framework or runtime-discovered entry points Files your framework or runtime invokes but no other module imports directly (workers, CLI scripts, route files, plugin modules). Prefer, in order: * built-in plugin detection (Next.js, Vite, NestJS, Remotion, and [dozens more](https://docs.fallow.tools/frameworks/built-in) are handled out of the box) * [`entry`](https://docs.fallow.tools/configuration/overview#entry) for project-specific entry globs * [`dynamicallyLoaded`](https://docs.fallow.tools/configuration/overview#dynamicallyloaded) for code pulled in through reflection, manifests, or dynamic imports * `fallow list --entry-points` to inspect what Fallow already considers reachable ### [​](https://docs.fallow.tools/adoption#generated-or-vendored-files) Generated or vendored files Files produced by a build step, code generator, or vendored third-party bundle. Prefer: * [`ignorePatterns`](https://docs.fallow.tools/configuration/overview#ignorepatterns) to exclude them from analysis entirely * `health.ignore` when the noise is health-only and dead-code analysis should still run * duplication configuration for clone-heavy generated code ### [​](https://docs.fallow.tools/adoption#runtime-provided-or-intentionally-retained-dependencies) Runtime-provided or intentionally retained dependencies Packages installed for runtime usage only (no static import), CLI tools, or peer dependencies. Prefer: * [`ignoreDependencies`](https://docs.fallow.tools/configuration/overview#ignoredependencies) with the exact package names ### [​](https://docs.fallow.tools/adoption#one-off-intentional-unused-export) One-off intentional unused export An export you want to keep around deliberately (compatibility shims, future API). Prefer: * `/** @expected-unused */` on the export `@expected-unused` is self-cleaning. Unlike inline `fallow-ignore` comments, Fallow tracks the tag for staleness: the moment the export becomes imported, the tag is reported as a stale suppression so you can remove it. Use it liberally for shims and future API surface. ### [​](https://docs.fallow.tools/adoption#one-off-false-positive) One-off false positive A specific site where Fallow is wrong and no config rule captures the reason cleanly. Prefer: * `// fallow-ignore-next-line ` on the line above * `// fallow-ignore-file ` only when the whole file is truly exceptional ### [​](https://docs.fallow.tools/adoption#repo-wide-policy-change) Repo-wide policy change The project genuinely has a different standard for a whole category. Prefer: * `rules`, `health`, duplication thresholds, or `overrides` blocks Do this only when it reflects a real team policy, not to hide a few ugly hotspots. See [suppression](https://docs.fallow.tools/configuration/suppression) for the full decision tree and examples, and [configuration overview](https://docs.fallow.tools/configuration/overview) for every key. [​](https://docs.fallow.tools/adoption#5-keep-exceptions-narrow-and-reviewable) 5\. Keep exceptions narrow and reviewable ---------------------------------------------------------------------------------------------------------------------------- Narrow exceptions are an asset. Broad exceptions are a debt. Good: * a single `@public` export on a library entry point * one `ignoreDependencies` entry for a runtime-provided package * one `entry` pattern for worker scripts * one file-level generated-code ignore with a comment explaining why Bad: * broad `ignorePatterns` that silently exclude half the repo * repeated inline suppressions that could be one config rule * raising global `health.maxCyclomatic` to hide a handful of hotspots (acceptable only when the new threshold reflects a thought-through project standard with written justification) If you cannot explain an exception in one sentence, it is probably the wrong mechanism. [​](https://docs.fallow.tools/adoption#6-define-done) 6\. Define done ------------------------------------------------------------------------ Work in two stages. Most teams ship `fallow audit` at the end of stage 1 and finish stage 2 over the following weeks. ### [​](https://docs.fallow.tools/adoption#stage-1-good-enough-to-ship-fallow-audit) Stage 1: good enough to ship `fallow audit` * the chosen policy is encoded in config, not accumulated in scattered suppressions * unresolved imports and unlisted dependencies are cleared * blatant dead code (unused files, unused dependencies) is removed * `fallow audit` is wired into CI and passes for new changes against the default branch ### [​](https://docs.fallow.tools/adoption#stage-2-ideal-state) Stage 2: ideal state * no functions above your chosen health thresholds, either by refactoring or by consciously widening the threshold with written justification * duplication at or below the chosen threshold * stale suppressions gone or consciously accepted [​](https://docs.fallow.tools/adoption#7-turn-on-pr-enforcement) 7\. Turn on PR enforcement ---------------------------------------------------------------------------------------------- Once stage 1 is done, add the PR gate: npx fallow audit `fallow audit` runs dead code, duplication, and complexity analysis scoped to changed files, then returns a `pass`, `warn`, or `fail` verdict. See the [`fallow audit` reference](https://docs.fallow.tools/cli/audit) for flags and CI recipes. ### [​](https://docs.fallow.tools/adoption#pick-one-rollout-strategy) Pick one rollout strategy * Option A: warn-everywhere * Option B: error + baselines * Option C: local agent gate Best for smaller teams. CI never blocks; fixes land under social pressure. { "rules": { "unused-exports": "warn", "unused-files": "warn", "unused-dependencies": "warn" } } Risk: warn-only gates become warning-forever gates. Set a calendar reminder to promote rules to `error` after the first clean month. Best for larger orgs. CI blocks on new issues; pre-existing debt on touched files is baselined. # Save baselines once on the default branch fallow dead-code --save-baseline fallow-baselines/dead-code.json fallow health --save-baseline fallow-baselines/health.json fallow dupes --save-baseline fallow-baselines/dupes.json # Audit only new issues on PRs fallow audit \ --dead-code-baseline fallow-baselines/dead-code.json \ --health-baseline fallow-baselines/health.json \ --dupes-baseline fallow-baselines/dupes.json Store committed baselines outside `.fallow/` (which `fallow init` adds to `.gitignore` for machine-local cache). `fallow-baselines/` is the recommended default. Commit the baseline files so every PR compares against the same snapshot, and regenerate on a schedule (quarterly, or per release) rather than per merge, otherwise teams silently absorb new debt every time CI runs. Best when Claude Code is the main pusher. Add a project-level `PreToolUse` hook that intercepts `git commit` and `git push`, runs `fallow audit --format json --quiet --explain`, and blocks only on `verdict: "fail"`. Claude receives the raw audit JSON on stderr, fixes the findings, and retries the command.Pair this with Option A or B, not instead of them. This is a local reinforcement layer. Keep CI on `fallow audit` so human pushes and non-Claude workflows are still covered.Runtime errors (no base ref yet, first commit in an empty repo, config errors) fail open so new repos do not get stuck.See [Claude Code hooks](https://docs.fallow.tools/integrations/claude-hooks) for the full recipe, or generate the files with: fallow setup-hooks You can also configure baselines in `.fallowrc.json` and run `fallow audit` with no flags: { "audit": { "deadCodeBaseline": "fallow-baselines/dead-code.json", "healthBaseline": "fallow-baselines/health.json", "dupesBaseline": "fallow-baselines/dupes.json" } } Baselines are a debt ledger, not a steady state. If the baseline file only grows, the policy is not being enforced. [​](https://docs.fallow.tools/adoption#8-clean-up-with-an-agent) 8\. Clean up with an agent ---------------------------------------------------------------------------------------------- Fallow finds the problems. An AI agent (Claude Code, Cursor, Codex, Windsurf, any shell-capable coding assistant) is the right tool to fix them: edits are mechanical but decisions (“delete this export” vs. “mark it `@public`” vs. “add it to `entry`”) benefit from code-aware judgement. Three levels of integration, pick whichever your agent supports: Skills (best) ------------- Install `fallow-skills` for Claude Code, Cursor, Windsurf, or any Agent Skills compatible agent. Once installed, the skill works offline; the agent does not need to fetch docs URLs during use. MCP --- Structured tool calling with JSON output and `_meta` explanations. Works alongside skills. Plain shell ----------- Any agent that can run a shell command can drive Fallow. Use the copy-paste prompt below. Copy-paste adoption prompt (for agents without skills or MCP) Paste this prompt into your agent. It is self-contained: the agent does not need to fetch this page to follow it. Adopt Fallow in this repository. Goal: - use full-repo analysis first (`fallow`, `fallow dead-code`, `fallow dupes`, `fallow health`), not `fallow audit` - fix real dead code, duplication, and complexity issues in code - model intentional exceptions with the narrowest correct mechanism - end with no functions above the repo's chosen health thresholds, or a consciously widened threshold with written justification - then set up `fallow audit` as a PR gate Process: 1. Run `npx fallow`, then `npx fallow dead-code`, `npx fallow dupes`, and `npx fallow health`. Use `--format json` if you want structured output. 2. If no config exists, run `fallow init` and create a minimal repo policy. 3. Fix high-confidence issues first: - unresolved imports - unlisted dependencies - unused files (sanity-check with `fallow list --entry-points`) - unused dependencies 4. For each remaining finding, choose one path: - fix it in code (preferred) - model it in config - add a narrow inline exception only if it is truly one-off 5. Match reasons to mechanisms: - external API: `@public` / `@internal` / `@beta` / `@alpha`, or `publicPackages` - runtime or framework entry point: `entry`, `dynamicallyLoaded`, plugin-aware config - generated code: `ignorePatterns`, `health.ignore` - intentionally retained dependency: `ignoreDependencies` - intentional unused export: `@expected-unused` (preferred over inline comments because it self-cleans) - one-off false positive: `fallow-ignore-next-line` - repo-wide policy: `rules`, `health`, duplication settings, `overrides` 6. Prefer config-level modeling over repeated suppression. 7. Keep every exception narrow and explain why it exists in a commit message. 8. Re-run Fallow after each batch until the repo is clean under the chosen policy. 9. Only after repo cleanup, run `npx fallow audit` and wire it into CI. At the end, report: - code changes - config changes - exceptions added and why - anything left - the final commands and outputs that show the repo is clean [​](https://docs.fallow.tools/adoption#next-steps) Next steps ---------------------------------------------------------------- fallow audit ------------ Enforce the policy on changed files in CI. Configuration overview ---------------------- Every config key, with examples. Suppression ----------- Visibility tags, inline comments, and when to use each. Agent Skills ------------ Install `fallow-skills` for agent-driven adoption. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/adoption.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/adoption) [Previous](https://docs.fallow.tools/quickstart) [OverviewWhat Fallow analyzes: dead code, duplication, architecture boundaries, auto-fix, and runtime-backed runtime coverage.\ \ Next](https://docs.fallow.tools/analysis) ⌘I On this page * [Repo clean vs PR clean](https://docs.fallow.tools/adoption#repo-clean-vs-pr-clean) * [Before you start](https://docs.fallow.tools/adoption#before-you-start) * [1\. First run: get the whole picture](https://docs.fallow.tools/adoption#1-first-run-get-the-whole-picture) * [2\. Decide the project policy before triage](https://docs.fallow.tools/adoption#2-decide-the-project-policy-before-triage) * [3\. Work findings in the right order](https://docs.fallow.tools/adoption#3-work-findings-in-the-right-order) * [4\. Match the reason to the right mechanism](https://docs.fallow.tools/adoption#4-match-the-reason-to-the-right-mechanism) * [External or public API](https://docs.fallow.tools/adoption#external-or-public-api) * [Framework or runtime-discovered entry points](https://docs.fallow.tools/adoption#framework-or-runtime-discovered-entry-points) * [Generated or vendored files](https://docs.fallow.tools/adoption#generated-or-vendored-files) * [Runtime-provided or intentionally retained dependencies](https://docs.fallow.tools/adoption#runtime-provided-or-intentionally-retained-dependencies) * [One-off intentional unused export](https://docs.fallow.tools/adoption#one-off-intentional-unused-export) * [One-off false positive](https://docs.fallow.tools/adoption#one-off-false-positive) * [Repo-wide policy change](https://docs.fallow.tools/adoption#repo-wide-policy-change) * [5\. Keep exceptions narrow and reviewable](https://docs.fallow.tools/adoption#5-keep-exceptions-narrow-and-reviewable) * [6\. Define done](https://docs.fallow.tools/adoption#6-define-done) * [Stage 1: good enough to ship fallow audit](https://docs.fallow.tools/adoption#stage-1-good-enough-to-ship-fallow-audit) * [Stage 2: ideal state](https://docs.fallow.tools/adoption#stage-2-ideal-state) * [7\. Turn on PR enforcement](https://docs.fallow.tools/adoption#7-turn-on-pr-enforcement) * [Pick one rollout strategy](https://docs.fallow.tools/adoption#pick-one-rollout-strategy) * [8\. Clean up with an agent](https://docs.fallow.tools/adoption#8-clean-up-with-an-agent) * [Next steps](https://docs.fallow.tools/adoption#next-steps) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/audit#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow audit [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Audit changed files for dead code, complexity, and duplication. Returns a **pass**, **warn**, or **fail** verdict based on the severity of issues found. Scoping to changed files keeps signal-to-noise high: only issues in the current PR or commit, not the project backlog. `fallow audit` is the PR-time gate. For the initial full-repo cleanup on an existing codebase, start with [Adopt Fallow in an existing repo](https://docs.fallow.tools/adoption) , which walks through `fallow`, `fallow dead-code`, `fallow dupes`, and `fallow health`, and hands the actual cleanup to an AI agent before turning `audit` on in CI. `fallow audit` auto-detects your base branch. Run it without arguments for a zero-config quality check. fallow audit [​](https://docs.fallow.tools/cli/audit#options) Options ----------------------------------------------------------- ### [​](https://docs.fallow.tools/cli/audit#base-ref) Base ref | Flag | Description | | --- | --- | | `--base ` | Git ref to compare against (e.g., `main`, `HEAD~5`, a commit SHA). Alias for `--changed-since`. Auto-detects the default branch if omitted. | ### [​](https://docs.fallow.tools/cli/audit#output) Output | Flag | Description | | --- | --- | | `-f, --format ` | Output format: `human` (default), `json`, `sarif`, `compact`, `markdown`, `codeclimate` | | `-q, --quiet` | Suppress progress and status output on stderr | | `--explain` | Add metric explanations in JSON output (`_meta` objects with docs links) | ### [​](https://docs.fallow.tools/cli/audit#scoping) Scoping | Flag | Description | | --- | --- | | `-w, --workspace ` | Scope to a single workspace package | | `--production` | Exclude test/story/dev files (applies to dead-code, health, and dupes) | | `--production-dead-code` | Production mode for dead-code only. See [global flags](https://docs.fallow.tools/cli/global-flags#per-analysis-production-mode)
. | | `--production-health` | Production mode for health only. | | `--production-dupes` | Production mode for duplication only. | ### [​](https://docs.fallow.tools/cli/audit#thresholds) Thresholds | Flag | Description | | --- | --- | | `--max-crap ` | Maximum CRAP score before the audit fails (default: 30.0, configurable via `health.maxCrap`). Functions meeting or exceeding this score contribute to the fail verdict alongside dead-code and complexity findings. Pair with `--coverage` on a preceding `fallow health` run (or set `FALLOW_COVERAGE` in CI) for accurate per-function CRAP; without Istanbul data fallow estimates coverage from the module graph. | ### [​](https://docs.fallow.tools/cli/audit#baselines) Baselines | Flag | Description | | --- | --- | | `--dead-code-baseline ` | Baseline file produced by `fallow dead-code --save-baseline`. Dead-code issues present in the baseline are excluded from the verdict. | | `--health-baseline ` | Baseline file produced by `fallow health --save-baseline`. Complexity findings present in the baseline are excluded from the verdict. | | `--dupes-baseline ` | Baseline file produced by `fallow dupes --save-baseline`. Clone groups present in the baseline are excluded from the verdict. | The global `--baseline` / `--save-baseline` flags are **rejected** on `audit` (exit 2) because audit runs three analyses with incompatible baseline formats. Use the per-analysis flags above, or configure defaults in `.fallowrc.json`: { "audit": { "deadCodeBaseline": "fallow-baselines/dead-code.json", "healthBaseline": "fallow-baselines/health.json", "dupesBaseline": "fallow-baselines/dupes.json" } } Store committed baselines outside `.fallow/`, because `fallow init` adds that directory to `.gitignore` for machine-local cache. CLI flags override config. Baselines are a no-op if unset; any subset (e.g. dead-code only) is allowed. [​](https://docs.fallow.tools/cli/audit#verdict) Verdict ----------------------------------------------------------- | Verdict | Exit code | When | What to do | | --- | --- | --- | --- | | **pass** | 0 | No issues in changed files | Ship it. | | **warn** | 0 | Issues found, all warn-severity | CI passes, but consider fixing before they become errors. | | **fail** | 1 | Error-severity issues found | Fix the reported issues before merging. | | **error** | 2 | Runtime error (invalid ref, not a git repo, config error) | Check the error message. In JSON format, emits `{"error": true, "message": "...", "exit_code": 2}`. | Dead code issues follow your [rules configuration](https://docs.fallow.tools/configuration/rules) severity (error/warn/off). Complexity findings above configured thresholds are always errors; thresholds are inherited from your `fallow health` config (defaults: cyclomatic 20, cognitive 15). Duplication is a warning unless a `--threshold` is configured. Inline suppression comments (`// fallow-ignore-next-line`) work in audit. Findings in changed files are suppressed the same way as in `fallow dead-code`. [​](https://docs.fallow.tools/cli/audit#examples) Examples ------------------------------------------------------------- Basic usage CI integration Scoping Baselines # Auto-detect base branch fallow audit # Explicit base ref fallow audit --base main # Audit last 3 commits fallow audit --base HEAD~3 [​](https://docs.fallow.tools/cli/audit#example-output) Example output ------------------------------------------------------------------------- $ fallow audit (pass) Audit scope: 8 changed files vs main (d4a2f91..HEAD) ✓ No issues in 8 changed files (1.18s) $ fallow audit (warn) Audit scope: 8 changed files vs main (d4a2f91..HEAD) ■ dead code 0 · complexity 2 (warn, max cyclomatic: 12) · duplication 0 ✓ dead code: 0 issues · complexity: 2 findings (warn) · 8 changed files (1.18s) The `■` summary line appears only on warn verdicts, before any detail sections. It is suppressed with `--quiet`. $ fallow audit (fail) Audit scope: 12 changed files vs main (d4a2f91..HEAD) ── Dead Code ────────────────────────────────────── ● Unused exports (2) src/components/Button.tsx (2) :42 OldButton :67 deprecatedHelper Exported symbols not imported by any reachable file — https://docs.fallow.tools/explanations/dead-code#unused-exports ── Duplication ──────────────────────────────────── ● Duplicates (1 clone group) 23 lines 2 instances src/utils/helpers.ts:10-32 src/legacy/compat.ts:5-27 ── Complexity ───────────────────────────────────── ● High complexity functions (1) src/parser.ts :45 parseExpression 28 cyclomatic 32 cognitive 80 lines Functions exceeding thresholds — https://docs.fallow.tools/explanations/health#complexity-metrics ✗ dead code: 2 issues · complexity: 1 finding · duplication: 1 clone group · 12 changed files (2.14s) [​](https://docs.fallow.tools/cli/audit#how-it-works) How it works --------------------------------------------------------------------- 1. **Resolve base ref**: uses `--base` if provided, otherwise auto-detects the default branch (`git symbolic-ref refs/remotes/origin/HEAD` → `main` → `master`). Hard-errors if no base can be determined. 2. **Find changed files**: runs `git diff --name-only ...HEAD` (three-dot diff, showing changes since the merge base). 3. **Run three analyses** scoped to changed files: [dead code](https://docs.fallow.tools/cli/dead-code) , [complexity](https://docs.fallow.tools/cli/health) , [duplication](https://docs.fallow.tools/cli/dupes) . 4. **Compute verdict**: aggregates severity across all three analyses into pass/warn/fail. [​](https://docs.fallow.tools/cli/audit#json-output) JSON output ------------------------------------------------------------------- $ fallow audit --format json { "schema_version": 3, "version": "2.51.0", "command": "audit", "verdict": "fail", "changed_files_count": 12, "base_ref": "main", "head_sha": "d4a2f91", "elapsed_ms": 2140, "summary": { "dead_code_issues": 2, "dead_code_has_errors": true, "complexity_findings": 1, "max_cyclomatic": 28, "duplication_clone_groups": 0 }, "dead_code": { "schema_version": 3, "total_issues": 2, "unused_exports": [...] }, "complexity": { "findings": [...] }, "duplication": { "clone_groups": [], "stats": { "duplication_percentage": 0.0 } } } ### [​](https://docs.fallow.tools/cli/audit#key-fields) Key fields | Field | Type | Description | | --- | --- | --- | | `verdict` | `"pass"` \| `"warn"` \| `"fail"` | The audit result. Use this for CI gates. | | `changed_files_count` | integer | Number of files changed between base and HEAD | | `base_ref` | string | The git ref used for comparison | | `summary.dead_code_issues` | integer | Total dead code issues in changed files | | `summary.dead_code_has_errors` | boolean | Whether any dead code issues have error severity | | `summary.complexity_findings` | integer | Functions exceeding complexity thresholds | | `summary.max_cyclomatic` | integer \| null | Highest cyclomatic complexity found (null if none) | | `summary.duplication_clone_groups` | integer | Clone groups involving changed files | The `dead_code`, `complexity`, and `duplication` sub-objects contain full results in the same format as [`fallow dead-code`](https://docs.fallow.tools/cli/dead-code#json-output) , [`fallow health`](https://docs.fallow.tools/cli/health#json-output) , and [`fallow dupes`](https://docs.fallow.tools/cli/dupes#json-output) respectively. These are omitted when no files changed. On exit code 2 (runtime error), JSON format emits `{"error": true, "message": "...", "exit_code": 2}` to stdout instead of the audit envelope. [​](https://docs.fallow.tools/cli/audit#mcp-tool) MCP tool ------------------------------------------------------------- The `audit` MCP tool wraps `fallow audit --format json --quiet --explain`: Example request { "tool": "audit", "arguments": { "base": "main" } } Auto-detects the base branch if `base` is not specified. The response always includes `_meta` explanatory metadata (the MCP wrapper enables `--explain` by default). Returns the same JSON envelope as the CLI. See [MCP integration](https://docs.fallow.tools/integrations/mcp) for setup instructions. [​](https://docs.fallow.tools/cli/audit#see-also) See also ------------------------------------------------------------- Dead code analysis ------------------ Full dead code analysis with issue-type filters. Health analysis --------------- Complexity metrics, file scores, hotspots, and targets. MCP integration --------------- Use fallow tools from AI coding agents. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/audit.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/audit) [Previous](https://docs.fallow.tools/cli/flags) [fallow fixCLI reference for fallow fix. Automatically remove unused exports and dependencies from source files with dry-run preview and JSON output.\ \ Next](https://docs.fallow.tools/cli/fix) ⌘I On this page * [Options](https://docs.fallow.tools/cli/audit#options) * [Base ref](https://docs.fallow.tools/cli/audit#base-ref) * [Output](https://docs.fallow.tools/cli/audit#output) * [Scoping](https://docs.fallow.tools/cli/audit#scoping) * [Thresholds](https://docs.fallow.tools/cli/audit#thresholds) * [Baselines](https://docs.fallow.tools/cli/audit#baselines) * [Verdict](https://docs.fallow.tools/cli/audit#verdict) * [Examples](https://docs.fallow.tools/cli/audit#examples) * [Example output](https://docs.fallow.tools/cli/audit#example-output) * [How it works](https://docs.fallow.tools/cli/audit#how-it-works) * [JSON output](https://docs.fallow.tools/cli/audit#json-output) * [Key fields](https://docs.fallow.tools/cli/audit#key-fields) * [MCP tool](https://docs.fallow.tools/cli/audit#mcp-tool) * [See also](https://docs.fallow.tools/cli/audit#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/cli/dead-code#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Commands fallow dead-code [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Analyze your project for dead code. Fallow scans entry points, traces all reachable exports, and reports anything that isn’t used. Running bare `fallow` now runs **all analyses** (dead code, duplication, and health). Use `fallow dead-code` to run dead code analysis only. `fallow check` remains as a hidden alias for `fallow dead-code`. fallow dead-code fallow check # Hidden alias for fallow dead-code [​](https://docs.fallow.tools/cli/dead-code#options) Options --------------------------------------------------------------- ### [​](https://docs.fallow.tools/cli/dead-code#output) Output | Flag | Description | | --- | --- | | `-f, --format ` | Output format: `human` (default), `json`, `sarif`, `compact`, `markdown`, `codeclimate` | | `-q, --quiet` | Suppress progress output | | `--fail-on-issues` | Exit with code 1 if issues are found | | `--sarif-file ` | Write SARIF output to a file (in addition to `--format`) | | `--ci` | CI mode: sets format to SARIF, enables fail-on-issues, suppresses progress. Individual flags can still override. | | `--explain` | Add metric explanations. In human format, explanations are always shown. In JSON format, adds a `_meta` object with metric descriptions and docs links. | | `--group-by ` | Group output by `owner` (CODEOWNERS), `directory` (first path component), `package` (workspace package), or `section` (GitLab CODEOWNERS `[Section]` headers, with `owners` metadata). See [global flags](https://docs.fallow.tools/cli/global-flags#reference)
. | | `--summary` | Print a one-line summary of issue counts at the end of the run. In JSON format, adds a `summary` counts object. | ### [​](https://docs.fallow.tools/cli/dead-code#filtering) Filtering | Flag | Description | | --- | --- | | `--unused-files` | Only report unused files | | `--unused-exports` | Only report unused exports | | `--unused-types` | Only report unused types | | `--private-type-leaks` | Only report exported signatures that reference same-file private types | | `--unused-deps` | Only report unused dependencies | | `--unused-optional-deps` | Only report unused optional dependencies | | `--unused-enum-members` | Only report unused enum members | | `--unused-class-members` | Only report unused class members | | `--unresolved-imports` | Only report unresolved imports | | `--unlisted-deps` | Only report unlisted dependencies | | `--duplicate-exports` | Only report duplicate exports | | `--circular-deps` | Only report circular dependencies | | `--boundary-violations` | Only report boundary violations | | `--stale-suppressions` | Only report stale suppression comments and `@expected-unused` JSDoc tags | | `--type-only-deps` | Only report type-only dependencies | | `--include-dupes` | Also run duplication analysis and cross-reference with dead code | ### [​](https://docs.fallow.tools/cli/dead-code#scoping) Scoping | Flag | Description | | --- | --- | | `--file ` | Scope output to specific files. Accepts multiple values. Only issues in the specified files are reported. Project-wide dependency issues are suppressed. Warns on non-existent paths. Useful for lint-staged integration. | | `--include-entry-exports` | Also report unused exports in entry files (package.json `main`/`exports`, framework pages, etc.). By default, exports in entry files are assumed to be consumed externally. This flag catches typos like `meatdata` instead of `metadata` in framework-convention exports. | ### [​](https://docs.fallow.tools/cli/dead-code#incremental) Incremental | Flag | Description | | --- | --- | | `--changed-since ` | Only check files changed since a git ref | | `--baseline ` | Compare against a previously saved baseline file | | `--save-baseline ` | Save current results as a baseline file | | `--production` | Production mode (exclude test/story/dev files) | | `--top ` | Show only the top N items per issue category in human output | ### [​](https://docs.fallow.tools/cli/dead-code#regression-detection) Regression detection | Flag | Description | | --- | --- | | `--fail-on-regression` | Fail if issue count increased beyond tolerance vs a regression baseline | | `--tolerance ` | Allowed increase: `"2%"` (percentage) or `"5"` (absolute). Default: `"0"` | | `--regression-baseline ` | Path to regression baseline file (default: `.fallow/regression-baseline.json`) | | `--save-regression-baseline ` | Save current issue counts as a regression baseline | Debugging flags These flags help you understand how fallow resolves your code and where time is spent. | Flag | Description | | --- | --- | | `--trace ` | Trace usage of a specific export | | `--trace-file ` | Show all edges for a file | | `--trace-dependency ` | Show where a dependency is used | | `--performance` | Show pipeline timing breakdown | # Why is formatDate reported as unused? fallow dead-code --trace src/utils.ts:formatDate # What imports/exports does this file have? fallow dead-code --trace-file src/utils.ts # Where is lodash used? fallow dead-code --trace-dependency lodash # Pipeline performance breakdown fallow dead-code --performance [​](https://docs.fallow.tools/cli/dead-code#examples) Examples ----------------------------------------------------------------- Basic analysis CI integration Incremental workflows Regression detection Production mode File scoping fallow dead-code [​](https://docs.fallow.tools/cli/dead-code#regression-detection-2) Regression detection ------------------------------------------------------------------------------------------- Save a regression baseline on your main branch, then compare on subsequent runs (e.g., in PR checks) to prevent issue count from growing. **Workflow:** 1. Save a regression baseline on `main`: fallow dead-code --save-regression-baseline This writes issue counts to `.fallow/regression-baseline.json` (or a custom path). 2. On each PR, compare against the baseline: fallow dead-code --fail-on-regression Exits with code 1 if the total issue count exceeds the baseline plus the configured tolerance. 3. Optionally set a tolerance to allow small fluctuations: fallow dead-code --fail-on-regression --tolerance 2% # percentage fallow dead-code --fail-on-regression --tolerance 5 # absolute When `--fail-on-regression` is used with `--format json`, the output includes an optional `regression` object: { "regression": { "status": "pass", "baseline_total": 42, "current_total": 45, "delta": 3, "tolerance": 2.0, "tolerance_kind": "percentage", "exceeded": false } } | Field | Description | | --- | --- | | `status` | `pass`, `exceeded`, or `skipped` | | `baseline_total` | Issue count from the baseline file | | `current_total` | Issue count from the current run | | `delta` | `current_total - baseline_total` | | `tolerance` | Configured tolerance value | | `tolerance_kind` | `percentage` or `absolute` | | `exceeded` | Whether the delta exceeds the tolerance | | `reason` | Only present when `status` is `skipped` (e.g., baseline file not found) | These flags also work with `fallow dupes` and bare `fallow` (all analyses). The regression check compares total issue counts across all enabled analyses. [​](https://docs.fallow.tools/cli/dead-code#example-output) Example output ----------------------------------------------------------------------------- $ fallow dead-code --format compact unused-file:src/server/jobs/worker.ts unused-file:src/features/savings/hooks/usePotGroups.ts unused-file:src/server/jobs/cron.ts unused-export:src/server/jobs/queue.ts:61:enqueueJobDelayed unused-export:src/server/jobs/queue.ts:206:sweepStuckProcessingJobs unused-export:src/components/Card/index.ts:1:CardFooter [​](https://docs.fallow.tools/cli/dead-code#grouped-output) Grouped output ----------------------------------------------------------------------------- Use `--group-by` to partition issues by ownership or directory. This works with all output formats. # Group by CODEOWNERS (auto-probes CODEOWNERS, .github/CODEOWNERS, .gitlab/CODEOWNERS, docs/CODEOWNERS) fallow dead-code --group-by owner # Group by first directory component fallow dead-code --group-by directory # Group by workspace package fallow dead-code --group-by package # Group by GitLab CODEOWNERS section (requires a file with [Section] headers) fallow dead-code --group-by section With `--format json`, grouped output wraps the normal structure: { "grouped_by": "owner", "total_issues": 12, "groups": [\ {\ "key": "@frontend-team",\ "total_issues": 8,\ "unused_files": [...],\ "unused_exports": [...]\ },\ {\ "key": "@backend-team",\ "total_issues": 4,\ "unused_exports": [...]\ }\ ] } Set a custom CODEOWNERS path via the `codeowners` field in `.fallowrc.json` if your file isn’t in a standard location. [​](https://docs.fallow.tools/cli/dead-code#fix-suggestions-in-json-output) Fix suggestions in JSON output ------------------------------------------------------------------------------------------------------------- When using `--format json`, every issue includes an `actions` array with machine-actionable fix and suppress hints. This lets agents and CI scripts programmatically decide how to resolve each finding. { "path": "src/utils.ts", "export_name": "helperFn", "line": 10, "actions": [\ {\ "type": "remove-export",\ "auto_fixable": true,\ "description": "Remove the `export` keyword from the declaration"\ },\ {\ "type": "suppress-line",\ "auto_fixable": false,\ "description": "Suppress with an inline comment above the line",\ "comment": "// fallow-ignore-next-line unused-export"\ }\ ] } Each action has: | Field | Description | | --- | --- | | `type` | One of 14 fix action types in kebab-case (e.g. `remove-export`, `remove-file`, `suppress-line`, `add-to-config`) | | `auto_fixable` | `true` when `fallow fix` can handle this action automatically | | `description` | Human-readable explanation of the action | | `comment` | _(optional)_ The inline suppression comment to add | | `note` | _(optional)_ Additional context for non-auto-fixable items | | `config_key` | _(optional)_ The config key to modify, e.g. `"ignoreDependencies"` for dependency issues | | `scope` | _(optional)_ Present on `duplicate_exports` suppress actions as `"per-location"` since those span multiple files | Re-export findings include a warning note about public API surface impact. Dependency issues use `add-to-config` suppress (not inline comments) with the concrete package name and `config_key: "ignoreDependencies"`. [​](https://docs.fallow.tools/cli/dead-code#additional-json-fields) Additional JSON fields --------------------------------------------------------------------------------------------- When using `--format json`, the output may include these additional top-level objects: ### [​](https://docs.fallow.tools/cli/dead-code#entry_points) `entry_points` Lists all resolved entry point files that root the module graph: { "entry_points": [\ "src/index.ts",\ "src/cli.ts",\ "src/workers/sync.ts"\ ] } ### [​](https://docs.fallow.tools/cli/dead-code#summary) `summary` When `--summary` is used, a `summary` counts object is included: { "summary": { "unused_files": 3, "unused_exports": 12, "unused_types": 2, "private_type_leaks": 0, "unused_dependencies": 1, "unresolved_imports": 0, "circular_dependencies": 1, "total_issues": 19 } } ### [​](https://docs.fallow.tools/cli/dead-code#used_in_workspaces) `used_in_workspaces` Unused dependency findings can include `used_in_workspaces` when a package is unused in the declaring workspace but imported elsewhere in the monorepo: { "unused_dependencies": [\ {\ "package_name": "lodash-es",\ "location": "dependencies",\ "path": "packages/shared/package.json",\ "line": 5,\ "used_in_workspaces": ["packages/consumer"]\ }\ ] } In human, markdown, GitHub, and GitLab output this appears as “imported in” or an “Imported elsewhere” column. Treat these as workspace placement issues: move the dependency to the consuming workspace instead of auto-removing it. ### [​](https://docs.fallow.tools/cli/dead-code#baseline_deltas) `baseline_deltas` When `--baseline` is used, a `baseline_deltas` object shows changes since the baseline: { "baseline_deltas": { "added": 3, "removed": 5, "unchanged": 14 } } [​](https://docs.fallow.tools/cli/dead-code#stale-suppression-detection) Stale suppression detection ------------------------------------------------------------------------------------------------------- Fallow detects `// fallow-ignore` comments and `/** @expected-unused */` JSDoc tags that no longer match any issue. This prevents suppression comments from accumulating after the underlying issues are resolved. # Only report stale suppressions fallow dead-code --stale-suppressions # JSON output includes stale_suppressions array fallow dead-code --format json --stale-suppressions Two types of staleness are detected: | Origin | When it’s stale | | --- | --- | | `// fallow-ignore-next-line` / `// fallow-ignore-file` | The suppression no longer matches any issue on the target line or in the file | | `/** @expected-unused */` JSDoc tag | The tagged export is now imported by another module | The `stale-suppressions` rule defaults to `warn`. Promote to `error` for CI enforcement: { "rules": { "stale-suppressions": "error" } } When using `--format json`, stale suppressions appear in the `stale_suppressions` array: { "stale_suppressions": [\ {\ "path": "src/utils.ts",\ "line": 5,\ "col": 0,\ "origin": {\ "type": "inline_comment",\ "issue_type": "unused-export",\ "is_file_level": false\ }\ },\ {\ "path": "src/lib.ts",\ "line": 10,\ "col": 0,\ "origin": {\ "type": "jsdoc_tag",\ "export_name": "createWidget"\ }\ }\ ] } Use `/** @expected-unused */` instead of `// fallow-ignore-next-line` when you want fallow to alert you if a suppressed export later becomes used. Both are tracked for staleness, but `@expected-unused` communicates intent more clearly. [​](https://docs.fallow.tools/cli/dead-code#see-also) See also ----------------------------------------------------------------- Dead code analysis ------------------ How fallow detects dead code. Rules configuration ------------------- Configure severity and thresholds per rule. Production mode --------------- Analyze only shipping code. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/cli/dead-code.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/cli/dead-code) [fallow dupesCLI reference for fallow dupes. Detect duplicated code blocks across your codebase using suffix-array analysis with configurable thresholds.\ \ Next](https://docs.fallow.tools/cli/dupes) ⌘I On this page * [Options](https://docs.fallow.tools/cli/dead-code#options) * [Output](https://docs.fallow.tools/cli/dead-code#output) * [Filtering](https://docs.fallow.tools/cli/dead-code#filtering) * [Scoping](https://docs.fallow.tools/cli/dead-code#scoping) * [Incremental](https://docs.fallow.tools/cli/dead-code#incremental) * [Regression detection](https://docs.fallow.tools/cli/dead-code#regression-detection) * [Examples](https://docs.fallow.tools/cli/dead-code#examples) * [Regression detection](https://docs.fallow.tools/cli/dead-code#regression-detection-2) * [Example output](https://docs.fallow.tools/cli/dead-code#example-output) * [Grouped output](https://docs.fallow.tools/cli/dead-code#grouped-output) * [Fix suggestions in JSON output](https://docs.fallow.tools/cli/dead-code#fix-suggestions-in-json-output) * [Additional JSON fields](https://docs.fallow.tools/cli/dead-code#additional-json-fields) * [entry\_points](https://docs.fallow.tools/cli/dead-code#entry_points) * [summary](https://docs.fallow.tools/cli/dead-code#summary) * [used\_in\_workspaces](https://docs.fallow.tools/cli/dead-code#used_in_workspaces) * [baseline\_deltas](https://docs.fallow.tools/cli/dead-code#baseline_deltas) * [Stale suppression detection](https://docs.fallow.tools/cli/dead-code#stale-suppression-detection) * [See also](https://docs.fallow.tools/cli/dead-code#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis/css-analysis#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis CSS, SCSS, and Tailwind analysis [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Fallow tracks CSS and SCSS files using dedicated extraction, not regex pattern matching against source text. `@use`, `@forward`, SCSS partials (`_prefix` files), and Tailwind directives are all resolved accurately. No manual configuration needed. [​](https://docs.fallow.tools/analysis/css-analysis#scss-import-resolution) SCSS import resolution ----------------------------------------------------------------------------------------------------- Fallow understands the full SCSS module system. Imports create edges in the module graph, and re-exports propagate through the dependency chain. | Directive | How fallow handles it | | --- | --- | | `@use 'path'` | Resolved as a module import, creating a graph edge | | `@forward 'path'` | Treated as a re-export in the module graph | | `@import 'path'` | Legacy import, tracked as a side-effect edge | | `@use 'sass:math'` | Recognized as a Sass built-in module, not flagged as missing | SCSS partial resolution follows the standard convention. When fallow encounters `@use 'components/button'`, it resolves through these candidates in order: 1. `components/_button.scss` (partial convention) 2. `components/button/_index.scss` (directory index) 3. `components/button/index.scss` (plain index) styles/theme.scss @use 'sass:color'; @use 'variables'; @use 'mixins/responsive'; @forward 'tokens' show $primary, $secondary; Fallow sees this file as: * Importing the `sass:color` built-in (correctly ignored, not a project dependency) * Importing `./variables`, resolved to `_variables.scss` via partial convention * Importing `./mixins/responsive`, resolved to `mixins/_responsive.scss` * Re-exporting `$primary` and `$secondary` from `./tokens` SCSS include paths (configured via frameworks like Angular) are also supported. When a bare specifier like `@use 'variables'` cannot be resolved locally, fallow searches configured include directories with the same partial and index conventions. [​](https://docs.fallow.tools/analysis/css-analysis#css-module-class-tracking) CSS Module class tracking ----------------------------------------------------------------------------------------------------------- Files with `.module.css` or `.module.scss` extensions receive special treatment. Fallow extracts every class name from selectors and exposes them as named exports. Button.module.css .root { display: flex; align-items: center; } .primary { background: var(--color-primary); } .disabled { opacity: 0.5; pointer-events: none; } This file exports three named symbols: `root`, `primary`, and `disabled`. When a component imports a CSS module, fallow tracks which classes are actually accessed: Button.tsx import styles from './Button.module.css'; export const Button = ({ variant }: Props) => ( ); Here, `styles.root` and `styles.primary` are marked as used. The `disabled` class is never referenced, so fallow reports it as an unused export. $ fallow dead-code --unused-exports ● Unused exports (1) src/Button.module.css :3 disabled Exported symbols with zero references — https://docs.fallow.tools/explanations/dead-code#unused-exports ✗ 1 issue (0.02s) Start with `fallow dead-code --unused-exports` to see which CSS module class names are unused across your project. [​](https://docs.fallow.tools/analysis/css-analysis#tailwind-css-integration) Tailwind CSS integration --------------------------------------------------------------------------------------------------------- When fallow encounters `@apply` or `@tailwind` directives in any CSS or SCSS file, it creates a synthetic dependency on the `tailwindcss` package. This prevents false “unused dependency” reports. globals.css @tailwind base; @tailwind components; @tailwind utilities; .btn { @apply px-4 py-2 rounded-md font-medium; } Fallow detects both `@tailwind` and `@apply` directives and marks `tailwindcss` as a used dependency. The Tailwind plugin provides additional coverage by parsing `tailwind.config.{js,ts,cjs,mjs}`: * **Content globs** from the `content` array are treated as always-used file patterns * **Plugin packages** referenced via `require()` or string arrays are marked as used dependencies * **Presets** are tracked as referenced dependencies * **Imports** in the config file (e.g., `import defaultTheme from 'tailwindcss/defaultTheme'`) are tracked tailwind.config.js import defaultTheme from 'tailwindcss/defaultTheme'; export default { content: ['./src/**/*.{js,ts,jsx,tsx}'], plugins: [\ require('@tailwindcss/typography'),\ require('@tailwindcss/forms'),\ ], }; Fallow marks `tailwindcss`, `@tailwindcss/typography`, and `@tailwindcss/forms` as used dependencies. [​](https://docs.fallow.tools/analysis/css-analysis#css-@import-tracking) CSS `@import` tracking --------------------------------------------------------------------------------------------------- Plain CSS `@import` statements create edges in the module graph. Both relative paths and package imports are tracked. styles/main.css @import './reset.css'; @import './typography.css'; @import '@fontsource/inter/400.css'; Fallow resolves `./reset.css` and `./typography.css` as local file imports, and `@fontsource/inter` as a package dependency. Remote URLs (`https://...`) and data URIs are correctly ignored. [​](https://docs.fallow.tools/analysis/css-analysis#common-patterns-that-just-work) Common patterns that just work --------------------------------------------------------------------------------------------------------------------- | Pattern | Example | How fallow handles it | | --- | --- | --- | | SCSS partial imports | `@use 'mixins'` | Resolves to `_mixins.scss` | | Sass built-in modules | `@use 'sass:math'` | Correctly ignored, not flagged as missing | | `@use` with namespace | `@use 'colors' as c` | Tracked as module import | | `@forward` with `show`/`hide` | `@forward 'tokens' show $primary` | Re-export with filtering | | CSS custom properties | `var(--color-primary)` | File-level tracking (not per-property) | | PostCSS plugins | `postcss.config.js` | Plugin dependencies detected via PostCSS plugin config | | Scoped CSS packages | `@import '@company/tokens/base.scss'` | Resolved as npm package, not local file | | SCSS directory index | `@use 'components'` | Resolves to `components/_index.scss` | [​](https://docs.fallow.tools/analysis/css-analysis#see-also) See also ------------------------------------------------------------------------- Dead code analysis ------------------ How fallow builds the module graph and detects unused code. Non-JS file types ----------------- All non-JavaScript file types fallow analyzes automatically. Configuration ------------- Configure entry points, rules, and analysis scope. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/analysis/css-analysis.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/analysis/css-analysis) [Previous](https://docs.fallow.tools/analysis/file-types) [Debugging & troubleshootingTrace export usage, diagnose false positives, and debug fallow's analysis pipeline with built-in tracing and performance profiling tools.\ \ Next](https://docs.fallow.tools/analysis/debugging) ⌘I On this page * [SCSS import resolution](https://docs.fallow.tools/analysis/css-analysis#scss-import-resolution) * [CSS Module class tracking](https://docs.fallow.tools/analysis/css-analysis#css-module-class-tracking) * [Tailwind CSS integration](https://docs.fallow.tools/analysis/css-analysis#tailwind-css-integration) * [CSS @import tracking](https://docs.fallow.tools/analysis/css-analysis#css-%40import-tracking) * [Common patterns that just work](https://docs.fallow.tools/analysis/css-analysis#common-patterns-that-just-work) * [See also](https://docs.fallow.tools/analysis/css-analysis#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis Analysis [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Fallow analyzes your codebase at two levels: * **Static intelligence**: structure, reachability, duplication, complexity, boundaries, and flags * **Runtime intelligence**: what actually executed in production [​](https://docs.fallow.tools/analysis#static-analysis) Static analysis -------------------------------------------------------------------------- Dead code --------- Unused files, exports, types, dependencies, circular deps, and more. Duplication ----------- Find repeated blocks from exact to semantic clones. Architecture boundaries ----------------------- Enforce import rules across layers and modules. Auto-fix -------- Remove unused exports and dependencies automatically. [​](https://docs.fallow.tools/analysis#runtime-analysis) Runtime analysis ---------------------------------------------------------------------------- Runtime coverage ---------------- Add runtime evidence to `fallow health` for hot paths, cold paths, and deletion confidence. [​](https://docs.fallow.tools/analysis#supporting-topics) Supporting topics ------------------------------------------------------------------------------ Production mode --------------- Exclude test and dev files from analysis. Non-JS file types ----------------- How Fallow handles JSON, HTML, and other file types. CSS, SCSS, and Tailwind ----------------------- AST-based CSS Module, SCSS, and Tailwind tracking. Debugging --------- Trace why something is reported (or missed). Limitations ----------- What Fallow does not cover and why. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/analysis.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/analysis) [Previous](https://docs.fallow.tools/adoption) [Dead code analysisFind unused files, exports, dependencies, types, class members, circular dependencies, and boundary violations in TypeScript and JavaScript. Inheritance-aware class member detection, CSS/SCSS tracking, and cycle detection built into the module graph.\ \ Next](https://docs.fallow.tools/analysis/dead-code) ⌘I On this page * [Static analysis](https://docs.fallow.tools/analysis#static-analysis) * [Runtime analysis](https://docs.fallow.tools/analysis#runtime-analysis) * [Supporting topics](https://docs.fallow.tools/analysis#supporting-topics) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis/boundaries#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis Architecture boundaries [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. `fallow dead-code` enforces architecture boundaries by checking that imports between directories follow your rules. Define zones and declare which zones may import from which. fallow dead-code --boundary-violations Boundary violations are included in `fallow dead-code` output by default. Use `--boundary-violations` to show only boundary issues. [​](https://docs.fallow.tools/analysis/boundaries#quick-start-with-presets) Quick start with presets ------------------------------------------------------------------------------------------------------- The fastest way to add boundaries is with a built-in preset. Fallow ships four presets for common architecture patterns: .fallowrc.json fallow.toml { "boundaries": { "preset": "bulletproof" } } Run `fallow list --boundaries` to see the expanded zones and rules: $ fallow list --boundaries Boundaries: 4 zones, 4 rules Zones: app 3 files src/app/** features 12 files src/features/** shared 8 files src/components/**, src/hooks/**, src/lib/**, ... server 4 files src/server/** Rules: app → features, shared, server features → shared, server server → shared shared (isolated — no imports allowed) [​](https://docs.fallow.tools/analysis/boundaries#presets) Presets --------------------------------------------------------------------- * Bulletproof * Layered * Hexagonal * Feature-Sliced A widely used React/Next.js pattern. Feature modules are isolated from each other; shared utilities and server infrastructure form the base layers.**4 zones:** `app`, `features`, `shared`, `server` app → features, shared, server features → shared, server server → shared shared (isolated) The `shared` zone covers: `components`, `hooks`, `lib`, `utils`, `utilities`, `providers`, `shared`, `types`, `styles`, `i18n`. This preset matches the architecture from [Bulletproof React](https://github.com/alan2207/bulletproof-react) and is the most common pattern in modern React and Next.js projects. Classic N-tier architecture with four layers. Infrastructure may import from both domain and application (common for dependency injection).**4 zones:** `presentation`, `application`, `domain`, `infrastructure` presentation → application application → domain domain (isolated) infrastructure → domain, application Ports and adapters pattern. The domain has zero outward dependencies; adapters implement port interfaces.**3 zones:** `adapters`, `ports`, `domain` adapters → ports ports → domain domain (isolated) [Feature-Sliced Design](https://fsd.how/) with strict downward-only imports. Each layer may only import from layers below it.**6 zones:** `app`, `pages`, `widgets`, `features`, `entities`, `shared` app → pages, widgets, features, entities, shared pages → widgets, features, entities, shared widgets → features, entities, shared features → entities, shared entities → shared shared (isolated) ### [​](https://docs.fallow.tools/analysis/boundaries#source-root-detection) Source root detection Preset zone patterns use `{rootDir}/{zone}/**`. Fallow auto-detects the source root from `tsconfig.json`: tsconfig.json { "compilerOptions": { "rootDir": "./lib" // zones become lib/app/**, lib/features/**, etc. } } If no `rootDir` is found, fallow falls back to `src`. [​](https://docs.fallow.tools/analysis/boundaries#custom-zones-and-rules) Custom zones and rules --------------------------------------------------------------------------------------------------- For full control, define zones and rules directly: .fallowrc.json fallow.toml { "boundaries": { "zones": [\ { "name": "ui", "patterns": ["src/components/**", "src/pages/**"] },\ { "name": "data", "patterns": ["src/db/**", "src/api/**"] },\ { "name": "shared", "patterns": ["src/lib/**", "src/utils/**"] }\ ], "rules": [\ { "from": "ui", "allow": ["shared"] },\ { "from": "data", "allow": ["shared"] },\ { "from": "shared", "allow": [] }\ ] } } ### [​](https://docs.fallow.tools/analysis/boundaries#how-zones-work) How zones work * A file belongs to the **first zone** whose pattern matches (first-match wins) * Files that don’t match any zone are **unrestricted**: they can import from and be imported by any zone * **Self-imports** are always allowed (files in the same zone can freely import each other) * A zone with **no rule entry** is unrestricted: it can import from any zone * A zone with a rule and an **empty `allow` list** is isolated: it cannot import from other zones ### [​](https://docs.fallow.tools/analysis/boundaries#subtree-scope-root) Subtree scope (`root`) Monorepos with per-package boundaries usually have the same internal directory layout under each package (`packages/app/src/`, `packages/core/src/`, …). Writing flat patterns from the project root forces zone definitions to scale with the cross product of (zones, packages): // Without `root`: one zone per (layer, package) pair. { "name": "ui-app", "patterns": ["packages/app/src/**"] }, { "name": "domain-core", "patterns": ["packages/core/src/**"] } Set `root` on a zone to scope its patterns to a subtree. At classification time, fallow checks that the file’s path starts with the `root` prefix and strips that prefix before matching the patterns against the remainder. Files outside the subtree never match the zone. .fallowrc.json fallow.toml { "boundaries": { "zones": [\ { "name": "ui", "patterns": ["src/**"], "root": "packages/app/" },\ { "name": "domain", "patterns": ["src/**"], "root": "packages/core/" }\ ], "rules": [\ { "from": "ui", "allow": [] }\ ] } } In this example, `packages/app/src/login.tsx` classifies as `ui` and `packages/core/src/order.ts` classifies as `domain`. Adding `packages/billing/` later only requires another zone entry with the same `patterns: ["src/**"]` and a different `root`. Trailing slashes and a leading `./` are normalized for you, so `"packages/app"`, `"packages/app/"`, and `"./packages/app/"` are equivalent. Backslashes are converted to forward slashes. Patterns must NOT redundantly include the root prefix. `root: "packages/app/"` paired with `patterns: ["packages/app/src/**"]` is rejected at config-resolve time with `FALLOW-BOUNDARY-ROOT-REDUNDANT-PREFIX`, because patterns are already resolved relative to the root. Drop the root prefix from the pattern (`patterns: ["src/**"]`). ### [​](https://docs.fallow.tools/analysis/boundaries#overriding-preset-zones) Overriding preset zones Start from a preset and customize specific zones or rules. Zones with the same name replace the preset zone; rules with the same `from` replace the preset rule. { "boundaries": { "preset": "hexagonal", "zones": [\ { "name": "domain", "patterns": ["src/core/**"] }\ ] } } This keeps `adapters` and `ports` from the hexagonal preset but replaces the `domain` zone pattern with `src/core/**`. [​](https://docs.fallow.tools/analysis/boundaries#suppressing-violations) Suppressing violations --------------------------------------------------------------------------------------------------- Suppress individual findings with inline comments: // fallow-ignore-next-line boundary-violation import { db } from '../data/client'; Or suppress all boundary violations in a file: // fallow-ignore-file boundary-violation To suppress boundary checking entirely, set the rule severity to `off`: { "rules": { "boundary-violation": "off" } } When introducing boundaries to an existing codebase, start with `"warn"` severity. Fix violations incrementally, then switch to `"error"` once the codebase is clean. [​](https://docs.fallow.tools/analysis/boundaries#output-formats) Output formats ----------------------------------------------------------------------------------- Boundary violations appear in all output formats: * Human * JSON * Compact $ fallow dead-code --boundary-violations Boundary violations (2) src/features/auth/login.ts:3 → src/features/billing/api.ts (features → features) src/components/Button.tsx:1 → src/server/db/client.ts (shared → server) { "boundary_violations": [\ {\ "from_path": "src/features/auth/login.ts",\ "to_path": "src/features/billing/api.ts",\ "from_zone": "features",\ "to_zone": "features",\ "import_specifier": "../billing/api",\ "line": 3,\ "col": 0\ }\ ] } The full JSON output includes a `schema_version`, `version`, `elapsed_ms`, and all issue type arrays. Only `boundary_violations` is shown here. boundary-violation:src/features/auth/login.ts:3:src/features/auth/login.ts -> src/features/billing/api.ts (features -> features) [​](https://docs.fallow.tools/analysis/boundaries#inspecting-your-boundaries) Inspecting your boundaries ----------------------------------------------------------------------------------------------------------- Use `fallow list --boundaries` to verify your configuration before running analysis: # Human-readable summary fallow list --boundaries # JSON for scripting or MCP tools fallow list --boundaries --format json --quiet Fallow warns when a zone matches zero files. This usually means the glob pattern doesn’t match your directory structure. Run `fallow list --boundaries` to check file counts per zone. [​](https://docs.fallow.tools/analysis/boundaries#see-also) See also ----------------------------------------------------------------------- fallow dead-code ---------------- CLI reference for the dead code command, including all issue type filters. Rules & Severity ---------------- Set boundary violations to error, warn, or off. Inline Suppression ------------------ Suppress individual findings in source code. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/analysis/boundaries.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/analysis/boundaries) [Previous](https://docs.fallow.tools/analysis/duplication) [Auto-fixAutomatically remove unused exports and dependencies from your TypeScript and JavaScript codebase. Supports dry-run preview and non-interactive agent workflows.\ \ Next](https://docs.fallow.tools/analysis/auto-fix) ⌘I On this page * [Quick start with presets](https://docs.fallow.tools/analysis/boundaries#quick-start-with-presets) * [Presets](https://docs.fallow.tools/analysis/boundaries#presets) * [Source root detection](https://docs.fallow.tools/analysis/boundaries#source-root-detection) * [Custom zones and rules](https://docs.fallow.tools/analysis/boundaries#custom-zones-and-rules) * [How zones work](https://docs.fallow.tools/analysis/boundaries#how-zones-work) * [Subtree scope (root)](https://docs.fallow.tools/analysis/boundaries#subtree-scope-root) * [Overriding preset zones](https://docs.fallow.tools/analysis/boundaries#overriding-preset-zones) * [Suppressing violations](https://docs.fallow.tools/analysis/boundaries#suppressing-violations) * [Output formats](https://docs.fallow.tools/analysis/boundaries#output-formats) * [Inspecting your boundaries](https://docs.fallow.tools/analysis/boundaries#inspecting-your-boundaries) * [See also](https://docs.fallow.tools/analysis/boundaries#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis/production-mode#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis Production mode [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Production mode restricts analysis to code that ships to users, ignoring test and development files. fallow dead-code --production Or set it in your config: // .fallowrc.json { "production": true } [​](https://docs.fallow.tools/analysis/production-mode#what-changes-in-production-mode) What changes in production mode -------------------------------------------------------------------------------------------------------------------------- | Behavior | Default | Production | | --- | --- | --- | | Test files (`*.test.*`, `*.spec.*`, `__tests__/`) | Included | Excluded | | Story files (`*.stories.*`) | Included | Excluded | | Mock files (`__mocks__/`) | Included | Excluded | | Package.json scripts analyzed | All | Only `start`, `build`, `serve`, `preview`, `prepare`, `prepublishOnly`, `postinstall`, and `pre`/`post` lifecycle hooks for `start`, `build`, `serve`, `install` | | Unused devDependencies | Reported | Skipped | | Type-only dependencies | Not flagged | Flagged (should be devDependencies) | $ fallow dead-code --production ● Unused exports (2) src/utils/format.ts :12 formatCurrency :28 formatPercentage Exported symbols with zero references — https://docs.fallow.tools/explanations/dead-code#unused-exports ● Unused dependencies (1) moment Packages in dependencies never imported — https://docs.fallow.tools/explanations/dead-code#unused-dependencies ● Type-only dependencies (1) zod → move to devDependencies (only imported via 'import type') Production dependencies only used as types — https://docs.fallow.tools/explanations/dead-code#type-only-dependencies ✗ 4 issues (19ms, production mode, 623/847 files) [​](https://docs.fallow.tools/analysis/production-mode#type-only-dependency-detection) Type-only dependency detection ------------------------------------------------------------------------------------------------------------------------ In production mode, fallow detects dependencies that are only imported via `import type`: import type { Config } from 'some-package'; // Type-only, erased at runtime These packages belong in `devDependencies` since types are erased at runtime and don’t need to be installed in production. In monorepos, production mode catches dependencies that should be devDependencies, keeping each package’s install footprint minimal. [​](https://docs.fallow.tools/analysis/production-mode#see-also) See also ---------------------------------------------------------------------------- CI Integration -------------- Use production mode in your CI pipeline for lean, fast checks. Rules & Severity ---------------- Control which issue types are errors, warnings, or disabled. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/analysis/production-mode.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/analysis/production-mode) [Previous](https://docs.fallow.tools/analysis/runtime-coverage) [Non-JS file typesFallow analyzes HTML, Vue, Svelte, Astro, MDX, CSS modules, SCSS, and React Native files automatically. No plugins or config needed.\ \ Next](https://docs.fallow.tools/analysis/file-types) ⌘I On this page * [What changes in production mode](https://docs.fallow.tools/analysis/production-mode#what-changes-in-production-mode) * [Type-only dependency detection](https://docs.fallow.tools/analysis/production-mode#type-only-dependency-detection) * [See also](https://docs.fallow.tools/analysis/production-mode#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis/limitations#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis Known limitations [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Fallow is a syntactic analyzer: no TypeScript compiler, no type resolution. The trade-off is speed; the cost is that type-conditional dead code is not detectable. The limitations below apply to specific patterns. Standard TypeScript projects with `isolatedModules: true` are unaffected by most of them. Syntactic analysis only (no TypeScript type information) Fallow parses source code as syntax trees using Oxc and uses `oxc_semantic` for scope-aware binding analysis. It does **not** invoke the TypeScript compiler or resolve type information. This trade-off is what makes fallow fast.**Impact:** Type-only imports (`import type { Foo }`) are handled correctly. Value imports used only as type annotations (e.g., `import { Foo }` followed by `const x: Foo`) are also tracked correctly via `oxc_semantic` reference counting. Conditional type exports or dead code behind generic interfaces would require actual type resolution to detect.**Workaround:** Set `isolatedModules: true` in `tsconfig.json`. esbuild, swc, and Vite already require this, so most modern projects have it. With `isolatedModules`, every import is either explicitly `import type` or a real value import, removing ambiguity. tsconfig.json { "compilerOptions": { "isolatedModules": true } } Svelte export let prop ambiguity In Svelte components, `export let` declarations serve double duty: they define component props **and** regular exports. Fallow can’t distinguish between props (used by consumers via the template) and utility exports that may genuinely be unused.**Impact:** Some unused exports in `.svelte` files may not be reported.**Workaround:** No configuration workaround exists. Review Svelte component exports manually. Extract utility functions into separate `.ts` files where fallow can track them accurately. This limitation is about `export let` prop detection only. Fallow **does** track template-visible imports since v2.15.0: component tags, directives (`use:tooltip`, `v-focus-trap`), expressions, `$store` subscriptions in Svelte, and `v-on`/`v-bind` object syntax in Vue are all correctly credited as used. See [File types](https://docs.fallow.tools/analysis/file-types) for details. CSS/SCSS regex-based parsing CSS and SCSS files are parsed with lightweight regex extraction rather than a full CSS parser. This covers the most common patterns but not the entire CSS specification.**What’s tracked:** * `@import` and `@use` statements * `@forward` rules * `@apply` and `@tailwind` directives (as Tailwind dependency usage) **What’s not tracked:** * `composes:` (CSS Modules composition) * `:global()` and `:local()` pseudo-selectors * Complex selector-based dependencies **Workaround:** If fallow reports false positives for CSS files that use `composes:` or `:global()`, suppress them with `ignorePatterns` or inline comments. .fallowrc.json { "ignorePatterns": ["**/legacy-styles/**/*.css"] } NestJS and dependency injection class members Fallow tracks class member usage syntactically by looking for direct references in source code. In NestJS and other DI frameworks, abstract class methods may be invoked at runtime through the DI container without appearing as direct references.**Impact:** Abstract class methods and properties consumed via dependency injection may be reported as unused.**Workaround:** Disable `unused-class-members` for DI-heavy projects: .fallowrc.json fallow.toml { "rules": { "unused-class-members": "off" } } Library consumer types (noisy but correct) If your package exports types for external consumers (e.g., `ButtonProps`, `Config`), fallow correctly reports them as unused within your project, because they are. No internal file imports them.**Impact:** Correct findings that are noisy for library authors.**Workaround:** Use `ignoreExports` to mark public API files: .fallowrc.json { "ignoreExports": [\ { "file": "src/index.ts", "exports": ["*"] },\ { "file": "src/types.ts", "exports": ["*"] }\ ] } Config parsing ceiling Fallow’s built-in plugins parse config files (e.g., `vite.config.ts`, `jest.config.js`) using Oxc’s AST parser. This handles static objects, arrays, and `defineConfig()` wrappers, but it can’t evaluate arbitrary JavaScript.**What’s handled:** * Static object literals and arrays * `defineConfig()` / `module.exports` wrappers * String concatenation in simple cases **What’s not handled:** * Computed property keys * Conditional expressions (`process.env.NODE_ENV === 'production' ? ... : ...`) * Nested factory functions * Dynamic `require()` with variables **Workaround:** Add undetected entry points manually in your fallow config: .fallowrc.json { "entry": ["src/dynamic-entry.ts", "scripts/*.ts"] } React Native native modules React Native auto-linked native packages (installed via `npx pod-install` or auto-linking) aren’t detected as used by fallow. These packages may not have any explicit `import` in JavaScript code.**Impact:** Auto-linked packages like `react-native-screens` or `react-native-gesture-handler` may be reported as unused dependencies.**Workaround:** Add auto-linked packages to `ignoreDependencies`: .fallowrc.json { "ignoreDependencies": [\ "react-native-screens",\ "react-native-gesture-handler",\ "react-native-safe-area-context"\ ] } LSP column offsets are byte-based The fallow LSP server reports column positions as byte offsets rather than character offsets. For ASCII-only source files this makes no difference. For files with multi-byte characters (emoji, CJK, accented characters), the column number may be off by a few positions.**Impact:** Diagnostic squiggles in VS Code may be slightly misaligned on lines containing non-ASCII characters.**Workaround:** This is a cosmetic issue only. The line number and file path are always correct, so navigation still works. A fix is planned for a future release. [​](https://docs.fallow.tools/analysis/limitations#see-also) See also ------------------------------------------------------------------------ Inline suppression ------------------ Suppress individual false positives directly in source code. Configuration ------------- Full config file reference for ignorePatterns, ignoreExports, and rules. Agent integration ----------------- How agents handle false positives via config and suppression. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/analysis/limitations.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/analysis/limitations) [Previous](https://docs.fallow.tools/analysis/debugging) [ConfigurationConfigure fallow with .fallowrc.json or fallow.toml. Customize entry points, ignore patterns, rules, and plugin settings for your project.\ \ Next](https://docs.fallow.tools/configuration/overview) ⌘I On this page * [See also](https://docs.fallow.tools/analysis/limitations#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis/debugging#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis Debugging & troubleshooting [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. When fallow reports something unexpected, built-in tracing and performance tools help you understand _why_. [​](https://docs.fallow.tools/analysis/debugging#tracing-export-usage) Tracing export usage ---------------------------------------------------------------------------------------------- Use `--trace FILE:EXPORT` to see the full usage chain for a specific export. Answers the question: “Who uses this export, and through which re-export paths?” fallow dead-code --trace src/utils/format.ts:formatCurrency $ fallow dead-code --trace src/utils/format.ts:formatCurrency UNUSED formatCurrency in src/utils/format.ts File: reachable Reason: No references found — export is unused Prints every file that imports `formatCurrency`, including indirect usage through barrel re-exports. Use this when: * An export you expected to be used is reported as unused. * You want to understand which consumers depend on a symbol before removing it. * A re-export chain is not being resolved as expected. [​](https://docs.fallow.tools/analysis/debugging#tracing-file-edges) Tracing file edges ------------------------------------------------------------------------------------------ Use `--trace-file PATH` to see all incoming and outgoing edges for a file in the module graph. Answers the question: “What does this file import, and what imports this file?” fallow dead-code --trace-file src/components/Button.tsx Shows every import the file makes and every file that imports from it. Use this when: * A file is reported as unused but you believe something should reference it. * You want to verify that a file is reachable from entry points. * You’re investigating why a file’s exports are all marked unused (maybe the file itself is unreachable). [​](https://docs.fallow.tools/analysis/debugging#tracing-dependency-usage) Tracing dependency usage ------------------------------------------------------------------------------------------------------ Use `--trace-dependency PACKAGE` to find everywhere a package is used: imports, script binaries, and plugin detection. Answers the question: “Where is this dependency actually consumed?” fallow dead-code --trace-dependency lodash $ fallow dead-code --trace-dependency moment UNUSED moment (0 import(s)) Reports all import sites, `package.json` script binary usage, and plugin-based detection for the given package. Use this when: * A dependency is reported as unused but you believe it’s used in scripts or config files. * You want to audit which parts of your codebase depend on a specific package. * You’re evaluating whether a dependency can be removed. [​](https://docs.fallow.tools/analysis/debugging#tracing-duplication-clones) Tracing duplication clones ---------------------------------------------------------------------------------------------------------- Use `dupes --trace FILE:LINE` to see all clone instances at a specific source location. Answers the question: “Where else does this duplicated code appear?” fallow dupes --trace src/utils/validate.ts:42 Shows every other location that shares the same clone group as the code at the given line. Use this when: * You want to find all copies of a duplicated block before refactoring. * You’re deciding whether to extract a shared function or module. * A duplication finding seems incorrect and you want to inspect the matched instances. [​](https://docs.fallow.tools/analysis/debugging#performance-profiling) Performance profiling ------------------------------------------------------------------------------------------------ Use `--performance` to get a timing breakdown of each pipeline stage. Answers the question: “Where is fallow spending time?” fallow dead-code --performance fallow dupes --performance $ fallow dead-code --performance ┌─ Pipeline Performance ───────────────────────────── │ discover files: 12ms (847 files) │ plugins: 2ms │ parse/extract: 8ms (847 modules, 812 cached, 35 parsed) │ cache update: 2ms │ entry points: 1ms (388 entries) │ resolve imports: 3ms │ build graph: 1ms │ analyze: 2ms │ ──────────────────────────────────────────────── │ TOTAL: 31ms └─────────────────────────────────────────────────── Use this when: * Analysis is slower than expected and you want to find the bottleneck. * You want to verify the cache is working (high hit rate means incremental runs are fast). * You’re comparing performance across different configuration options. [​](https://docs.fallow.tools/analysis/debugging#cache-behavior) Cache behavior ---------------------------------------------------------------------------------- Fallow caches parsed AST data using bincode serialization with xxh3 hashing. On later runs, unchanged files load from cache instead of being re-parsed. # Run with caching (default) fallow dead-code # Skip the cache entirely fallow dead-code --no-cache Use `--no-cache` when: * You suspect stale cache entries are causing incorrect results. * You’ve changed fallow versions and want a clean analysis. * You’re benchmarking full parse performance. The `--performance` flag shows cache statistics, including how many files were cache hits vs. misses. A high hit rate on incremental runs is expected. Only modified files need re-parsing. [​](https://docs.fallow.tools/analysis/debugging#common-false-positives) Common false positives -------------------------------------------------------------------------------------------------- ### [​](https://docs.fallow.tools/analysis/debugging#dynamic-imports-with-runtime-values) Dynamic imports with runtime values Fallow resolves template literals and `import.meta.glob`, but fully dynamic imports like `import(variable)` can’t be resolved statically. **Fix**: Add the target directory to `entry` in your config: { "entry": ["src/plugins/*.ts"] } ### [​](https://docs.fallow.tools/analysis/debugging#convention-based-exports) Convention-based exports Some frameworks consume exports by naming convention rather than explicit imports. For example, Next.js `generateStaticParams` or Remix `loader` functions. **Fix**: Fallow’s built-in plugins already handle most frameworks. If you’re using a niche framework, create a [custom plugin](https://docs.fallow.tools/frameworks/custom-plugins) or use `ignoreExports`: { "ignoreExports": [\ { "file": "src/routes/**/*.ts", "exports": ["loader", "action"] }\ ] } ### [​](https://docs.fallow.tools/analysis/debugging#dependency-injection-frameworks) Dependency injection frameworks DI containers (NestJS, Angular, InversifyJS) resolve dependencies at runtime via decorators and metadata. Fallow skips decorated class members, but injected services may look unused if they’re only referenced via DI tokens. **Fix**: Add the DI-registered files as entry points, or suppress specific findings: // fallow-ignore-next-line unused-export export class UserService { /* ... */ } ### [​](https://docs.fallow.tools/analysis/debugging#peer-dependencies-and-optional-dependencies) Peer dependencies and optional dependencies Packages listed in `peerDependencies` or `optionalDependencies` are not analyzed by default since they may be provided by the consuming project. **Fix**: If fallow incorrectly flags these, add them to `ignoreDependencies`: { "ignoreDependencies": ["react", "react-dom"] } ### [​](https://docs.fallow.tools/analysis/debugging#config-files-not-recognized-as-entry-points) Config files not recognized as entry points If a config file (e.g., `tailwind.config.ts`) is reported as unused, its framework plugin may not be active. **Fix**: Run `fallow list` to check which plugins are active. If the relevant plugin isn’t detected, add the config file to `entry`: { "entry": ["tailwind.config.ts"] } [​](https://docs.fallow.tools/analysis/debugging#see-also) See also ---------------------------------------------------------------------- Dead Code Analysis ------------------ Overview of how fallow detects unused code. CLI: dead-code -------------- Full reference for the `fallow dead-code` command and all its flags. Inline Suppression ------------------ Suppress individual findings with inline comments. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/analysis/debugging.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/analysis/debugging) [Previous](https://docs.fallow.tools/analysis/css-analysis) [Known limitationsKnown limitations of fallow's syntactic analysis, including dynamic imports, runtime patterns, and framework-specific edge cases with workarounds.\ \ Next](https://docs.fallow.tools/analysis/limitations) ⌘I On this page * [Tracing export usage](https://docs.fallow.tools/analysis/debugging#tracing-export-usage) * [Tracing file edges](https://docs.fallow.tools/analysis/debugging#tracing-file-edges) * [Tracing dependency usage](https://docs.fallow.tools/analysis/debugging#tracing-dependency-usage) * [Tracing duplication clones](https://docs.fallow.tools/analysis/debugging#tracing-duplication-clones) * [Performance profiling](https://docs.fallow.tools/analysis/debugging#performance-profiling) * [Cache behavior](https://docs.fallow.tools/analysis/debugging#cache-behavior) * [Common false positives](https://docs.fallow.tools/analysis/debugging#common-false-positives) * [Dynamic imports with runtime values](https://docs.fallow.tools/analysis/debugging#dynamic-imports-with-runtime-values) * [Convention-based exports](https://docs.fallow.tools/analysis/debugging#convention-based-exports) * [Dependency injection frameworks](https://docs.fallow.tools/analysis/debugging#dependency-injection-frameworks) * [Peer dependencies and optional dependencies](https://docs.fallow.tools/analysis/debugging#peer-dependencies-and-optional-dependencies) * [Config files not recognized as entry points](https://docs.fallow.tools/analysis/debugging#config-files-not-recognized-as-entry-points) * [See also](https://docs.fallow.tools/analysis/debugging#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis/duplication#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis Code duplication [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. `fallow dupes` finds duplicated code blocks across your entire codebase. 8-26x faster than jscpd on real-world projects. fallow dupes [​](https://docs.fallow.tools/analysis/duplication#why-built-in-duplication-matters) Why built-in duplication matters ------------------------------------------------------------------------------------------------------------------------ Most dead-code analysis tools stop at finding unused exports and unreachable files. Fallow goes further: it includes duplication detection in the same binary, using the same module graph. This means you can cross-reference dead code with duplication in a single pass. When you run `fallow dead-code --include-dupes`, fallow identifies code blocks that are both duplicated and unused. These are the highest-value cleanup targets: removing them eliminates dead code and reduces duplication simultaneously. Running duplication analysis alongside dead-code detection also means: * **One tool, one config, one CI step**: No need to install and configure a separate duplication detector * **Shared file discovery**: The same ignore patterns, entry points, and workspace config apply to both analyses * **Cross-analysis insights**: Clone families that span unused files are flagged as combined findings * **Consistent output formats**: JSON, SARIF, markdown, compact, and CodeClimate output work the same way for duplication as for dead code [​](https://docs.fallow.tools/analysis/duplication#detection-modes) Detection modes -------------------------------------------------------------------------------------- * Strict * Mild (default) * Weak * Semantic Exact token-for-token clones only. No normalization is applied; the code must be character-identical after tokenization. fallow dupes --mode strict Best for finding exact copy-paste where nothing was changed. The default mode. Strict and mild modes produce identical results. AST-based tokenization already strips whitespace and comments before comparison. fallow dupes --mode mild The recommended starting point for general-purpose detection. Matches clones even when string literal values differ. Variable names must still match. fallow dupes --mode weak Good for finding code that was duplicated and only had strings (URLs, messages, labels) changed. Catches clones with renamed variables and different literal values. Uses token-type normalization to match structurally equivalent code. fallow dupes --mode semantic The most aggressive mode. Finds code that was copied and then adapted with new variable names and values. Start with `mild` mode (default). Upgrade to `semantic` when you want to catch clones with renamed variables. Here’s what typical output looks like: $ fallow dupes ● Duplicates (3 clone groups) 57 lines 2 instances src/components/Calendar/CalendarMonth.stories.tsx:597-653 src/components/Calendar/CalendarYear.stories.tsx:818-874 42 lines 3 instances src/features/forecasting/server/procedures/analytics.ts:141-181 src/features/forecasting/server/procedures/cashflow.ts:153-194 src/features/forecasting/server/procedures/income.ts:590-631 Identical code blocks detected via suffix-array analysis — https://docs.fallow.tools/explanations/duplication#clone-groups ✓ 27,255 lines (19.4%) duplicated across 398 files (0.23s) In semantic mode, fallow also reports renamed identifiers: $ fallow dupes --mode semantic ● Duplicates (2 clone groups) 196 lines 2 instances src/lib/dutch-holidays.ts:193-388 src/lib/dutch-holidays.ts:389-584 Renamed: holidays2024→holidays2025, year2024→year2025 42 lines 3 instances src/features/forecasting/server/procedures/analytics.ts:141-181 src/features/forecasting/server/procedures/cashflow.ts:153-194 src/features/forecasting/server/procedures/income.ts:590-631 Renamed: analyticsData→cashflowData→incomeData Identical code blocks detected via suffix-array analysis — https://docs.fallow.tools/explanations/duplication#clone-groups ✗ 94,457 lines (67.2%) duplicated across 775 files (3.74s) [​](https://docs.fallow.tools/analysis/duplication#thresholds-and-limits) Thresholds and limits -------------------------------------------------------------------------------------------------- fallow dupes --min-tokens 50 # Minimum tokens per clone (default: 50) fallow dupes --min-lines 5 # Minimum lines per clone (default: 5) fallow dupes --threshold 5 # Fail if duplication exceeds 5% fallow dupes --skip-local # Only cross-directory duplicates [​](https://docs.fallow.tools/analysis/duplication#clone-families) Clone families ------------------------------------------------------------------------------------ Clone groups sharing the same file set are grouped into **clone families** with refactoring suggestions: * **Extract function**: clones are in the same file * **Extract module**: clones span multiple files [​](https://docs.fallow.tools/analysis/duplication#cross-language-detection) Cross-language detection -------------------------------------------------------------------------------------------------------- Compare TypeScript and JavaScript files by stripping type annotations: fallow dupes --cross-language Fallow normalizes `.ts` files to their `.js` equivalent for comparison. This catches clones where one copy was converted from TypeScript to JavaScript or vice versa. [​](https://docs.fallow.tools/analysis/duplication#ignoring-imports) Ignoring imports ---------------------------------------------------------------------------------------- Files with the same set of imports (sorted alphabetically by a formatter) often produce false-positive clones. Strip `import` declarations from the token stream: fallow dupes --ignore-imports Or set it permanently in config: { "duplicates": { "ignoreImports": true } } Only affects ES `import` statements. CommonJS `require()` calls and re-exports are not filtered. [​](https://docs.fallow.tools/analysis/duplication#incremental-analysis) Incremental analysis ------------------------------------------------------------------------------------------------ Only check duplication in files changed since a git ref: fallow dupes --changed-since main Useful in CI to only report new duplication introduced in a pull request. [​](https://docs.fallow.tools/analysis/duplication#baseline-comparison) Baseline comparison ---------------------------------------------------------------------------------------------- Adopt duplication limits incrementally: # Save current duplication as baseline fallow dupes --save-baseline fallow-baselines/dupes.json # Fail only on new duplication fallow dupes --baseline fallow-baselines/dupes.json [​](https://docs.fallow.tools/analysis/duplication#debugging) Debugging -------------------------------------------------------------------------- Trace all clones of a specific code location: fallow dupes --trace src/utils.ts:42 [​](https://docs.fallow.tools/analysis/duplication#benchmarks-vs-jscpd) Benchmarks vs jscpd ---------------------------------------------------------------------------------------------- | Project | Files | fallow | jscpd | Speedup | | --- | --- | --- | --- | --- | | [fastify](https://github.com/fastify/fastify) | 286 | **76ms** | 1.96s | **26x** | | [vue/core](https://github.com/vuejs/core) | 522 | **124ms** | 3.11s | **25x** | | [next.js](https://github.com/vercel/next.js) | 20,416 | **2.89s** | 24.37s | **8x** | Fallow uses a suffix array with LCP for clone detection, avoiding quadratic pairwise comparison. [​](https://docs.fallow.tools/analysis/duplication#see-also) See also ------------------------------------------------------------------------ CLI: dupes ---------- Full reference for the `fallow dupes` command and its flags. Configuration ------------- Set default duplication thresholds and modes in your config file. Migrating from jscpd -------------------- Replace jscpd with fallow in your project. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/analysis/duplication.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/analysis/duplication) [Previous](https://docs.fallow.tools/analysis/dead-code) [Architecture boundariesEnforce architecture rules with directory-based import boundaries. Define zones for UI, data, and shared code. Fallow catches violations at Rust speed.\ \ Next](https://docs.fallow.tools/analysis/boundaries) ⌘I On this page * [Why built-in duplication matters](https://docs.fallow.tools/analysis/duplication#why-built-in-duplication-matters) * [Detection modes](https://docs.fallow.tools/analysis/duplication#detection-modes) * [Thresholds and limits](https://docs.fallow.tools/analysis/duplication#thresholds-and-limits) * [Clone families](https://docs.fallow.tools/analysis/duplication#clone-families) * [Cross-language detection](https://docs.fallow.tools/analysis/duplication#cross-language-detection) * [Ignoring imports](https://docs.fallow.tools/analysis/duplication#ignoring-imports) * [Incremental analysis](https://docs.fallow.tools/analysis/duplication#incremental-analysis) * [Baseline comparison](https://docs.fallow.tools/analysis/duplication#baseline-comparison) * [Debugging](https://docs.fallow.tools/analysis/duplication#debugging) * [Benchmarks vs jscpd](https://docs.fallow.tools/analysis/duplication#benchmarks-vs-jscpd) * [See also](https://docs.fallow.tools/analysis/duplication#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis/runtime-coverage#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis Runtime coverage [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Runtime coverage adds a runtime layer on top of `fallow health`. Static analysis can tell you which exports have no references and which files are not test-reachable. Runtime coverage answers a different question: which functions actually executed when your deployed app handled real traffic. fallow license activate --trial --email you@company.com fallow coverage setup fallow health --runtime-coverage ./coverage [​](https://docs.fallow.tools/analysis/runtime-coverage#what-it-tells-you) What it tells you ----------------------------------------------------------------------------------------------- When runtime coverage is enabled, fallow merges runtime evidence into the existing health report and assigns each function a **per-finding verdict** combining the static reachability signal with observed production invocations: | Verdict | Meaning | | --- | --- | | `safe_to_delete` | Statically unused AND V8 tracked AND zero invocations. The strongest delete signal fallow emits. | | `review_required` | Statically used but never invoked in production. Needs a human look: could be seasonal, error-path-only, or legitimately dead. | | `low_traffic` | Invoked in production, but below the configured `--low-traffic-threshold` ratio of total trace count (spec default 0.1%). Effectively dead for the observed period. | | `coverage_unavailable` | V8 could not track the function (lazy-parsed, worker-thread isolate, dynamic `eval`, or the source map did not resolve). Advisory, not a dead-code signal. | | `active` | Invoked in production above the low-traffic threshold. Not dead. | | `unknown` | Forward-compat sentinel returned by newer sidecars. Rare. | Fallow also surfaces: | Output | Meaning | | --- | --- | | `verdict` | Overall report status: `clean`, `cold-code-detected`, `hot-path-changes-needed`, `license-expired-grace`, or `unknown`. | | `summary` | Aggregate counts (`functions_tracked`, `functions_hit`, `functions_unhit`, `functions_untracked`, `coverage_percent`) plus `trace_count`, `period_days`, `deployments_seen`, and an optional `capture_quality` block (`window_seconds`, `instances_observed`, `lazy_parse_warning`, `untracked_ratio_percent`) on protocol-0.3+ sidecars that flags short-window captures where lazy-parsed scripts may not appear. | | `findings` | Cold or unresolved functions with a stable `id` (`fallow:prod:`), `line`, per-finding `verdict`, `confidence`, supporting `evidence`, and machine-readable `actions`. | | `hot_paths` | The busiest runtime functions with a stable `id`, `line`, `invocations`, and `percentile` rank. | | `watermark` | Trial/license grace marker applied when paid-feature access is in warning mode. | | `warnings` | Non-fatal merge diagnostics, for example partial source-map remapping. | Every finding carries an **evidence block** so the “why” behind a verdict is machine-readable without re-deriving it: "evidence": { "static_status": "used", "test_coverage": "not_covered", "v8_tracking": "tracked", "untracked_reason": null, "observation_days": 30, "deployments_observed": 14 } [​](https://docs.fallow.tools/analysis/runtime-coverage#confidence-thresholds) Confidence thresholds ------------------------------------------------------------------------------------------------------- Two flags tune how aggressively fallow applies verdicts: | Flag | Default | Effect | | --- | --- | --- | | `--min-observation-volume ` | 5000 | Minimum total trace volume before the sidecar is allowed to emit high-confidence `safe_to_delete` or `review_required` verdicts. Below this threshold, confidence is capped at `medium` to protect against overconfident verdicts on new or low-traffic services. | | `--low-traffic-threshold ` | 0.001 | Fraction of `trace_count` below which an invoked function is classified `low_traffic` rather than `active`. Expressed as a decimal (0.001 = 0.1%). | [​](https://docs.fallow.tools/analysis/runtime-coverage#static-coverage-vs-runtime-coverage) Static coverage vs runtime coverage ----------------------------------------------------------------------------------------------------------------------------------- These three surfaces live side by side inside `fallow health`, but they answer different questions: | Surface | Flag | Input | Answers | Paid | | --- | --- | --- | --- | --- | | Static reachability gaps | `--coverage-gaps` | none | Which runtime files and exports have no transitive test path? | no | | Exact CRAP scoring | `--coverage` | Istanbul JSON | How covered is each function for CRAP calculation? | no | | Runtime runtime coverage | `--runtime-coverage` | V8 directory, V8 JSON file, or Istanbul JSON | Which functions actually ran, which stayed cold, and which hot paths changed? | yes | Use `--coverage-gaps` when you want to find untested code. Use `--coverage` when you want better CRAP scores. Use `--runtime-coverage` when you want runtime evidence about real execution paths. [​](https://docs.fallow.tools/analysis/runtime-coverage#accepted-input) Accepted input ----------------------------------------------------------------------------------------- `fallow health --runtime-coverage ` accepts: | Input | Example | | --- | --- | | V8 dump directory | `./coverage` created with `NODE_V8_COVERAGE=./coverage` | | Single V8 JSON file | `./coverage/12345.json` | | Single Istanbul coverage map JSON file | `./coverage/coverage-final.json` | If a V8 dump includes Node’s `source-map-cache`, fallow remaps supported source-map URLs before analysis, including file paths, relative paths, `webpack://...`, and `vite://...`. Unsupported virtual schemes fall back safely to raw V8 handling instead of failing the whole run. [​](https://docs.fallow.tools/analysis/runtime-coverage#first-run-workflow) First-run workflow ------------------------------------------------------------------------------------------------- The intended first-run path is: 1. Start a trial or activate a license with [`fallow license`](https://docs.fallow.tools/cli/license) . 2. Run [`fallow coverage setup`](https://docs.fallow.tools/cli/coverage) . 3. Follow the generated recipe in `docs/collect-coverage.md`. 4. Re-run `fallow coverage setup` or `fallow health --runtime-coverage ` once coverage exists. `fallow coverage setup` is resumable. It checks license state, installs or locates `fallow-cov`, writes a framework-specific collection recipe, detects an existing coverage artifact when present, and then hands off into `fallow health --runtime-coverage`. [​](https://docs.fallow.tools/analysis/runtime-coverage#review-changed-code) Review changed code --------------------------------------------------------------------------------------------------- Runtime coverage becomes especially useful during change review: fallow health --changed-since main --runtime-coverage ./coverage When changed files touch hot runtime code, fallow can upgrade the overall verdict to `hot-path-changes-needed`. That gives PR review a stronger signal than static complexity alone. [​](https://docs.fallow.tools/analysis/runtime-coverage#trial-and-watermark-behavior) Trial and watermark behavior --------------------------------------------------------------------------------------------------------------------- Runtime coverage is a paid feature with a trial flow. Verification is offline against a compiled-in Ed25519 public key; only `fallow license activate --trial` and `fallow license refresh` require network access. If a license is expired but still inside the grace window, fallow keeps the analysis available but annotates the output with a watermark. Once the hard-fail window is exceeded, paid features are blocked until the license is refreshed. [​](https://docs.fallow.tools/analysis/runtime-coverage#see-also) See also ----------------------------------------------------------------------------- fallow health ------------- Runtime coverage merges into the standard health report and output formats. License commands ---------------- Start a trial, inspect license status, refresh, or deactivate a local token. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/analysis/runtime-coverage.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/analysis/runtime-coverage) [Previous](https://docs.fallow.tools/analysis/auto-fix) [Production modeRestrict fallow's dead code analysis to production code by excluding test files, devDependencies, and type-only imports.\ \ Next](https://docs.fallow.tools/analysis/production-mode) ⌘I On this page * [What it tells you](https://docs.fallow.tools/analysis/runtime-coverage#what-it-tells-you) * [Confidence thresholds](https://docs.fallow.tools/analysis/runtime-coverage#confidence-thresholds) * [Static coverage vs runtime coverage](https://docs.fallow.tools/analysis/runtime-coverage#static-coverage-vs-runtime-coverage) * [Accepted input](https://docs.fallow.tools/analysis/runtime-coverage#accepted-input) * [First-run workflow](https://docs.fallow.tools/analysis/runtime-coverage#first-run-workflow) * [Review changed code](https://docs.fallow.tools/analysis/runtime-coverage#review-changed-code) * [Trial and watermark behavior](https://docs.fallow.tools/analysis/runtime-coverage#trial-and-watermark-behavior) * [See also](https://docs.fallow.tools/analysis/runtime-coverage#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis/dead-code#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis Dead code analysis [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. `fallow dead-code` performs dead code analysis on your TypeScript project. It builds a module graph from your entry points and reports anything that isn’t reachable. Finding dead code requires building a complete module graph. Fallow does this deterministically in milliseconds, giving agents, developers, and CI pipelines the same reliable results. fallow dead-code [​](https://docs.fallow.tools/analysis/dead-code#issue-types) Issue types ---------------------------------------------------------------------------- Fallow detects 16 types of dead code: | Issue type | Description | | --- | --- | | **Unused files** | 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 `dependencies` never imported or used as script binaries | | **Unused devDependencies** | Packages in `devDependencies` never imported or used as script binaries | | **Unused optionalDependencies** | Packages in `optionalDependencies` never imported or used as script binaries | | **Unused enum members** | Enum values never referenced | | **Unused class members** | Class methods and properties never referenced outside their class, with inheritance tracking, decorator exclusion, and framework lifecycle allowlists | | **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** | Modules that import each other directly or transitively | | **Boundary violations** | Imports that cross user-defined architecture zone boundaries | | **Type-only dependencies** | Production dependencies only imported via `import type` (should be devDependencies) | | **Test-only dependencies** | Production dependencies only imported by test files (should be devDependencies) | | **Stale suppressions** | `fallow-ignore` comments or `@expected-unused` JSDoc tags that no longer match any issue | Most projects find 50+ unused exports on first run. Start with `--unused-exports` for the most impactful cleanup. Here’s what typical output looks like when fallow finds multiple issue types: $ fallow dead-code ● Unused files (9) scripts/check-db.ts src/features/forecasting/hooks/useCashFlowForecast.ts src/features/forecasting/hooks/useIncomeForecast.ts src/features/forecasting/hooks/useTargetProgress.ts src/features/forecasting/hooks/useYearComparison.ts ... and 4 more Files not imported or referenced by any entry point — https://docs.fallow.tools/explanations/dead-code#unused-files ● Unused exports (24) test/component-helpers.tsx (5) :33 ThemeContext :58 ToastContext :1 within (re-export) :1 waitFor (re-export) :1 act (re-export) src/server/jobs/queue.ts (3) :61 enqueueJobDelayed :206 sweepStuckProcessingJobs :276 getDeadLetterJobs Exported symbols with zero references — https://docs.fallow.tools/explanations/dead-code#unused-exports ✗ 401 issues (0.16s) [​](https://docs.fallow.tools/analysis/dead-code#filtering-by-issue-type) Filtering by issue type ---------------------------------------------------------------------------------------------------- Report only specific issue types: fallow dead-code --unused-files fallow dead-code --unused-exports --unused-types fallow dead-code --unresolved-imports --unlisted-deps [​](https://docs.fallow.tools/analysis/dead-code#output-formats) Output formats ---------------------------------------------------------------------------------- * Human (default) * JSON * SARIF * Compact * Markdown * CodeClimate Colored terminal output designed for readability. fallow dead-code --format human src/components/Card/index.ts unused-export CardFooter (line 1) src/server/jobs/queue.ts unused-export enqueueJobDelayed (line 61) unused-export sweepStuckProcessingJobs (line 206) src/server/jobs/worker.ts unused-file Not reachable from any entry point Found 401 issues (17 errors, 384 warnings) Machine-readable JSON for scripting and tooling integration. fallow dead-code --format json { "schema_version": 3, "version": "2.52.2", "elapsed_ms": 160, "total_issues": 401, "unused_files": [\ { "path": "src/server/jobs/worker.ts" }\ ], "unused_exports": [\ {\ "path": "src/server/jobs/queue.ts",\ "export_name": "enqueueJobDelayed",\ "is_type_only": false,\ "line": 61,\ "col": 0,\ "span_start": 1420,\ "is_re_export": false\ }\ ], "unused_dependencies": [\ {\ "package_name": "@trpc/react-query",\ "location": "dependencies",\ "path": "package.json",\ "line": 18,\ "used_in_workspaces": ["apps/web"]\ }\ ] } SARIF format for GitHub Code Scanning and other static analysis tools. fallow dead-code --format sarif { "$schema": "https://json.schemastore.org/sarif-2.1.0.json", "version": "2.52.2", "runs": [{\ "tool": { "driver": { "name": "fallow", "version": "2.52.2" } },\ "results": [\ {\ "ruleId": "fallow/unused-export",\ "level": "error",\ "message": { "text": "Export 'enqueueJobDelayed' is never imported by other modules" },\ "locations": [{\ "physicalLocation": {\ "artifactLocation": { "uri": "src/server/jobs/queue.ts" },\ "region": { "startLine": 61, "startColumn": 1 }\ }\ }]\ }\ ]\ }] } One-line-per-issue output, ideal for grep and editor integration. fallow dead-code --format compact unused-file:src/server/jobs/worker.ts unused-file:src/server/jobs/cron.ts unused-export:src/server/jobs/queue.ts:61:enqueueJobDelayed unused-export:src/components/Card/index.ts:1:CardFooter Formatted markdown output for PR comments and documentation. fallow dead-code --format markdown ## Fallow: 4 issues found ### Unused files (2) - `src/server/jobs/worker.ts` - `src/server/jobs/cron.ts` ### Unused exports (2) - `src/server/jobs/queue.ts` - :61 `enqueueJobDelayed` - :206 `sweepStuckProcessingJobs` Pipe directly to `gh pr comment`: fallow dead-code --format markdown | gh pr comment --body-file - CodeClimate JSON for GitLab Code Quality inline MR annotations. fallow dead-code --format codeclimate [\ {\ "type": "issue",\ "check_name": "fallow/unused-file",\ "description": "File is not reachable from any entry point",\ "categories": ["Bug Risk"],\ "severity": "major",\ "fingerprint": "a1b2c3d4e5f67890",\ "location": {\ "path": "src/server/jobs/worker.ts",\ "lines": { "begin": 1 }\ }\ },\ {\ "type": "issue",\ "check_name": "fallow/unused-export",\ "description": "Export 'enqueueJobDelayed' is never imported by other modules",\ "categories": ["Bug Risk"],\ "severity": "major",\ "fingerprint": "b2c3d4e5f6789012",\ "location": {\ "path": "src/server/jobs/queue.ts",\ "lines": { "begin": 61 }\ }\ }\ ] Use in GitLab CI for inline annotations: fallow: script: npx fallow dead-code --format codeclimate > gl-code-quality-report.json artifacts: reports: codequality: gl-code-quality-report.json [​](https://docs.fallow.tools/analysis/dead-code#incremental-analysis) Incremental analysis ---------------------------------------------------------------------------------------------- Only check files changed since a git ref: fallow dead-code --changed-since main fallow dead-code --changed-since HEAD~5 This is useful in CI to only report new issues in a pull request. $ fallow dead-code --changed-since main ● Unused exports (2) src/features/savings/hooks/usePotGroups.ts :8 usePotGroupTotals src/server/jobs/queue.ts :276 getDeadLetterJobs Exported symbols with zero references — https://docs.fallow.tools/explanations/dead-code#unused-exports ✗ 2 issues (0.04s) [​](https://docs.fallow.tools/analysis/dead-code#baseline-comparison) Baseline comparison -------------------------------------------------------------------------------------------- Adopt fallow incrementally by saving a baseline of existing issues: # Save current issues as baseline fallow dead-code --save-baseline # Only fail on new issues (compared to baseline) fallow dead-code --baseline [​](https://docs.fallow.tools/analysis/dead-code#debugging) Debugging ------------------------------------------------------------------------ Trace why an export is or isn’t considered used: fallow dead-code --trace src/utils.ts:formatDate fallow dead-code --trace-file src/utils.ts fallow dead-code --trace-dependency lodash [​](https://docs.fallow.tools/analysis/dead-code#how-it-works) How it works ------------------------------------------------------------------------------ Fallow uses syntactic analysis with scope-aware binding resolution via Oxc. No TypeScript compiler, no type information. That’s what makes it fast. The graph-based approach guarantees completeness regardless of project size. Fallow works best with projects using `isolatedModules: true` (required for esbuild, swc, and Vite). `oxc_semantic` scope analysis detects unused import bindings (imports where the bound name is never read), but legacy tsc-only projects without `isolatedModules` may still see edge cases with type-only imports. [​](https://docs.fallow.tools/analysis/dead-code#script-binary-analysis) Script binary analysis -------------------------------------------------------------------------------------------------- Fallow parses `package.json` scripts to detect CLI tool usage. This reduces false positives in unused dependency detection. When you have a script like `"lint": "eslint src/"`, fallow recognizes that `eslint` is a binary provided by the `eslint` package and marks it as used. How it works: * **Binary name to package name mapping:** Script commands like `tsc`, `vitest`, or `next` are mapped back to their parent packages (`typescript`, `vitest`, `next`). These packages won’t be reported as unused even when they’re never `import`\-ed in source code. * **`--config` arguments as entry points:** When a script references a config file (e.g., `jest --config jest.e2e.config.ts`), fallow treats that config file as an entry point. Config files won’t be flagged as unused. * **File path arguments:** Direct file references in scripts (e.g., `node scripts/seed.js`) are also recognized as entry points. * **Env wrappers and package manager runners:** Commands prefixed with `cross-env`, `npx`, `pnpx`, `yarn dlx`, or `node -r` are unwrapped to find the actual tool binary. { "scripts": { "build": "tsc && vite build", "test": "vitest --config vitest.config.ts", "lint": "cross-env NODE_ENV=production eslint src/" } } In this example, fallow detects `typescript`, `vite`, `vitest`, and `eslint` as used dependencies, and `vitest.config.ts` as an entry point. [​](https://docs.fallow.tools/analysis/dead-code#infrastructure-entry-points) Infrastructure entry points ------------------------------------------------------------------------------------------------------------ Fallow scans infrastructure config files for source file references and treats them as entry points. Worker processes, migration scripts, and other infrastructure-defined files won’t be reported as unused. Supported files: | File type | What fallow extracts | | --- | --- | | **Dockerfiles** (`Dockerfile`, `Dockerfile.*`, `*.Dockerfile`) | `RUN node`, `CMD`, `ENTRYPOINT`, esbuild invocations | | **Procfiles** | Process definitions (e.g., `worker: node dist/worker.js`) | | **fly.toml** / **fly.\*.toml** | `release_command` and process definitions | | **CI pipelines** (`.gitlab-ci.yml`, `.github/workflows/*.yml`) | `npx` and binary invocations in CI steps | Fallow searches the project root and common subdirectories (`config/`, `docker/`, `deploy/`) for these files. # Fallow detects scripts/migrate.ts and src/worker.ts as entry points FROM node:20 RUN node scripts/migrate.ts CMD ["node", "src/worker.ts"] [​](https://docs.fallow.tools/analysis/dead-code#dynamic-import-resolution) Dynamic import resolution -------------------------------------------------------------------------------------------------------- Fallow resolves dynamic imports that use patterns rather than static strings. When you write `import(\`./locales/$.json\`)\`, the import target isn’t known at analysis time. Fallow converts these patterns into glob expressions and matches them against discovered files. Supported patterns: | Pattern | Example | Resolved as | | --- | --- | --- | | Template literals | ``import(`./icons/${name}.svg`)`` | `./icons/*.svg` | | String concatenation | `import("./routes/" + path)` | `./routes/*` | | `import.meta.glob` | `import.meta.glob("./modules/*.ts")` | `./modules/*.ts` | | `require.context` | `require.context("./themes", true, /\.css$/)` | `./themes/**/*.css` | Matched files are marked as reachable in the module graph, so they won’t be reported as unused. Useful for locale files, icon sets, route modules, and other convention-based directory structures. Dynamic imports with fully runtime-computed paths (e.g., `import(userInput)`) cannot be resolved statically. Use `entry` in your config to mark those directories as entry points. [​](https://docs.fallow.tools/analysis/dead-code#re-export-chain-resolution) Re-export chain resolution ---------------------------------------------------------------------------------------------------------- Fallow resolves `export *` chains through multiple levels of barrel files with cycle detection. // utils/math.ts export const add = (a: number, b: number) => a + b; // utils/index.ts (barrel) export * from './math'; // src/index.ts (barrel) export * from './utils'; // app.ts import { add } from './src'; In this example, fallow traces the import of `add` in `app.ts` through `src/index.ts` and `utils/index.ts` back to `utils/math.ts`. The `add` export is correctly marked as used across the entire chain. Resolution handles: * **Multi-level chains:** Any depth of `export *` re-exports is followed until the original declaration is found. * **Cycle detection:** Circular re-export chains (e.g., `a` re-exports from `b`, `b` re-exports from `a`) are detected and handled gracefully. * **Mixed re-exports:** Named re-exports (`export { foo } from './bar'`) and namespace re-exports (`export * from './bar'`) are both tracked. [​](https://docs.fallow.tools/analysis/dead-code#namespace-import-narrowing) Namespace import narrowing ---------------------------------------------------------------------------------------------------------- When a file uses `import * as ns from './module'`, fallow narrows which exports are actually consumed by scanning for member accesses (`ns.foo`, `ns.bar`) and destructuring patterns (`const { foo, bar } = ns`) in the importing file. import * as utils from './utils'; // Only foo and bar are marked as used. baz remains unused const { foo } = utils; utils.bar(); Works with static imports, dynamic imports (`const mod = await import('./x')`), and require (`const mod = require('./x')`). Fallow also uses `oxc_semantic` scope analysis to detect imports where the binding is never read. An `import { foo } from './utils'` where `foo` is never referenced in the file does not count as a reference to the `foo` export. This improves unused-export detection precision. Whole-object consumption patterns like `Object.values(ns)`, `{ ...ns }`, `for (const k in ns)`, and rest destructuring (`const { a, ...rest } = ns`) conservatively mark all exports as used. Fallow can’t determine which specific members are accessed in these cases. [​](https://docs.fallow.tools/analysis/dead-code#class-member-detection) Class member detection -------------------------------------------------------------------------------------------------- Fallow detects unused public class members (methods and properties) that are never referenced outside their defining class. Unlike simple text matching, fallow understands class inheritance, decorators, and framework conventions. class OrderService { // Used: called in checkout.ts async createOrder(items: Item[]) { /* ... */ } // Unused: never called outside this class private validateItems(items: Item[]) { /* ... */ } // Excluded: decorator indicates runtime wiring @Post('/orders') handleCreateOrder() { /* ... */ } } What fallow handles automatically: * **Inheritance**: A method defined on a parent class and called via the parent type credits the child’s override as used * **Decorators**: Any decorated member is excluded from detection. Decorators like `@Get()`, `@Column()`, `@Injectable()` indicate runtime wiring * **Framework lifecycle methods**: `componentDidMount`, `ngOnInit`, `connectedCallback`, and other framework lifecycle methods are never flagged * **Whole-object patterns**: `Object.values(instance)`, `Object.keys()`, spread operators, and `for..in` loops conservatively mark all members as used Class member detection works via syntactic analysis, without invoking the TypeScript compiler. This means fallow tracks member access through the import graph, not through type resolution. [​](https://docs.fallow.tools/analysis/dead-code#css-and-scss-tracking) CSS and SCSS tracking ------------------------------------------------------------------------------------------------ Fallow tracks CSS and SCSS imports using dedicated AST-based extraction. SCSS `@use`, `@forward`, and partial imports (`_prefix` files) are resolved accurately. CSS Module class names are extracted as named exports and tracked through `styles.className` member accesses. See [CSS, SCSS, and Tailwind analysis](https://docs.fallow.tools/analysis/css-analysis) for full details. [​](https://docs.fallow.tools/analysis/dead-code#entry-point-partial-unused-exports) Entry-point partial unused exports -------------------------------------------------------------------------------------------------------------------------- When a file is an entry point (matched by a plugin or the `entry` config), fallow traditionally marks all its exports as used. Starting in v2.15.0, fallow can detect partially unused exports in entry-point files: exports that exist in an entry file but are never imported by any other module in the project. This is especially useful for framework convention files (Next.js pages, SvelteKit routes) where the framework consumes specific named exports (like `default`, `loader`, or `getStaticProps`) but the file may also export helper functions that nothing uses. Entry-point files are still considered used (never reported as unused files), but individual exports within them that have zero references are now reported as unused exports. [​](https://docs.fallow.tools/analysis/dead-code#cross-reference-with-duplication) Cross-reference with duplication ---------------------------------------------------------------------------------------------------------------------- Running `fallow dead-code --include-dupes` cross-references dead code findings with code duplication analysis. Clone instances in unused files, or overlapping with unused exports, are flagged as **combined high-priority findings**. fallow dead-code --include-dupes Use `--include-dupes` to prioritize cleanup: if a block of code is both duplicated _and_ unused, removing it eliminates dead code and reduces duplication at the same time. What the cross-reference finds: * **Clone instances in unused files:** If a file is unreachable from entry points and contains duplicated code, the duplication finding is elevated. * **Clone instances overlapping unused exports:** If an unused export contains code that is duplicated elsewhere, both findings are reported together. Use `--include-dupes` in CI to surface code that is both unused and duplicated. [​](https://docs.fallow.tools/analysis/dead-code#circular-dependency-benchmarks) Circular dependency benchmarks ------------------------------------------------------------------------------------------------------------------ Fallow detects dependency cycles during module graph construction at no extra cost. Standalone tools like madge and dpdm build their own graph from scratch. | Project | Files | fallow | madge | dpdm | vs madge | vs dpdm | | --- | --- | --- | --- | --- | --- | --- | | [zod](https://github.com/colinhacks/zod) | 174 | **17ms** | 540ms | 190ms | **32x** | **11x** | | [preact](https://github.com/preactjs/preact) | 244 | **19ms** | 298ms | 132ms | **16x** | **7x** | | [fastify](https://github.com/fastify/fastify) | 286 | **20ms** | 165ms | 132ms | **8x** | **7x** | | [vue/core](https://github.com/vuejs/core) | 522 | **59ms** | 175ms | 143ms | **3x** | **2x** | | [TanStack/query](https://github.com/TanStack/query) | 901 | **134ms** | 168ms | 137ms | **1.3x** | **1.0x** | 3-32x faster than madge, 2-11x faster than dpdm on small-to-medium projects. Fallow uses 5-7x less memory by reusing the module graph already built for dead code analysis. [​](https://docs.fallow.tools/analysis/dead-code#see-also) See also ---------------------------------------------------------------------- CLI: dead-code -------------- Full reference for the `fallow dead-code` command and its flags. Rules & Severity ---------------- Control which issue types are errors, warnings, or disabled. Auto-fix -------- Automatically remove the dead code fallow finds. Was this page helpful? YesNo [Suggest edits](https://github.com/fallow-rs/docs/edit/main/analysis/dead-code.mdx) [Raise issue](https://github.com/fallow-rs/docs/issues/new?title=Issue%20on%20docs&body=Path:%20/analysis/dead-code) [Previous](https://docs.fallow.tools/analysis) [Code duplicationDetect copy-pasted code blocks across your TypeScript and JavaScript codebase. Built-in to the same binary as dead-code analysis. Suffix-array detection runs 8-26x faster than standalone tools.\ \ Next](https://docs.fallow.tools/analysis/duplication) ⌘I On this page * [Issue types](https://docs.fallow.tools/analysis/dead-code#issue-types) * [Filtering by issue type](https://docs.fallow.tools/analysis/dead-code#filtering-by-issue-type) * [Output formats](https://docs.fallow.tools/analysis/dead-code#output-formats) * [Incremental analysis](https://docs.fallow.tools/analysis/dead-code#incremental-analysis) * [Baseline comparison](https://docs.fallow.tools/analysis/dead-code#baseline-comparison) * [Debugging](https://docs.fallow.tools/analysis/dead-code#debugging) * [How it works](https://docs.fallow.tools/analysis/dead-code#how-it-works) * [Script binary analysis](https://docs.fallow.tools/analysis/dead-code#script-binary-analysis) * [Infrastructure entry points](https://docs.fallow.tools/analysis/dead-code#infrastructure-entry-points) * [Dynamic import resolution](https://docs.fallow.tools/analysis/dead-code#dynamic-import-resolution) * [Re-export chain resolution](https://docs.fallow.tools/analysis/dead-code#re-export-chain-resolution) * [Namespace import narrowing](https://docs.fallow.tools/analysis/dead-code#namespace-import-narrowing) * [Class member detection](https://docs.fallow.tools/analysis/dead-code#class-member-detection) * [CSS and SCSS tracking](https://docs.fallow.tools/analysis/dead-code#css-and-scss-tracking) * [Entry-point partial unused exports](https://docs.fallow.tools/analysis/dead-code#entry-point-partial-unused-exports) * [Cross-reference with duplication](https://docs.fallow.tools/analysis/dead-code#cross-reference-with-duplication) * [Circular dependency benchmarks](https://docs.fallow.tools/analysis/dead-code#circular-dependency-benchmarks) * [See also](https://docs.fallow.tools/analysis/dead-code#see-also) --- # fallow: codebase intelligence for TypeScript and JavaScript [Skip to main content](https://docs.fallow.tools/analysis/file-types#content-area) [fallow home page![light logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/light.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=60adc7de38800517c5c2ff0dbc2c46c4)![dark logo](https://mintcdn.com/fallow/MVHCTxa_uLg-T8iG/logo/dark.svg?fit=max&auto=format&n=MVHCTxa_uLg-T8iG&q=85&s=322def7096834116e81615b6c1d5545d)](https://docs.fallow.tools/) Search... ⌘K Search... Navigation Analysis Non-JS file types [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) [Documentation](https://docs.fallow.tools/) [CLI Reference](https://docs.fallow.tools/cli/dead-code) > Documentation Index > ------------------- > > Fetch the complete documentation index at: [https://docs.fallow.tools/llms.txt](https://docs.fallow.tools/llms.txt) > > Use this file to discover all available pages before exploring further. Fallow analyzes more than `.js` and `.ts` files. It extracts imports and exports from non-JavaScript file types automatically based on their extension. No plugins or config needed. * HTML * Vue / Svelte * SSR layouts * JSDoc * Astro * MDX * CSS / SCSS Modules * React Native Fallow discovers `.html` files and extracts edges from ` Fallow sees this file as referencing `./styles/main.css`, `./vendor/lodash.js`, and `./src/main.ts`. The Parcel plugin automatically adds `index.html` as an entry pattern, so HTML entry files are picked up without any extra config. **Angular template complexity.** Standalone `.html` files referenced via `templateUrl` and inline `@Component({ template: \`…\` })`literals both contribute synthetic`