plugins/claude-code-dev-hermit/skills/dev-cleanup/SKILL.md
Lists and offers to clean up stale or merged git branches. Use when the local repo has accumulated feature branches across sessions.
npx skillsauth add gtapps/claude-code-hermit dev-cleanupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Scope: merged local branches in the main repo. Orphaned subagent worktrees under .claude/worktrees/ are Claude Code's responsibility — they're auto-swept at session startup once older than cleanupPeriodDays, provided they're clean (no uncommitted changes, no untracked files, no unpushed commits). Do not add worktree sweeping here.
List local branches and identify cleanup candidates.
.claude-code-hermit/sessions/ exists (core + dev hermit initialized)/claude-code-hermit:hatch and /claude-code-dev-hermit:hatch first, then exitRead claude-code-dev-hermit.protected_branches from .claude-code-hermit/config.json (default: ["main", "master"] if absent). Run git branch --merged <first-protected-branch> to find fully merged branches.
Run git branch -v to find branches with no recent commits
Cross-reference with .claude-code-hermit/sessions/SHELL.md
and all S-*-REPORT.md files in the sessions directory to
identify the current working branch and recently active branches
(do NOT suggest deleting them).
Also check .claude-code-hermit/sessions/NEXT-TASK.md — if it
exists and references a branch name, do NOT suggest deleting that branch
(it is part of a pending task from an accepted proposal).
While reading SHELL.md (already required above), extract any waiting
reason from the Progress Log. Then check .claude-code-hermit/state/runtime.json
.session_state: if waiting, any branch referenced in SHELL.md or its
Progress Log is intentionally idle (e.g., PR submitted, awaiting review) —
show status as waiting (<reason>) and suggestion as skip (session waiting).
Present a table:
| Branch | Status | Last Commit | Suggestion | | --------------- | ------------------ | ----------- | ---------------------- | | feature/auth | merged | 3 days ago | safe to delete | | fix/typo | merged | 7 days ago | safe to delete | | feature/api-v2 | active (SHELL.md) | today | keep | | feature/auth-v2 | waiting (PR #42) | 5 days ago | skip (session waiting) | | experiment/perf | unmerged | 14 days ago | review before deleting |
Ask operator which branches to delete
Delete only confirmed branches with git branch -d (safe delete)
For unmerged branches the operator confirms: use git branch -D
only with explicit confirmation
claude-code-dev-hermit.protected_branches (defaults to main/master)S-*-REPORT.md),
not just SHELL.md — a branch may belong to a paused or prior sessionwaiting sessions — they are intentionally idledevelopment
Use when the user asks about cost structure or composition: which token types cost the most, how cache reads compare to output costs, which sessions are draining budget, or what cold starts add up to. This is the 'why is my bill high' skill. It audits where spend goes across token categories (cache_read, cache_write, output, input) and per-session attribution. Invoke for questions like 'cost breakdown', 'which sessions are expensive', 'what's driving spend', or 'cold start costs'. Not for week-over-week trend lines (use hermit-evolution) or simple total-spend summaries.
tools
Presence history & tracker-health report — current home/away state, reliability, recent arrival/departure transitions, and activity patterns for person/device_tracker entities. Use when the operator asks about presence history or when a presence-dependent automation (locks, alarm, vacuum, climate) misbehaves.
development
Evening house brief — end-of-day security check, device status, and energy snapshot. Runs as a daily routine at 22:30 or on demand.
tools
Browse and explain the hermit's Home Assistant automations — list by topic, filter by keyword with plain-language YAML explanations, or sort by last-fired. Read-only. Use when the operator asks "what automations do I have / what does this one do / which haven't fired."