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.
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.
Recommended workflow
Preview changes
Run a dry run to see exactly what would be removed without making any changes.
$ fallow fix --dry-run
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.
Apply fixes
After reviewing the preview, apply the changes. In interactive terminals, fallow asks for confirmation before writing.In CI or non-TTY environments, use
--yes to skip confirmation: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.What gets fixed
- Unused exports: the
exportkeyword is removed, keeping the declaration. For exported enums where the enum itself is never referenced outside its body in the file, the entireenumblock is deleted. - Unused dependencies: removed from
package.jsonwhen they are not imported by another workspace - Unused enum members: removed from the enum declaration. When every member of an exported enum is unused, the whole declaration is deleted in one pass instead of leaving behind an empty
export enum X {}shell. Importers in other files now reference a name that no longer exists, so run your TypeScript build to find and clean them up. - Unused pnpm catalog entries: removed from
pnpm-workspace.yamlby line-aware deletion so comments and stylistic choices in the file survive. Object-form entries are removed as one block. When the last entry of a catalog group is removed, the header is rewritten tocatalog: {}(or<name>: {}) instead of leaving barecatalog:, because pnpm rejects null-valued catalogs withCannot convert undefined or null to objectat install time. Entries whosehardcoded_consumersis non-empty (a workspace package still pins a hardcoded version of the same package, where removing the catalog entry would breakpnpm install) are skipped; the skip is reported in the fix output so you can migrate the consumer first and rerun. After a successful catalog edit fallow reminds you to runpnpm installsopnpm-lock.yamlstays in sync.
JSON output
For scripting, CI, and agent workflows:See also
CLI: fix
Full reference for the
fallow fix command and its flags.Dead Code Analysis
Understand what fallow detects before auto-fixing.