Session Cleanup Skill — Git skill for Claude Code
A Claude Code skill for structured end-of-session git housekeeping.
How to install Session Cleanup Skill
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open wrsmith108/session-cleanup-skill and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Session Cleanup Skill does
A Claude Code skill for structured end-of-session git housekeeping.
Alternatives in Git
- Create Worktree + Spawn Agent — git worktree add ../feat-custom-templates -b feat/custom-templates origin/main cd ../feat-custom-templates && 211 ★
- Hybrid Complete — Complete Hybrid Ralph task in worktree, verify all stories complete, commit code changes (excluding planning f 123 ★
- Wrap Session — Automate end-of-session workflow: update SESSION.md, create git checkpoint, and prepare for context clear 88 ★
README
session-cleanup
A Claude Code skill for structured end-of-session git housekeeping.
What it does
Runs a five-phase cleanup at the end of a working session:
- Doc Review — Checks CLAUDE.md for stale entries, MEMORY.md for anything worth persisting, and commits dirty submodule state
- Branch Audit — Checks PR status for every non-main branch; uses two-dot diff to distinguish genuine unreleased content from squash-merge artifacts
- Branch Cleanup — Pushes or cherry-picks unreleased content to main, then deletes merged branches locally and remotely
- Worktree Cleanup — Removes stale worktrees via project script or
git worktree remove; sweeps for orphaned Docker volumes/images left by worktrees removed outside the normal path (crash, manual removal), via a project-specific prune script if one exists - Final State — Syncs local main to origin, confirms clean working tree, reports summary
Install
# Via Skillsmith MCP
# In Claude Code: "install session-cleanup skill"
# Or manually
git clone https://github.com/wrsmith108/session-cleanup-skill ~/.claude/skills/session-cleanup
Usage
/session-cleanup
Or say: `"end of session"`, `"clean up branches"`, `"clean up worktrees"`, `"session cleanup"`
Safety
- Never deletes a branch without checking PR status first
- Shows categorized branch list and requires explicit approval before any deletion
- Uses two-dot diff (
git diff main) as the content gate — not three-dot — to correctly handle squash-merged branches - Cherry-pick conflicts trigger abort + report; source branch is preserved
git reset --hard origin/mainguarded by uncommitted-work check--no-verifyrequires explicit user consent with documented reason- Docker orphan sweep (Phase 4c) runs read-only by default; deletion requires showing the candidate list and getting explicit approval first
- Graceful abort at any phase if user says "stop"
Requirements
git— core operations- `
Related Skills
Xdoubleu Claude Plugins
Personal Claude Code plugin marketplace: generic skills for task flow, session retros, git cleanup, and GitHub
Finishing A Development Branch
Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides
Session End
End session: update chatlog + create worklog + optional Obsidian sync + Git commit
Vault Session End
세션 종료 — handoff/hot/log 갱신 + git 커밋(로컬 전용) + 장기 기억 커밋(선택)
Claude Handoff
git clone https://github.com/REMvisual/claude-handoff ~/.claude/skills/handoff Cross-session handoff system wi
Claude Command Center
-- Production-tested workspace template with session hooks, structured memory (4 types), multi-domain routing,
Related Agents
Machinery
The Machinery — the mechanical glue lane, at medium effort. Use for deterministic housekeeping: branch setup,
Merge Cleanup
Commits worktree changes, cherry-picks them to main, removes the worktree, and prunes the branch. Use at the e
The Clerk
Housekeeping auditor for your git repos and your notes repo. Checks that nothing is uncommitted, unpushed or s