/mycelium-extra:handofffrom mycelium-extra
Write a short HANDOFF.md so a fresh session can resume from one small file.
Ships in mycelium-extra. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Write HANDOFF.md at the project root: the least a fresh session needs to keep working. The next session reads this file plus the pointers it names, and nothing else. Every line costs tokens on every resume, so cut anything git, the code, or Mycelium's memory already holds.
If the same person continues soon, where shows the live state for free; write a handoff when the session ends or the context resets. Adapted from Matt Pocock's handoff and claude-handoff skills (MIT).
Find the project root (git rev-parse --show-toplevel, else the working directory).
Run only git status --short, git log --oneline -15, git diff --stat, git rev-parse --short HEAD, and date '+%F %H:%M %Z'. Copy the hash and the time from those outputs into the file; never type them. Write everything else from the conversation. Do not re-read files to summarise them; a pointer is enough.
If the conversation's last grill brief ended Plan status: READY or READY_WITH_ASSUMPTIONS and the user has not approved it, do not summarise it. Where the approval gate is on, its Stop hook stored the brief word for word; find it by content (a parallel session may have stopped later, so not by the newest file). From the project root, pass a distinctive line of the brief (its > Question: line, or its Objective if the question was declined):
python3 - '<distinctive line>' <<'EOF'
import glob, json, os, sys
hits = []
for path in glob.glob(".mycelium-extra/pending/*.json"):
try:
entries = json.load(open(path, encoding="utf-8"))
except (OSError, ValueError):
continue
if isinstance(entries, list):
hits += [(e.get("ts", 0), path, e["hash"]) for e in entries if isinstance(e, dict) and "hash" in e
and sys.argv[1] in e.get("text", "") and "Plan status:" in e.get("text", "")]
if not hits:
print("none")
else:
ts, path, digest = max(hits)
done = os.path.isfile(os.path.join(".mycelium-extra", "approvals", digest + ".json"))
print(path, digest, "approved" if done else "pending")
EOF
approved means nothing to carry. pending gives the file and hash for the Pending plan section. none (no gate, or no match): copy the brief into HANDOFF.md word for word instead.
If .mycelium-extra/track-changes/<analysis path with /written as__>/brief.md exists for the work in hand (a folder name two analyses share gets a -<hash> suffix, and track-changes prints the folder it wrote), list it under Read first as a pointer; do not summarise it.
If HANDOFF.md exists, read it before overwriting. If the hash it records is not an ancestor of HEAD (git merge-base --is-ancestor <hash> HEAD fails), tell the user it was written on another branch or history before carrying anything forward. Carry forward locked decisions, dead ends, and open items that still hold. Drop finished work, or keep it as one line with its commit hash. Before overwriting, print the first ten lines of the old file to the user and say it is replaced (the file is usually untracked, so the old copy is not kept anywhere; if the user wants it, copy it aside first).
Overwrite, never append. Keep it under about 80 lines. Omit a section that would be empty; never pad one.
Redact before writing. Replace secrets and tokens with a name (SLURM_TOKEN set), and personal identifiers with a count or a pseudonymous label (donor_A, 12 donors). Personal identifiers are donor or patient IDs that identify people, genotype data and sample sheets. Point to the protected file by path; never copy its rows. One exception: a pending plan pasted under ## Pending plan (verbatim) is not redacted, because any edit changes its hash.
# Handoff — <topic>
**Written:** <date output> · **Branch:** <branch> @ <rev-parse output> · **Status:** <one line>
## Check first
Run `git log --oneline <hash>..HEAD` and `git status --short`, with `<hash>` from the line above. If either shows work this file does not mention, say so before anything else: State, Next action and Read first may be out of date, so re-check each against the code before acting on it.
## Goal
<1–2 lines: what we are trying to achieve, and what done looks like>
## Next action
<the exact first command or edit, with path:line. If the work was on one `analysis/` folder, the line to type first: `focus analysis/X`. A focus is never restored for the user.>
## Pending plan
- `<hash>` not approved; stored word for word in `<pending file>`. Re-present it unchanged; do not re-grill. Print it with:
`python3 -c "import json;print(next(e['text'] for e in json.load(open('<pending file>')) if isinstance(e, dict) and e.get('hash')=='<hash>'))"`
## State
- Uncommitted: <files, or "clean">
- Tests: <passing / failing, with the failing name>
- Run: <newest `logs/CHANGES.md` heading, with its changed code files and step folders> (or, for a legacy run, <`outputs/current` target, or the newest run> · status <RUN.txt status> · kind <kind>; or `flat layout`, or `no run`); read from `logs/CHANGES.md`, else `outputs/*/RUN.txt` ([analysis layout](../../docs/concepts/analysis-layout.md))
- Results: <conclusion> — <its inspected figure path, `table fallback: <reason>`, or `unsupported`> (one line each; see plot-first)
- Assumed, not run: <belief not checked this session, or none>
- <anything running: job IDs, servers, envs>
## Locked decisions
- <decision> — <why> (user, YYYY-MM-DD)
## Dead ends — do not redo
- <approach> — <evidence that killed it>
## Suggested skills
- `<skill>` — <why the next session calls it> (mycelium-extra or lucid-coder skills, for example `focus`, `plot-first`, `verify`, `lucid-coder:sc-de`)
## Read first
- `path:line` — <why it matters>
## Open items
- <item> — <return condition>; lean (not a decision): <one line>
Rules:
path:line and commit hashes, never copy code, logs, or long output.Assumed, not run lists what the next session must not treat as verified: a belief from memory, a command not run, a path not opened. Write none when there is nothing.lean (not a decision): …, the agent's leaning in one line. The user has not approved it. The next session must not read it as a decision or act on it without asking..living/ exists), link to .mycelium/last-session.md and to .living/decisions.md or learnings.md entries by heading; do not copy them. Never write to Mycelium's files from this skill.## Pending plan (verbatim). That section does not count toward the line limit. With a pending plan, the next action is to re-present it.Check wc -l HANDOFF.md; if it is over about 80 lines (not counting a verbatim pending plan), cut the oldest or least actionable items.
handoff test runs a cold-reader check on HANDOFF.md, or on a filled report when given its .qmd path. It is separate from the two checks above and starts only when the user asks. Follow cold-reader.md: stage the document and the files it points to in an empty folder, give a fresh reader only that path, and show the user its gap list. Fix the file only after the user says so.
handoff bg prints a Background pickup command, only when the user asks. Read references/background.md first. It is printed text for the user to run; the skill never launches the agent.
Do not commit it or change .gitignore; that is the user's call.
If Mycelium's Stop hook asks for .living/ updates afterwards, follow the hook.
End with the resume prompt on its own line, then tell the user to run /clear (or open a new session) and paste it:
Read HANDOFF.md, run its Check first, then <next action>.
With a pending plan, the resume prompt is Read HANDOFF.md, then print pending plan <hash> as its Pending plan section says, unchanged, as your whole reply, with nothing before or after it. Tell the user the gate then shows a fresh card: approve the hash that card shows. It equals <hash> when the text is unchanged; if it differs, the reprint changed the plan, so compare it with the stored copy before approving.
End with one line: Run "handoff test" to check that a fresh reader can follow this file.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub mdmanurung/mycelium-extra --plugin mycelium-extra35 skills in this plugin
/analysis-mapChart a research program too big for one session as a map of decision tickets, then resolve them one at a time. Plans decisions; runs no analysis./analysis-reportFill the Quarto report new-analysis scaffolds in reports/ after a run. Narrative, quoted script excerpts, a step diagram and inspected figures in Overview, Methods, Results and Reproducibility tabs./ask-extraAsk which Mycelium Extra skill fits your situation. Names one to three skills to type and why; starts none of them.Other plugins' skills for the same job