harvest
Skill4 starsChanged 48 days agoMITView on GitHub
Use when the user asks to clean up, sweep or harvest what was already merged — checks every worktree recorded in a manifest, removes the ones whose PR was merged, moves durable knowledge into permanent notes, deletes the ephemeral record and reports what is still in flight. Manual trigger by design; run it after merging a PR. Also for "what is still open", "which worktrees can I delete", "clean up what landed".
- Deletes or force-pushes
15 other projects use a version of this.
Adopted by
Most recently taken up by
- zedarvates/frugal-skillstheir own version, first seen Nov 8, 2026
- yuri-xyz/skillstheir own version, first seen Nov 8, 2026
- egregore-labs/egregoretheir own version, first seen Nov 6, 2026
- joeuk89/claude-skillstheir own version, first seen Nov 1, 2026
- aidvgg/operator-ostheir own version, first seen Oct 17, 2026
- cwade12c/spiceracktheir own version, first seen Oct 9, 2026
Used with
Projects with it also use handoff.
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.
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 15
- huytieu/COG-second-brain★ 1.3ksame name
- egregore-labs/egregore★ 293same name
- darkroomengineering/cc-settings★ 52same name
- toustifer/dsh-harvest★ 10same name
- sergeeey/Claude-cod-top-2026★ 9same name
- aidvgg/operator-os★ 4same name
- yuri-xyz/skills★ 2same name
- BI-Blitzer/tandem-tokens★ 1same name
- cwade12c/spicerack★ 1same name
- holylight1979/AtomicMemory-ClaudeCode★ 1same name
5 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 repository16 other files it gives its agents.
- dotaskSkill
- executeSkill
- orchestrateSkill
- planSkill
- qaSkill
- resumeSkill
- saveSkill
- seguranca-agentesSkill
- seguranca-apiSkill
- seguranca-bots-webhooksSkill
- seguranca-dados-lgpdSkill
- seguranca-dependenciasSkill
- seguranca-infraSkill
- seguranca-segredosSkill
- seguranca-web-frontSkill
- syncSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 12 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
If a real webhook shows up, revisit.
- Very specific: line 29
Read the manifests at <vault.plans>/*-manifest.md.
- Distinctive: line 79
Before the directory disappears, look for artifacts that should not be there (build output, log dirs).
- Distinctive: line 84
Before removing the manifest entry:
- Very specific: line 103
If nothing is left in flight, say it plainly ("nothing in flight — /clear whenever you want").
“Common” is measured: kept by at least 6 in 10 of the 12 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
/harvest — sweep what was merged
/harvest sweep everything recorded in a manifest
/harvest <id> only this unit
/harvest --dry report without deleting anythingRead ../orchestrate/CORE.md before any step.
Why it is manual, and will stay that way
There is no cheap event trigger for "PR merged" in a local setup. The options are polling
(cron / a scheduled cloud routine), each trigger costs a full agent round, and merges happen
a few times a day. Running /harvest yourself after merging is free and instant; paying
an agent to watch is not.
If a real webhook shows up, revisit. Until then: manual, by decision, not by omission.
Step 1 — Enumerate candidates
Read the manifests at <vault.plans>/*-manifest.md. The worktrees listed there are the
only ones this skill may touch.
A worktree without a manifest entry is NEVER touched. It belongs to another flow, another person, or predates this convention. Report it, do not touch it. Compare
git worktree listwith what is in manifests and list orphans as information.
Step 2 — Check each candidate's merge
<gh> pr view <branch> --json state,mergedAt,number
<gh> = the adapter's gh field if present; otherwise plain gh (CORE §1). It matters
here more than anywhere: a gh broken by an environment variable returns HTTP 401, and
without verification there is no cleanup — better to delete nothing than to delete based
on a misread error.
| state | action |
MERGED | eligible for cleanup (Step 3) |
OPEN | skip, report as still in review |
| PR not found | skip and flag — something is out of place; do not guess |
The merge is the gate, not the backlog status. Closing the card is a separate human call and can lag or lead the merge. Do not block cleanup because of it — but report each card's current status in the summary, so the human sees what is pending.
gh unavailable → assume nothing. Report that it could not be verified and stop.
Step 3 — Clean an eligible worktree
In order, and stop at any resistance:
tmux has-session -t '=kitchen-<ID>' 2>/dev/null→ session alive? With the PR verified MERGED in Step 2, its work is over:tmux kill-session -t '=kitchen-<ID>'. The=is exact match and the quotes are mandatory — without it tmux matches by prefix andkitchen-FE-2killskitchen-FE-21. Kill before the remove: git does NOT refuse to remove a clean worktree with a live process inside — without the kill an agent keeps running in a deleted directory. Without a verified merge: kill only if.kitchen/doneexists in the worktree (the agent hibernated by contract; the context comes back withclaude --resume <session-id>from the manifest row); withoutdone, do not kill — there may be a conversation/adjustment in progress in there.git worktree remove <dir>— from the main checkout. Neverrm -rf: it leaves the worktree registered and git complains at the nextworktree add.- Refused because of uncommitted changes → stop and show the human. A merged branch
may still hold a draft file worth a second look. Do not force. (
.kitchen/does not count: it is dispatch machinery, expected and ignored viainfo/exclude.)
- Refused because of uncommitted changes → stop and show the human. A merged branch
may still hold a draft file worth a second look. Do not force. (
git branch -d <branch>— lowercase-d, never-D. A real merge makes-dsafe; if git refuses, the branch was not merged into the local base and you must stop, not force. (A squash-merged PR is the usual cause: fetch and fast-forward the base first; if git still refuses, report it and let the human decide.)- Before the directory disappears, look for artifacts that should not be there (build output, log dirs). If any, only record it — its owner decides.
Step 4 — Consolidate and delete the ephemeral note
Before removing the manifest entry:
- Does it hold a durable decision not yet in
permanent/nor in the task doc's## Outcome? Move it there now (CORE §6), linking back to the order. Knowledge does not die with cleanup. - Mark the unit as harvested in the manifest.
- Manifest with every unit harvested → fold what is left of durable into where it belongs and delete the manifest. An ephemeral note does not outlive its checkout.
Step 5 — Report
One line per worktree: cleaned / skipped (why) / flagged (why). Then:
- what is still in flight (open PR, queued unit,
kitchen-*tmux session still running); - cards whose status is pending closure in the backlog;
- orphan worktrees found (information, not action);
kitchen-*tmux sessions without a manifest entry (tmux ls) — information, not action;- local branches merged outside this flow, if you notice them (information).
If nothing is left in flight, say it plainly ("nothing in flight — /clear whenever you
want"). Do not try to invoke /clear: it is a REPL reset, there is no tool for it.
This skill does NOT
- Merge PRs or close cards — both are the human's calls.
- Touch a worktree outside a manifest.
- Force
-Don a branch orrm -rfa worktree. Git's resistance is a signal, not an obstacle. - Infer a merge without
gh. No verification, no cleanup.
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.

