Worktree Janitor banner
benyoskovitz benyoskovitz

Worktree Janitor

Security community

Description

Audit and clean up Claude Code worktrees in the current project. Lists every worktree with status, classifies orphans and phantom registrations, and prompts per-worktree to keep or remove. Use this any time the worktree directory feels cluttered, or when `/session-end` left debris behind. Safe to run on a project that doesn't use worktrees, it reports cleanly and exits. > Assumes the convention of placing worktrees under `<repo>/.claude/worktrees/<name>` and a default integration branch (this

Installation

Installs to ~/.claude/skills/benyoskovitz-claude-code-workflow-worktree-janitor/SKILL.md

Terminal
mkdir -p ~/.claude/skills/benyoskovitz-claude-code-workflow-worktree-janitor && curl -fsSL https://raw.githubusercontent.com/benyoskovitz/claude-code-workflow/HEAD/commands/worktree-janitor.md -o ~/.claude/skills/benyoskovitz-claude-code-workflow-worktree-janitor/SKILL.md

Restart Claude Code, or start a new session, for it to be picked up.

Full documentation available on GitHub

View Source Repository