Back to work

deuce

Post-merge cleanup for agent worktrees · Developer Tools

A Claude Code plugin and CLI that removes the worktrees and branches left behind by merged agent work. The default is a dry run, and it asks GitHub about the pull request, which is the only way to see a squash merge.

View source on GitHub

limitations

Key features

  • Refuses on a dirty or locked worktree, commits missing from the merged PR, or a remote branch someone else pushed to
  • Logs every applied action with the branch tip, and deuce undo --last recreates the last deleted branch
  • The plugin pre-approves only the dry run and status; --apply always asks

Impact

Merged agent branches get cleaned up without a script deleting uncommitted work.

Tech stack

Python, git, gh, Claude Code plugin

interested in something like this?

Get in touch