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

# Migrating from knip

> Migrate from knip to fallow in minutes. One command converts your knip config. Fallow also covers duplication, complexity, and architecture boundaries that knip does not.

Fallow provides a one-command migration path from knip. Your existing configuration is automatically translated. Beyond what knip covers, fallow also detects code duplication, complexity hotspots, maintainability scores, and architecture boundary violations.

## Migration workflow

<Steps>
  <Step title="Preview the migration">
    Run `fallow migrate --dry-run` to see the generated config without writing anything:

    ```bash theme={null}
    fallow migrate --dry-run
    ```

    Fallow searches for: `knip.json`, `knip.jsonc`, `.knip.json`, `.knip.jsonc`, `knip.ts`, `knip.config.ts`, and the `knip` field in `package.json`. TypeScript config files (`knip.ts`, `knip.config.ts`) are detected but cannot be parsed. Convert to `knip.json` first.

    ```bash title="$ fallow migrate --dry-run" theme={null}
    Detected knip config: knip.json

    Migrating settings:
      entry          → entry: ["src/index.ts", "src/cli.ts"]
      ignore         → ignorePatterns: ["**/*.generated.ts"]
      ignoreDeps     → ignoreDependencies: ["@types/node"]

    ⚠ Cannot migrate:
      ignoreBinaries → not applicable in fallow

    Would write: .fallowrc.json
    Run without --dry-run to write the config.
    ```
  </Step>

  <Step title="Generate the config">
    Once you're happy with the preview, run the migration:

    ```bash theme={null}
    fallow migrate            # Write .fallowrc.json
    fallow migrate --toml     # Or output as fallow.toml
    ```
  </Step>

  <Step title="Review the config">
    Open the generated config and verify the translated entry points, ignore patterns, and plugin mappings. Warnings are shown for any fields that couldn't be migrated automatically.
  </Step>

  <Step title="Run your first analysis">
    Run dead code analysis and compare results against knip. Then explore the other analyses that knip does not cover:

    ```bash theme={null}
    fallow dead-code    # Unused code + circular deps + boundaries
    fallow dupes        # Code duplication
    fallow health       # Complexity hotspots + maintainability scores
    fallow              # All of the above in one pass
    ```
  </Step>
</Steps>

## What gets migrated

| knip                      | fallow                                                                                   |
| :------------------------ | :--------------------------------------------------------------------------------------- |
| `entry`                   | `entry`                                                                                  |
| `project`                 | -- (fallow auto-discovers project files)                                                 |
| `ignore`                  | `ignorePatterns`                                                                         |
| `ignoreDependencies`      | `ignoreDependencies`                                                                     |
| `ignoreExportsUsedInFile` | `ignoreExportsUsedInFile` (boolean and `{ type, interface }` object form both supported) |
| `ignoreBinaries`          | -- (not applicable)                                                                      |
| Plugin configs            | Closest fallow plugin equivalent                                                         |

## Warnings and caveats

`fallow migrate` is loud about anything it cannot translate so the migration is not silently lossy.

**Unknown rule names.** If your knip `rules`, `exclude`, or `include` entries reference a key that fallow does not know (typo, future knip rule, or an issue type the migrator has not yet catalogued), the migration emits a warning like:

```
Warning (1 skipped field):
  [knip] `rules.unsued-files`: unknown knip issue type `unsued-files`; not migrated
  (suggestion: check for a typo or report the missing mapping at https://docs.fallow.tools/migration/from-knip)
```

If the key is in the documented unmappable list (`binaries`, `optionalPeerDependencies`, and similar issue types knip emits but fallow does not), the warning reads `issue type \`X\` has no fallow equivalent\` and has no suggestion.

**Glob-engine drift.** Knip and fallow use different glob engines, so `entry` and `ignorePatterns` are copied verbatim but may match a slightly different file set than they did under knip. When the migrated config carries either field, the migrate command prints:

```
Note: knip and fallow use different glob engines; verify migrated entry / ignorePatterns
      with `fallow dead-code` before relying on CI. See https://docs.fallow.tools/migration/from-knip
```

Common patterns (brace expansion `{ts,tsx}`, double-star `**`, `src/**`) match identically across both engines. Known drift today: fallow's `ignorePatterns` does not honor leading `!` as negation; entries are matched literally. Run `fallow dead-code` on a representative subset before relying on the migrated globs in CI.

## Comparison

<Tabs>
  <Tab title="Speed">
    Fallow is a Rust-native standalone binary. No Node.js runtime, no JIT warmup, no garbage collection pauses.

    Cold runs (no cache) on real open-source projects (174 to 38,146 files). Fastest tool per row in bold.

    | Project                                               |  Files |    fallow |      knip |       Faster |
    | :---------------------------------------------------- | -----: | --------: | --------: | -----------: |
    | [zod](https://github.com/colinhacks/zod)              |    174 |  **47ms** |     279ms |  fallow 5.9x |
    | [preact](https://github.com/preactjs/preact)          |    244 |  **74ms** |     2.01s | fallow 27.1x |
    | [fastify](https://github.com/fastify/fastify)         |    286 |  **64ms** |     205ms |  fallow 3.2x |
    | [vue/core](https://github.com/vuejs/core)             |    522 |     138ms |  errors\* |  fallow only |
    | [TanStack/query](https://github.com/TanStack/query)   |    901 | **560ms** |     1.04s |  fallow 1.9x |
    | [vite](https://github.com/vitejs/vite)                |  1,420 |     595ms |  errors\* |  fallow only |
    | [astro](https://github.com/withastro/astro)           |  2,859 |     3.76s | **1.21s** |    knip 3.1x |
    | [svelte](https://github.com/sveltejs/svelte)          |  3,337 | **611ms** |     632ms |  fallow 1.0x |
    | [next.js](https://github.com/vercel/next.js)          | 20,558 |     2.95s |  errors\* |  fallow only |
    | [TypeScript](https://github.com/microsoft/TypeScript) | 38,146 |     2.22s | **736ms** |    knip 3.0x |

    \* Current knip (v5 and v6) exits without valid output on next.js, vite, and vue/core (it fails loading those projects' own config files); fallow analyzes them.

    | Metric             | fallow                   | knip                            |
    | :----------------- | :----------------------- | :------------------------------ |
    | Runtime dependency | None (standalone binary) | Node.js                         |
    | CI setup           | Download binary          | Install Node + npm dependencies |

    Numbers are knip v6 (knip 6.6.1). fallow is faster on the small-to-mid projects (fastify, preact, query, svelte, zod), while current knip is faster on astro and TypeScript. fallow's edge is doing more in one tool, not always raw dead-code speed, and it analyzes the three projects knip cannot load here. Against knip v5 (knip 5.87.0) fallow's lead widens (for example fallow 13.7x on fastify, 13.0x on zod, 10.3x on preact).
  </Tab>

  <Tab title="Features">
    | Feature               | fallow                    | knip                   |
    | :-------------------- | :------------------------ | :--------------------- |
    | Duplication detection | Built-in (`fallow dupes`) | Not included           |
    | SARIF output          | Yes                       | No                     |
    | Baseline comparison   | Yes (`--baseline`)        | No                     |
    | Git-aware analysis    | `--changed-since`         | No                     |
    | Production mode       | `--production`            | No                     |
    | Auto-fix              | Exports + dependencies    | Exports + dependencies |
    | Config format         | JSONC, JSON, TOML         | JSON, TS               |
  </Tab>

  <Tab title="Coverage">
    | Capability         | fallow                                                              | knip                              |
    | :----------------- | :------------------------------------------------------------------ | :-------------------------------- |
    | Built-in catalogue | Major frameworks and tools                                          | Broader niche and legacy coverage |
    | Dead code coverage | Files, exports, dependencies, members, cycles, boundaries, and more | Comparable core coverage          |
    | Custom plugins     | Yes                                                                 | Yes                               |
  </Tab>
</Tabs>

## Key differences

### No runtime dependency

Fallow is a standalone binary. No Node.js runtime, no dependency conflicts, faster CI setup.

## See also

<CardGroup cols={2}>
  <Card title="Custom plugins" icon="plug" href="/frameworks/custom-plugins">
    Build plugins for frameworks fallow doesn't cover yet.
  </Card>

  <Card title="fallow migrate" icon="terminal" href="/cli/migrate">
    Full CLI reference for the migrate command.
  </Card>
</CardGroup>
