worktree-cleanup
Skill0 starsChanged 53 days agoMITView on GitHub
Worktree cleanup. Use for cleanup, resource audits, close this lane, or close out.
10 other projects use a version of this.
Adopted by
Most recently taken up by
- anotherben/claude-harnesstheir own version, first seen Nov 8, 2026
- perber/leafwikitheir own version, first seen Oct 17, 2026
- my-chiefmind/ai-maestrotheir own version, first seen Oct 13, 2026
- TentacleOpera/switchboardtheir own version, first seen Oct 8, 2026
- dstotijn/agent-skillstheir own version, first seen Sep 21, 2026
- Jador/skillstheir own version, first seen Aug 27, 2026
Other versions10 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 10
- perber/leafwiki★ 1.2ksame name
- TentacleOpera/switchboard★ 215same name
- anotherben/claude-harness★ 7same name
- my-chiefmind/ai-maestro★ 6same name
- dstotijn/agent-skills★ 1same name
- Jador/skills★ 1same name
- jelbirt/LLM-Skill-Build★ 1same name
- luw2007/skills★ 1same name
- EdenGibson/claude-skills★ 0same name
- Enverge-Labs/skills★ 0same name
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 repository50 other files it gives its agents.
- AGENTS.mdAGENTS.md
- instructions/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- instructions/CLAUDE.mdCLAUDE.md
- author-skillSkill
- architectSkill
- arenaSkill
- astack-helpSkill
- astack-updateSkill
- brag-slimSkill
- bug-fixSkill
- claude-background-jobsSkill
- claude-routerSkill
- codex-background-jobsSkill
- create-verification-skillSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- full-sendSkill
- grillingSkill
- handoffSkill
- harden-prSkill
- hillclimbSkill
- howSkill
- implementSkill
- improve-codebase-architectureSkill
- investigationSkill
- multi-phase-planSkill
- no-commentsSkill
- open-prSkill
- orchestrateSkill
- perf-issueSkill
- principlesSkill
- prototypeSkill
- refactoringSkill
- reflectSkill
- review-prSkill
- run-jobSkill
- ship-prSkill
- show-me-your-workSkill
- t3-previewSkill
- tddSkill
- teachSkill
- technical-writingSkill
- to-specSkill
- typescript-best-practicesSkill
- unslopSkill
- wayfinderSkill
- whySkill
- wizardSkill
- writing-for-agentsSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 2 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 10 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Stop disposable resources before removing their worktrees:
- Distinctive: line 23
Test databases: derive the exact target from test setup.
“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
Worktree cleanup
First, check the lane's conversation, notes, and linked PRs for unfinished work or unrecorded follow-ups. For explicitly abandoned work, check the recorded disposition of remaining requirements. If anything needs handling or recording before closeout, report it and stop before auditing resources or making changes. Stop on missing completion or abandonment evidence too.
"Close this lane" means the current T3 thread unless specified otherwise. Resource questions are read-only.
For authorized cleanup, process queued retirements before the current lane's resources.
Inventory worktrees and associated resources, including leftovers outside deleted worktrees. Establish ownership from thread and launch records. Retain unknown targets and resources shared outside the cleanup scope. Retain active, pinned, or data-bearing targets whose disposal is undecided. Current-thread tools cannot establish other threads' inactivity.
For artifacts from orchestrate or multi-phase-plan, follow program closeout before removing their stores or workspaces. A worker lane's cleanup does not authorize disposal of its shared program store.
Stop disposable resources before removing their worktrees:
- Processes: match PID, start time, and command. Account for supervisors and children.
- Previews: use the cleanup record or original launch evidence. HTML-only previews have no processes. Stop preview quick tunnels before their servers. Preserve T3's access tunnel and retained deliverables.
- Docker: verify the daemon and container ownership. Compose names can span worktrees. Inspect volume consumers, including stopped containers. Avoid global pruning.
- Test databases: derive the exact target from test setup. Stop clients before scoped teardown. Preserve shared servers and data.
Remove only merged or explicitly abandoned worktrees. Check ignored and untracked files and post-squash commits. Review tracked files marked assume-unchanged or skip-worktree. Git status can hide their local edits. Retain detached commits through a branch. Keep main, locked, active, and open-PR worktrees. Preserve branch refs unless deletion was requested.
Recheck before git worktree remove. Force removal requires explicit disposal authorization for the affected files. Verify teardown before deleting recovery records.
Report removed, queued, and held targets separately, including owners, reasons, retired links, and failures.
After the lane's work and resource checks pass, durably queue any otherwise eligible current checkout for post-exit retirement. Then settle this T3 thread with t3_thread_organize without asking. Leave it active after an early stop, failure, or unresolved hold. Settlement closes execution. Queued resources remain until a later pass verifies removal.
Expand to simulators or caches only when requested. Editor backups may contain otherwise unrecorded work.
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.

