← Back to digest
Tools & Demos

swyx: "Worktrees must die" — the 20GB node_modules problem

What's this about?

swyx went viral complaining that git worktrees — a common way to give each coding agent its own isolated copy of a repo — duplicate the `node_modules` dependency folder every time, until you're carrying 20GB of the exact same files.

What exactly is a "worktree"?

A git worktree is a second (or third, or tenth) working copy of the same repository, so multiple tasks — or multiple AI agents — can each edit code in isolation without stepping on each other. The catch: each copy re-downloads the project's dependencies (`node_modules`), which for JavaScript projects can be enormous and identical across copies.

Why it matters

Multi-agent coding needs isolation, but naive isolation wastes huge amounts of disk. It's an early, concrete scaling pain of the "many agents working in parallel" future everyone's building toward.

← ColaMD v1.8.1 — agent-friendly Markdown editorbcherny: LLM bugs are different now →