Menu

1 / 4

Find Dead Code With knip, Then Let a Coding Agent Delete It One Package per Worktree

DEV Community: typescript·Gabriel Anhaia·23 days ago
#17BrGBBw
#devtotypescript#devto#dev#knip#agent
Long article (1760 words) — no AI summary yet.
Reading 0:00
15s threshold

Book: Ship It — the pragmatic startup tech stack

Also by me: Thinking in Go (2-book series) — Complete Guide to Go Programming + Hexagonal Architecture in Go

My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools

Me: xgabriel.com | GitHub

On August 1, 2012, Knight Capital's order router still held a function that, in the SEC's words , "was not meant to be used." The router misbehaved for the first 45 minutes of trading, and the firm eventually lost more than $460 million.

Your repo's dead code will probably never cost that much. It still gets read, type-checked and shipped, and an agent that finds an old helper may copy it.

Deleting it is the safest job you can hand a coding agent, on one condition: a tool picks the targets and the agent doesn't guess. Most wrong deletions fail the type checker or the tests. The rest are dynamic imports and files loaded by path, and the prompt below tells the agent to leave those alone.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.