/lab-skills:handofffrom lab-skills
Coordinate handoff between local (macOS) and cluster (Bouchet) Claude Code sessions for the same project. Use when the user mentions switching machines ("continuing locally", "switching to cluster", "back on the laptop", "I'll work on the other one"), pastes a `git status` from the other side, or when Claude is about to give cross-machine instructions involving rsync, `git push`+`git pull`, `/sync-project`, or `/sync-cluster`. Enforces a strict departure → gate → arrival sequence with multi-chat awareness — pending work in the working tree or unpushed commits may belong to other parallel chats and must NOT be silently swept up. Always write an explicit "DO NOT start work on arrival side yet" gate before any arrival instructions. Do NOT load for single-machine work, regular `/done` wrap-ups within one machine, or git questions unrelated to cross-machine coordination.
Ships in lab-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
When the same project is worked on across local (macOS) and cluster (Bouchet) Claude Code sessions, the gap between /done (per-side wrap-up) and /sync-project (per-side arrival) is unmanaged. This skill fills the gap: it enforces a strict departure → gate → arrival sequence so the user never starts work on the arrival side before the departure side is at a clean pushed state.
Never write "do this on side B" instructions without first verifying side A is committed AND pushed AND working tree clean.
Most concretely: before writing any instruction that involves git pull, rsync, /sync-project, or /sync-cluster on the arrival side, write the explicit gate:
DO NOT start work on [arrival side] yet.
Hold that gate in the conversation until the user reports the arrival side is clean.
git status (or other git output) from a side that is not where Claude currently isrsync, git push immediately followed by git pull on the other side, /sync-project, /sync-clusterBefore issuing ANY arrival instructions, run all three:
git status # working tree state
git log @{u}..HEAD --oneline # local commits not on origin
git log --oneline -5 # recent history (sanity check)
For each piece of pending state, classify it before acting:
| State | Owner | Action |
|---|---|---|
| Files modified in THIS session | This session | Commit per /done rules — specific files by name, never git add -A |
| Files modified by ANOTHER chat | Other chat | Surface to user; do not commit without explicit confirmation |
| Untracked files from THIS session | This session | Stage + commit |
| Untracked files from ANOTHER chat or unknown origin | Other chat / unknown | Surface to user; do not stage |
| Unpushed commits authored in THIS session | This session | Push after committing this session's work |
| Unpushed commits from ANOTHER chat | Other chat | Surface to user; ask whether to push them — the other chat may want to amend before pushing |
This is the multi-chat-safe discipline: this session only owns this session's changes. Anything else needs the user's explicit decision before being swept into a push.
Once departure-side is clean and pushed, write the gate verbatim:
🛑 DO NOT start work on [arrival side] yet.
Departure ([cluster|local]) is now at commit <short-sha>, pushed to origin/main.
Working tree clean.
[If other chats had pending work: that work was left untouched; you may
need to coordinate with those chats before they push.]
Run the arrival steps below in order. Do not begin any new edits on
[arrival side] until step N below reports clean.
The gate is the most important sentence the skill produces. It is what was missing in the 2026-05-07 BUSCO Phase 2 case study — without it, the user reasonably assumes "I can start now while you finish wrap-up here."
Write the arrival commands as a checkpointed sequence, not a "run all of these" block. Each step has a verification, and a STOP-and-report-back gate if the verification fails:
# On [arrival side]:
# === Step 3a — verify clean state ===
cd <project_root>
git status
# Expected: "On branch main" + "Your branch is up to date with 'origin/main'."
# or "Your branch is behind 'origin/main' by N commits"
# If you see uncommitted changes: STOP and report back — they may be from
# another chat. Do not proceed.
# === Step 3b — pull ===
git pull --ff-only
# If --ff-only fails: STOP and report — there may be local commits to merge.
# Do not run plain `git pull` without --ff-only unless you know there are
# divergent local commits AND you want a merge.
# === Step 3c — env updates if needed ===
# Only if conda env or renv lock may have changed during the departure session:
# /sync-project
# === Step 3d — only after the above are clean, RESUME WORK ===
If the departure-side audit reveals the working state has already drifted from origin AND the arrival side has uncommitted changes touching the same files — i.e., the gate was not held and parallel work has already happened — manual reconciliation is required.
The recovery recipe lives in references/divergence_recovery.md. It captures the recipe used in the 2026-05-07 BUSCO Phase 2 case (commit-locally-first, then git pull --no-rebase, then resolve markers).
The same machine can run multiple Claude Code chats in parallel. Handle each:
The clean case. Skill applies as written. Gate works.
Common for parallel workstreams (e.g., one chat doing analysis, another writing docs). Each chat's /done only commits files it modified. When ANY of those chats does a handoff:
The handoff model breaks down. Refuse to coordinate a handoff in this case:
Both sides have active chats (parallel work in progress on local AND cluster). The handoff model assumes one side is fully wrapped before the other resumes. Pick one side to finish first; come back when only one side is active.
Don't try to handoff while both sides are actively producing commits.
If the user says "yes, push that other commit too — that chat is done, just hadn't pushed," proceed but note in the handoff gate message that you pushed work that wasn't from this session. The other chat may still need to know its push happened.
These are the failure modes this skill prevents. Do not do any of these.
| Anti-pattern | What it causes |
|---|---|
| Issuing arrival instructions before departure is committed+pushed | User starts working on stale state, both sides diverge |
| Telling the user "after you switch to local, do X, Y, Z" without first writing "DO NOT start work on local yet" | User starts work in parallel with the wrap-up; divergent commits |
Running git add -A or git add . during /done or handoff | Picks up another chat's uncommitted work |
| Pushing commits another chat made without surfacing them to the user | Other chat loses ability to amend before push |
Using git pull without --ff-only when the goal is a clean catch-up | Silently produces a merge commit when you intended a fast-forward |
Treating uncommitted files in git status as "this session's mess to clean up" | Not all dirty files belong to this session |
Telling the user to run /sync-project while they have uncommitted changes | /sync-project happy-paths assume a clean tree; surprises ahead |
Concrete example of how it goes wrong without this skill. Refer to it when the discipline feels overcautious — the cost of skipping the gate is not abstract.
What happened:
/done with uncommitted .claude/CLAUDE.md, .claude/MBL_SPONGE_ISOSEQ_PLAN.md, STATUS_SUMMARY.md..claude/CLAUDE.md, .claude/MBL_SPONGE_ISOSEQ_PLAN.md, batch/sponge_isoseq_qc/README.md, added 03_mt_markers scaffolding + 17_spongilla_utr_candidates.qmd..claude/ files. Resolution took ~20 minutes of conversation.What the skill enforces to prevent this:
Cost comparison:
/done — per-side wrap-up. Does not handle handoffs by itself. The handoff skill triggers ALONGSIDE /done when /done detects an imminent machine switch (or runs after /done if the switch is announced after wrap-up starts)./sync-project — per-side arrival (git pull + conda env + renv). The handoff skill calls /sync-project as part of arrival-step 3c, AFTER the gate has been held./sync-cluster — separate workflow for ~/.claude/ skills + config (not project git). Handoff skill mentions it as a follow-up if the departure session touched ~/.claude/.For Claude's own use during a handoff. The full sequence in 6 steps:
git status, git log @{u}..HEAD).What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
34 skills in this plugin
/audit-projectPeriodic project health check - cross-check docs, prune conventions, find drift. Use when project documentation feels stale, before milestones, or when CLAUDE.md is getting long. Do NOT load for auditing skills (use /audit-skills) or data analysis scripts (use /audit-script).
/audit-scriptSystematic audit of data analysis scripts for bugs, analytical reasoning, data handling, style, and reproducibility. Includes domain verification phase that researches tools, file formats, and methods to catch domain-specific errors (not just code bugs). Use when auditing a script, reviewing code for correctness, checking for bugs, preparing a script for publication, or when the user says "audit this script", "review this code", "check this for bugs", or "is this script correct". Three modes: thorough (collaborative section-by-section), fast (Claude-driven with discussion), and report-only. Do NOT load for quick one-off questions about a single line or function.
/audit-skillsnpx claudepluginhub musserlab/lab-claude-skills --plugin lab-skills