Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By WenyuChiouv1.1.0MIT
Sweep up all session artifacts left behind by Claude Code: stale git worktrees, dangling git refs, and orphaned worktree directories. Essential for heavy Claude Code users — each code task creates a full repo copy that persists after the session ends.
Claude loads one when your task matches it, or you run it by name.
session-sweep, cleanup, worktree, disk-space, maintenance, git, performance, session-artifacts
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Automatically scan your system, find all session artifacts left behind by Claude Code (stale git worktrees, dangling refs, orphaned directories), safely remove them, and report how much disk space you reclaimed.
Every Claude Code task creates a git worktree — a full working copy of your repository under ~/.claude/worktrees/. These do not get cleaned up automatically. After a few days of heavy use:
This plugin gives you a single command to find and purge all stale session artifacts.
claude plugin add github:WenyuChiou/session-sweep
git --version.Invoke directly:
/session-sweep
Or just describe what you want — Claude handles the rest:
My computer has been sluggish since I started using Claude Code heavily. Can you clean up?
Clean up worktrees in my data-pipeline repo
Set up a daily cleanup at 3 AM so I never have to think about this again
You notice your MacBook fan is running constantly and Finder shows 12 GB less free space than last week.
You: My computer is slow and I'm running out of disk space. Can you clean up after Claude Code?
Session Sweep scans ~/.claude/worktrees/, finds 83 stale directories from the past week of coding sessions, checks that none are currently locked by an active session, then bulk-removes them and prunes the dangling git refs.
=== Session Sweep Report ===
Scanned: 4 repositories
Removed: 83 stale worktrees
Pruned: 6 dangling git refs
data-pipeline/ 41 removed (1.3 GB freed)
my-app/ 28 removed (870 MB freed)
scripts/ 9 removed (95 MB freed)
dotfiles/ 5 removed (18 MB freed)
Total space freed: 2.3 GB
Active worktrees kept: 1 (your current session)
You're about to push a large branch and want to free space in one specific project without touching anything else.
You: Clean up stale worktrees in my data-pipeline repo only.
Session Sweep scopes the sweep to that repo's worktree container, leaving other repos untouched.
=== Session Sweep Report (targeted) ===
Repository: ~/projects/data-pipeline
Removed: 41 stale worktrees
Pruned: 2 dangling git refs
Total space freed: 1.3 GB
Active worktrees kept: 0 (no active sessions in this repo)
After your first cleanup you realize this is going to keep accumulating.
You: Set up a daily cleanup at 3 AM so I never have to think about this again.
Session Sweep creates a scheduled task that runs nightly, keeping your disk clean automatically. You get a summary the next morning if anything was removed.
Scheduled task created: session-sweep
Runs daily at 03:00 local time
Next run: tomorrow at 3:00 AM
To cancel: "remove the daily session sweep"
Before — after a week of heavy Claude Code use across 5 repos:
~/.claude/worktrees/
├── aged-maxwell/ ← stale (session ended 6 days ago)
├── bold-turing/ ← stale
├── calm-hopper/ ← stale
├── deft-lovelace/ ← ACTIVE (current session — kept)
├── eager-dijkstra/ ← stale
│ ... 79 more stale dirs
On Windows, this is C:\Users\<you>\.claude\worktrees\.
After — session sweep completes (typically under a minute):
~/.claude/worktrees/
└── deft-lovelace/ ← your active session, untouched
~/.claude/worktrees/ directories on your systemgit worktree prune)| Platform | Status |
|---|---|
| macOS | ✅ Full support |
| Linux | ✅ Full support |
| Windows | ✅ Full support (PowerShell + cmd fallback) |
MIT — see LICENSE
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
Generated from the plugin's indexed repository (wenyuchiou/session-sweep) — no native marketplace selected
npx claudepluginhub p/wenyuchiou-session-sweepPlugins from other owners that cover similar ground