- How you use it
- A setting in your project
- What it can do
- installs software · writes files · network · runs shell
- What's inside
The options
Same job, different trade-offs. Pick one in Try it.
| Option | AConfig · v2.16+wwfix.1vulture unused-code finder for Python (2.16) | BConfig · v6.41.0+wwfix.1Knip unused-code finder for JavaScript/TypeScript (6.41.0) | Ccli_tool · v6.42.1Knip CLI |
|---|---|---|---|
| How you use it | A setting in your project | A setting in your project | cli_tool |
| What it can do | installs software · writes files · network · runs shell | installs software · writes files · network · runs shell | installs software · network |
| What's inside |
- How you use it
- A setting in your project
- What it can do
- installs software · writes files · network · runs shell
- What's inside
- How you use it
- cli_tool
- What it can do
- installs software · network
- What's inside
What this thread does
Use a language-specific analyser as evidence, then let the agent remove small batches of unused code.
Do first: Run the analyser without fixes and review its entry points and dynamic-use exclusions.
Why a tool first
Asking an agent to "remove dead code" without evidence leads to guesses and risky deletions. A static analyser gives a concrete list; the agent then deletes, runs the build and tests, and opens small PRs. Charlie Marsh showed this on 20 Jul 2026: he had Codex build hawk, a Cargo lint for unused or too-public items, and used it to delete thousands of lines from uv and Codex.
The options
As of November 2026:
| Knip 6.45.1 (11 November 2026) | vulture 2.16 | hawk 0.1.15 | |
|---|---|---|---|
| Language | JavaScript / TypeScript | Python | Rust (Cargo workspaces) |
| Finds | unused files, exports, dependencies, devDependencies | unused functions, classes, variables, imports, unreachable code | pub items unused across the workspace, or that can be pub(crate) / private |
| Auto-fix | knip --fix for exports and dependencies | no (whitelist file for false positives) | --fix through cargo fix (visibility) |
| Agent extras | @knip/mcp helps configure Knip | none | none |
| Licence | ISC | MIT | MIT or Apache-2.0 |
| Maturity | widely used | mature | experimental, written by Codex, "use at your own risk" |
A deletion loop
1. Run the tool and save the report. 2. Have the agent remove one category at a time (unused files, then exports, then dependencies), building and running tests after each batch. 3. For anything reached dynamically (plugins, reflection, string imports, framework conventions), add it to the tool's config or whitelist instead of deleting. 4. One PR per batch, so review stays small.
Caveats
- Static tools miss dynamic use. Knip has plugins for many frameworks; vulture reports a confidence level, so start at
--min-confidence 80. - hawk needs the exact Rust 1.99.0 toolchain it was built against and is not packaged here: its README's quick install pipes a remote script into
sh, which our scanner rejects. For a source install, first runrustup toolchain install 1.99.0 --component rustc-dev, thenRUSTC_BOOTSTRAP=1 cargo +1.99.0 install --locked cargo-hawk@0.1.15. Alternatively, download a platform archive and put the executables together on PATH; prebuilt binaries need the matching Rust toolchain but notrustc-dev. Runcargo +1.99.0 hawk check --manifest-path Cargo.toml. Pinned installation instructions. - For code that only looks dead at runtime, Boris Cherny's dead-code routine adds logging first and deletes a day later; see the daily routines thread.
- Related: the Ponytail thread is about not writing unneeded code in the first place.
Started from a post by @charliermarsh, packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.