Skip to main content

Documentation Index

Fetch the complete documentation index at: 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).

Reference

FlagDescription
-r, --root <PATH>Project root directory (default: current working directory)
-c, --config <PATH>Path to config file (default: auto-detected)
-f, --format <FORMAT>Output format: human (default), json, sarif, compact, markdown, codeclimate, gitlab-codequality, pr-comment-github, pr-comment-gitlab, review-github, review-gitlab, badge. Alias: --output
-q, --quietSuppress progress bars and status messages
--no-cacheDisable incremental caching (force full re-parse)
--threads <N>Number of parser threads (default: available parallelism)
--changed-since <REF> (alias: --base)Only report issues in files changed since this git ref
--diff-file <PATH>Path to a unified diff (e.g. git diff --unified=0 main...HEAD) used for line-level scoping of the hot-path-touched runtime-coverage verdict. A hot function is only flagged when a modified line falls inside its [start_line, end_line] range, instead of the file-level match --changed-since produces. Falls back to the FALLOW_DIFF_FILE env var.
--baseline <PATH>Compare against a previously saved baseline file
--save-baseline <PATH>Save the current results as a baseline file
--fail-on-regressionFail if issue count increased beyond tolerance vs a regression baseline
--tolerance <N>Allowed increase: "2%" (percentage) or "5" (absolute). Default: "0"
--regression-baseline <PATH>Path to regression baseline file (default: .fallow/regression-baseline.json)
--save-regression-baseline <PATH>Save current issue counts as a regression baseline
--productionProduction mode: exclude test/story/dev files, only start/build scripts
--production-dead-codePer-analysis production mode for dead-code in bare combined runs and fallow audit. See Per-analysis production mode.
--production-healthPer-analysis production mode for health in bare combined runs and fallow audit.
--production-dupesPer-analysis production mode for duplication in bare combined runs and fallow audit.
-w, --workspace <PATTERNS>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 <REF>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.
--performanceShow pipeline timing breakdown
--explainInclude metric definitions in JSON output (_meta object). Always enabled for MCP
--ciCI mode: equivalent to --format sarif --fail-on-issues --quiet
--fail-on-issuesExit with code 1 if issues are found
--sarif-file <PATH>Write SARIF output to a file (in addition to the primary --format output)
--group-by <MODE>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.
--summaryPrint 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 <check,dupes,health>Run only specific analyses when no subcommand is given
--skip <check,dupes,health>Skip specific analyses when no subcommand is given
--scoreCompute health score (0-100 with letter grade) in combined mode. Enables the health delta header in PR comments. Also available on fallow health.
--trendCompare current health metrics against the most recent saved snapshot. Implies --score. Also available on fallow health.
--save-snapshot [PATH]Save a vital signs snapshot for trend tracking. Default path: .fallow/snapshots/<timestamp>.json. Forces file-scores and hotspot computation. Also available on fallow health.
--include-entry-exportsReport unused exports in entry files instead of auto-marking them as used. Catches typos in framework exports (e.g. meatdata instead of metadata). Also configurable via includeEntryExports: true in your fallow config; the CLI flag wins when set.

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, gitlab-codequality, pr-comment-github, pr-comment-gitlab, review-github, review-gitlab, badge)
For deeper inspection (the resolved config with extends merged), use the dedicated fallow config subcommand.

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

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.

Grouped output

The --group-by flag partitions all issues into labeled groups. This works with every output format and every subcommand.
ModeGroupingRequires
ownerCODEOWNERS 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)
directoryFirst path component (e.g. src/utils/foo.ts groups under src)Nothing
packageWorkspace package name (e.g. @myorg/ui). Issues are grouped by the package they belong to.A monorepo with workspace packages
sectionGitLab 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.

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 (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.

See also

Environment variables

Set defaults for format and quiet mode via environment variables.

Configuration

Full config file reference for project-level settings.