Coding agents leave git worktrees piling up and consuming gigabytes of disk space
Tools like Claude Code, Cursor, and Codex run tasks in separate git worktrees so several agents can work simultaneously. Each worktree is a full checkout with its own dependencies and build output, so these copies accumulate unnoticed. One Claude Code user reportedly found 27 forgotten worktrees occupying 80 GB, and a Codex user with a Rails app had 61 worktrees taking roughly 100 GB. The article explains where each tool stores its worktrees and offers commands to list their sizes, check for uncommitted or ignored files, and confirm whether work has been merged before removal. It also recommends using git's standard removal without the force flag, and lowering each tool's retention settings to limit future buildup.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in