recover
Skill10 starsChanged 3 months agoMITView on GitHub
Scan for orphaned worktrees and stale branches after crashes or abandoned sessions. Offers safe cleanup options.
13 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- Dariusplayer09/adaptive-skillstheir own version, first seen Nov 8, 2026
- dincho-kostadinov/invest-tracker-mvptheir own version, first seen Oct 13, 2026
- gnjohnny/Maps2Chattheir own version, first seen Oct 13, 2026
- garbageek/claude-pluginstheir own version, first seen Oct 13, 2026
- eliphazbouye/skillstheir own version, first seen Sep 30, 2026
- soophoo/skillstheir own version, first seen Sep 30, 2026
Used with
Projects with it also use imprint, remember and 6 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
OfficialDiLiSkillimprint
After building any UI component, extract the visual patterns that matter for consistency and save them to ui-registry.md. So every component built after this one matches what came before.
Also in 7 projects that use this
LangChainSkillremember
Review the current conversation and capture valuable knowledge — best practices, coding conventions, architecture decisions, workflows, and user feedback — into persistent memory (AGENTS.md) or reusable skills. Use when the user says: (1) remember this, (2) save what we learned, (3) update memory, (4) capture learnings.
Also in 7 projects that use this
Harut8Skillarchitect
Also in 8 projects that use this
AWSSkillmap
Map verified service capabilities against customer-provided control framework and threat model. Produces mapping-results.json, controls-catalog.md, and framework-mapping.md. Supports pluggable frameworks: CCMv4, NIST 800-53, CIS Benchmarks, ISO 27001, etc. Split into 4 focused sub-skills for better accuracy; this skill orchestrates them.
Also in 3 projects that use this
bradtraversySkillfeature
Manage current feature workflow - start, review, explain or complete
Also in 3 projects that use this
SentrySkillreview
Fixture review skill.
Also in 8 projects that use this
Other versions13 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- conorbronsdon/agent-workspace★ 278% same
Wrote their own version · 12
- jamillazarev/multica-ops★ 11same name
- Dariusplayer09/adaptive-skills★ 1same name
- garbageek/claude-plugins★ 1same name
- jamillazarev/opsinist★ 1same name
- OfficialDiLi/skills★ 1same name
- AR-Toqi/Mirai_mart★ 0same name
- dincho-kostadinov/invest-tracker-mvp★ 0same name
- dincho-kostadinov/spec-driven-development-pipeline★ 0same name
- eliphazbouye/skills★ 0same name
- gnjohnny/Maps2Chat★ 0same name
2 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository8 other files it gives its agents.
- angel-diligenceSkill
- code-reviewSkill
- eval-integritySkill
- guest-circuitSkill
- reconcileSkill
- session-managementSkill
- skill-creatorSkill
- ssot-checkSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 7 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 15
After a system crash or forced session termination
- Distinctive: line 16
When parallel session hooks warn about stale processes
- Distinctive: line 17
When you find commits on unknown branches
- Distinctive: line 24
Don't assume main. Resolve it once and use it everywhere below:
- Distinctive: line 40
Candidate-orphaned worktrees: no recent modification and no activity signal — proceed to inspection, still gated on user approval before …
- Distinctive: line 55
CLEAN: No unmerged commits, no uncommitted changes — safe to remove
- Very specific: line 104
Remove orphaned worktree (CLEAN): git worktree remove <path>
- Very specific: line 107
Delete merged branches: git branch -d <branch>
- Very specific: line 108
Delete stale branches (confirmed discard): git branch -D <branch>
- Distinctive: line 115
Preserve work: Default to merge/cherry-pick over discard.
“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
<!-- x-source: agent-workspace/SKILL.md @ 7b7211e -->/recover — Worktree & Branch Cleanup
Scan for orphaned worktrees, stale branches, and partial work left behind by crashed or abandoned Claude Code sessions. Read-only by default — reports findings and waits for approval before cleanup.
Invocation: deliberately model-invocable — scanning is read-only. Every cleanup action is gated on explicit user approval.
When to Use
- After a system crash or forced session termination
- When parallel session hooks warn about stale processes
- When you find commits on unknown branches
- Periodic hygiene (monthly or after heavy parallel work)
Instructions
0. Detect the default branch
Don't assume main. Resolve it once and use it everywhere below:
DEFAULT=$(git symbolic-ref --short refs/remotes/origin/HEAD 2>/dev/null | sed 's|^origin/||')
DEFAULT=${DEFAULT:-$(git remote show origin 2>/dev/null | sed -n 's/.*HEAD branch: //p')}
DEFAULT=${DEFAULT:-main} # no remote at all — fall back and note it in the report1. List all worktrees
git worktree list --porcelainIdentify:
- Recently touched worktrees: files or
.gitmetadata modified in the last hours — treat as possibly live.git worktree listcannot tell whether a session is actually running; without a lock/heartbeat file or process evidence, classify as unknown activity and never as orphaned. - Candidate-orphaned worktrees: no recent modification and no activity signal — proceed to inspection, still gated on user approval before any cleanup
- Stale entries: Git tracks a worktree but the directory is gone
2. Inspect orphaned worktrees
For each orphaned worktree:
git -C <worktree-path> status --short
git -C <worktree-path> branch --show-current
git -C <worktree-path> log --oneline -3
git log "$DEFAULT"..<branch-name> --onelineClassify each as:
- CLEAN: No unmerged commits, no uncommitted changes — safe to remove
- HAS COMMITS: Unmerged commits exist — needs merge decision
- HAS CHANGES: Uncommitted work — needs save decision
- BOTH: Unmerged commits AND uncommitted changes — needs careful handling
3. List stale branches
git branch --no-merged "$DEFAULT"
git remote prune origin --dry-run
git for-each-ref --sort=-committerdate --format='%(refname:short) %(committerdate:relative) %(subject)' refs/heads/Classify:
- MERGED: Already in the default branch — safe to delete
- STALE: Last commit >7 days ago, not merged — flag for review
- ACTIVE: Recent commits — leave alone
4. Check for prunable git state
git worktree prune --dry-run5. Report
RECOVER — [DATE]
WORKTREES:
- Active: [N]
- Orphaned: [N]
- [path] — [status] — [branch] — [last commit]
- Stale entries: [N]
BRANCHES:
- Merged (safe to delete): [list]
- Stale (>7 days, not merged): [list]
- Active: [list]
PROPOSED ACTIONS:
1. [action] — [target] — [reason]
OVERALL: [CLEAN / N items need attention]6. Cleanup (with approval only)
Only proceed when explicitly approved. Options:
- Remove orphaned worktree (CLEAN):
git worktree remove <path> - Merge unmerged commits:
git merge <branch> --no-ff - Cherry-pick specific commits:
git cherry-pick <hash> - Delete merged branches:
git branch -d <branch> - Delete stale branches (confirmed discard):
git branch -D <branch> - Prune stale entries:
git worktree prune - Prune remote refs:
git remote prune origin
Design Principles
- Read-only by default. Report, wait for approval.
- Preserve work. Default to merge/cherry-pick over discard.
- Specific. Show exact commit hashes, file lists, branch names.
- Fast. Git commands only. Under 15 seconds for scan.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

