Agent worktrees
The worktrees your coding agents leave behind
Claude Code, Codex, Cursor and others give each task its own git worktree, and each worktree gets its own node_modules or .venv. They pile up across repositories. DevSweeper finds them, rates each by what its branch still holds, and never removes work that exists nowhere else.
Free to scan. Seven days of cleaning free, no card. macOS 26 or later.

Where they come from
DevSweeper names the app that made each worktree from where it lives: Claude Code (including its subagents), Codex, Cursor, Conductor, Windsurf, Gemini CLI and Vibe Kanban. Worktrees made by hand next to a repository are listed as sibling folders. Where an app cleans up after itself, the row says so.
It finds them without setup, by reading files rather than running git:
- the folders your recent Claude Code and Codex sessions worked in, from their session logs;
- the projects Xcode built recently, and the project folders you add in Settings;
~/.codex/worktrees,~/.cursor/worktrees, Conductor's workspaces and~/.windsurf/worktrees;- in each repository found this way, the worktrees git has registered in
.git/worktrees, which includes Claude Code's.claude/worktrees.
Rated by the branch
For each worktree DevSweeper runs read-only git commands (status, rev-list) and rates it:
- Merged into the default branch, or its upstream branch is gone with nothing left on it: Safe now.
- Pushed, every commit is on a remote: Low impact.
- Unpushed commits: Expect a slowdown.
- Uncommitted changes, commits on no branch, or locked by the agent that made it: Affects active work, review only. These are never removed.
A worktree used in the last day is rated one step higher. An ignored file with no copy in the main checkout, such as a .env.local, raises the rating to at least Expect a slowdown, and the preview tells you to copy it first.
DevSweeper doesn't run git fetch, so merged and pushed reflect your last fetch. Fetch first if a branch was merged on the server since.
Lightest step first
The default cleanup moves only the worktree's dependency and build folders to the Trash, such as node_modules, .venv or .next. The worktree keeps working once you reinstall.
The other option moves the whole worktree folder to the Trash and runs git worktree prune so git forgets it. The branch is always kept.
Remove Merged takes every merged worktree rated Low impact or below in one step. Before anything is removed, DevSweeper checks again that the worktree is still clean and not locked.