Zap cleans leftover agent git worktrees
Zap is an open-source Go CLI and TUI that automatically detects and clears abandoned Git worktrees left behind by coding agents like Claude Code, Cursor, and Codex. It features interactive safety checks, automatic branch backups, and an undo command to reclaim gigabytes of disk space consumed by duplicated dependencies.
As coding agents standardize on multi-worktree execution to isolate parallel edits, developers are discovering that background tasks silently balloon local disk usage with duplicate build caches. Zap addresses a glaring quality-of-life hole in the agentic development toolchain by turning tedious worktree hygiene into a safe, one-command routine.
- –Coding agents like Claude Code create dedicated worktrees per prompt, but merged tasks leave heavy node_modules and target directories lingering indefinitely.
- –Interactive TUI inspection (`zap map`) surfaces hidden storage hogs across agent transcripts, session caches, and linked worktrees.
- –Safety-first defaults require explicit repository opt-in (`.zap`), check for uncommitted changes or open shells, and back up Git refs before deletion.
- –Dedicated agent skill integration (`SKILL.md`) allows agents to self-audit and clean their own worktree footprint programmatically.
DISCOVERED
20m ago
2026-11-15
PUBLISHED
53m ago
2026-11-15
RELEVANCE
AUTHOR
nsxdavid