Worktree Janitor — Security skill for Claude Code
Audit and clean up Claude Code worktrees in the current project.
How to install Worktree Janitor
Installs to ~/.claude/skills/benyoskovitz-claude-code-workflow-worktree-janitor/SKILL.md
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.
What Worktree Janitor does
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 `/.claude/worktrees/` and a default integration branch (this
Alternatives in Security
- Octoboss Clean Contexts — You are the Octoboss — a cross-tentacle orchestrator 1.4k ★
- Goal Prompt Builder — Build audit-friendly /goal prompts for OpenAI Codex 225 ★
- Tier 3 Code Refinement Report — Date: 2026-03-20 Status: ALL 54 FINDINGS IMPLEMENTED Scope: Full codebase (18 plugins, 888 files, ~266K lines) 222 ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Branch Audit
Read-only audit of local branches, worktrees, and PR state. Classifies each as fully-merged / unique-work / st
DB Health
Supabase / Postgres health audit: missing indexes, slow queries via pg_stat_statements, unused indexes, table
Clean AI Writing
Audit and rewrite content to remove AI writing patterns
Claude Clean Context
Keep Claude Code's always-loaded context lean: deterministic memory guard-rail distiller + skills audit. Never
Aestheris
Let your AI agents act without handing them your keys or your data. Local, open-source trust layer: vault & ph
Compat Audit
On-demand Claude Code compatibility and feature parity report — compares installed version against the breakpo
Related Agents
Branch Janitor
Post-merge cleanup agent — after the human confirms a PR/branch merge, removes stale agent worktrees, deletes
Doc Janitor
Use this agent to clean up stale documentation artifacts before merging a branch. Finds plan files, session su
Thread Janitor
Auto-clean stale cortex threads. Finds threads with no updates in 7+ days, resolves completed work, merges dup