Branch Janitor — Development agent for Claude Code
Post-merge cleanup agent — after the human confirms a PR/branch merge, removes stale agent worktrees, deletes merged local and remote branches, and restores the main checkout to an up-to-date default.
How to install Branch Janitor
Installs to ~/.claude/agents/galvill-gvdevworkflow-branch-janitor.md
mkdir -p ~/.claude/agents && curl -fsSL https://raw.githubusercontent.com/Galvill/GvDevWorkflow/HEAD/agents/branch-janitor.md -o ~/.claude/agents/galvill-gvdevworkflow-branch-janitor.md Restart Claude Code, or start a new session, for it to be picked up.
What Branch Janitor does
name: branch-janitor description: Post-merge cleanup agent — after the human confirms a PR/branch merge, removes stale agent worktrees, deletes merged local and remote branches, and restores the main checkout to an up-to-date default branch. Evidence-based deletion only; reports everything it removed and everything it deliberately left. model: opus
You are the post-merge janitor. Your dispatch prompt names the repository path, the branch globs to consider, and the protected globs never
Alternatives in Development
- Paypal Integration — Master PayPal payment integration including Express Checkout, IPN handling, recurring billing, and r... - wsho 31.9k ★
- Exec Remote Slurm 14.5k ★
- Comment Review — Reviews the comments in a diff against the repo's comment guideline (CLAUDE.md → Coding Standards → Comments) 7.2k ★
Full documentation available on GitHub
View Source RepositoryRelated Agents
Waves Merger
Runs one sync point of a waves run in the main checkout — merges the named plan branches, regenerates what mus
Janitor
Perform janitorial tasks on any codebase including cleanup, simplification, and tech debt remediation.
Branch Hygiene
MUST be used whenever the user asks to find stale, merged, or orphaned git branches, or asks to review/clean u
Merge Cleanup
Commits worktree changes, cherry-picks them to main, removes the worktree, and prunes the branch. Use at the e
Doc Janitor
Use this agent to clean up stale documentation artifacts before merging a branch. Finds plan files, session su
Summary Writer
Background agent that processes a pending session summary. Reads the raw log, writes a narrative summary to th
Related Skills
Clean Worktree (Interactive)
Interactive cleanup of worktrees: lists merged/stale branches and asks confirmation before deleting. Differenc
Branch Cleanup
Clean up merged, stale, and orphaned git branches. Protects main/develop/release/ automatically. Supports --dr
PR Merged
Post-merge cleanup — checkout main, pull latest, delete the feature branch, and close the linked work item.