Skip to main content
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

Options

Output

FlagDescription
--top <N>Show only the top N flags
-f, --format <FORMAT>Output format: human (default), json, sarif, compact, markdown, codeclimate
-q, --quietSuppress progress output
--explainAdd metric explanations. In JSON format, adds a _meta object with descriptions and docs links.
--summaryPrint a one-line summary of flag counts at the end of the run. In JSON format, adds a summary counts object.

Scoping

FlagDescription
-r, --root <PATH>Project root directory (default: current working directory)
-c, --config <PATH>Path to config file (default: auto-detected)
-w, --workspace <NAME>Scope output to a single workspace package
--changed-since <REF>Only report flags in files changed since a git ref
--productionProduction mode: exclude test/story/dev files

Performance

FlagDescription
--no-cacheDisable incremental caching (force full re-parse)
--threads <N>Number of parser threads (default: available parallelism)
--performanceShow pipeline timing breakdown

CI

FlagDescription
--ciCI mode: equivalent to --format sarif --fail-on-issues --quiet
--fail-on-issuesExit with code 1 if flags are found
--sarif-file <PATH>Write SARIF output to a file (in addition to --format)
--group-by <MODE>Group output by owner (CODEOWNERS), directory (first path component), or package (workspace package). See global flags.

Regression

FlagDescription
--baseline <PATH>Compare against a previously saved baseline file
--save-baseline <PATH>Save current results as a baseline file
--fail-on-regressionFail if flag 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 flag counts as a regression baseline

Detection categories

Fallow detects three categories of feature flag patterns:
CategoryWhat it findsExamples
Environment variable flagsprocess.env.* checks used as feature gatesprocess.env.FEATURE_NEW_UI, process.env.ENABLE_DARK_MODE
SDK callsFeature flag SDK method calls from known providersLaunchDarkly variation(), Statsig checkGate(), Unleash isEnabled(), GrowthBook isOn()
Config object patternsObject 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.

Examples

# Detect all feature flags
fallow flags

# Show only the top 10 flags
fallow flags --top 10

JSON output

$ fallow flags --format json
{
  "schema_version": 3,
  "version": "2.27.0",
  "elapsed_ms": 116,
  "feature_flags": [],
  "total_flags": 0
}

Key fields

FieldTypeDescription
schema_versionintegerJSON schema version (currently 3)
versionstringFallow version that produced the output
elapsed_msintegerAnalysis duration in milliseconds
feature_flagsarrayDetected feature flag patterns
total_flagsintegerTotal number of detected flags

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 for setup instructions.

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.