Skip to main content
AI coding agents generate code at scale, but they don’t perform static analysis. Building a module graph, tracing re-export chains through barrel files, determining which exports are unused across thousands of files: these require a dedicated tool. Fallow gives agents exactly that: deterministic, exhaustive static analysis they can call via CLI or MCP.
Every agent that can run shell commands can use fallow. The CLI is the primary interface. MCP is an optional structured layer on top.

Why agents need fallow

Static analysis requires building and traversing a graph, not reading files in a context window. Here’s what that means in practice:
What agents can’t doWhat fallow does
Build a complete module graph across 5,000+ filesBuilds the full graph in under 200ms
Track re-export chains through barrel filesResolves export * chains through unlimited levels
Know if an export is used somewhere outside their context windowExhaustively checks every import in the entire codebase
Detect code duplication across files they haven’t seenSuffix array algorithm catches clones across all files
Determine which package.json dependencies are actually unusedTraces imports and script binaries to actual usage
Guarantee completeness (no missed files, no false negatives)Deterministic: same input always produces same output
Even with an infinite context window, an LLM reading files sequentially cannot replicate what a graph traversal algorithm does. The issue isn’t context size. Static analysis is an algorithmic problem, not a comprehension problem.

CLI: the primary agent interface

Every AI coding agent can run shell commands. This is the simplest and most universal integration. No MCP required:
# Full dead code analysis with JSON output
fallow check --format json

# Only check changed files (great for agent PR workflows)
fallow check --changed-since main --format json

# Find code duplication
fallow dupes --format json

# Preview what auto-fix would remove
fallow fix --dry-run --format json

# Apply fixes (agents should use --yes to skip confirmation)
fallow fix --yes --format json

# List project info (plugins, entry points, file count)
fallow list --format json
Always use --format json when agents run fallow. The JSON output is structured, machine-readable, and easy for LLMs to parse and reason about. The human-readable format works too, but JSON eliminates parsing ambiguity.

Agent workflow examples

After generating code:
# Agent generates a new feature, commits, then checks its own work
fallow check --changed-since main --format json
# → finds that the old utility file is now unused
# → agent removes it
Codebase cleanup:
# Agent is asked to clean up dead code
fallow check --format json
# → returns 401 issues: unused files, exports, dependencies
fallow fix --yes --format json
# → auto-removes unused exports and dependencies
# Agent then deletes unused files from the JSON output
Before a PR:
# Agent verifies its changes don't introduce dead code
fallow check --changed-since main --format json
# → clean: no new issues introduced

MCP: structured tool calling

For agents that support MCP (Model Context Protocol), fallow-mcp exposes analysis capabilities as structured tools. This gives agents typed inputs and outputs instead of parsing CLI text. The MCP server uses stdio transport and wraps the fallow CLI binary. Set the FALLOW_BIN environment variable to point to the fallow binary (defaults to fallow in PATH).
Add to your .claude/settings.json:
{
  "mcpServers": {
    "fallow": {
      "command": "fallow-mcp"
    }
  }
}

Available MCP tools

ToolDescription
analyzeFull dead code analysis (fallow check --format json)
check_changedIncremental analysis of changed files (fallow check --changed-since)
find_dupesCode duplication detection (fallow dupes --format json)
fix_previewDry-run auto-fix preview (fallow fix --dry-run --format json)
fix_applyApply auto-fixes (fallow fix --yes --format json)
project_infoProject metadata: plugins, files, entry points (fallow list --format json)
{
  "tool": "analyze",
  "arguments": {
    "production": true,
    "issue_types": ["unused-exports", "unused-files"]
  }
}
The MCP server wraps the CLI, so all fallow features are available, including production mode, baselines, and incremental analysis.

CLI vs MCP: when to use which

CLIMCP
AvailabilityAny agent that can run shell commandsAgents with MCP support
SetupZero (fallow just needs to be installed)Requires MCP server configuration
OutputAny format (JSON, SARIF, human, compact)JSON only (structured)
Best forUniversal compatibility, CI-like workflowsTyped tool calling, agent frameworks

Architecture

The MCP server is a thin subprocess wrapper. All analysis logic stays in the CLI binary. The MCP crate only handles protocol framing and argument mapping, built with rmcp (official Rust MCP SDK). This means:
  • CLI and MCP always produce identical results
  • Any fallow CLI update automatically improves MCP
  • No separate installation. fallow-mcp ships alongside fallow

See also

Agent Skills

Install fallow skills for Claude Code, Cursor, Windsurf, and more.

CI integration

The third track: catch what agents and humans miss.

VS Code extension

Real-time feedback for human developers.

Dead code analysis

Learn about the 11 issue types fallow detects.