From forge-core
Continue work from another agent's session — auto-detect the most relevant saved session, read its transcript, summarize, and pick up the work. USE WHEN continue from another agent, hand off a session, pick up where codex or gemini left off, summarize a saved session or checkpoint, inspect recent sessions. Not for searching old work by topic — use SessionSearch for that.
How this skill is triggered — by the user, by Claude, or both
Slash command
/forge-core:SessionHandoffThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Hand off a captured agent session into this one: detect the right session, read its transcript, summarize, continue the work. Backend commands and the checkpoint-id variant live in [@Entire.md](Entire.md).
Hand off a captured agent session into this one: detect the right session, read its transcript, summarize, continue the work. Backend commands and the checkpoint-id variant live in @Entire.md.
Begin the first response to this skill invocation with the line:
Entire Session Handoff:
followed by a blank line, then the content. Apply the header to the first response of the invocation only — not on follow-up turns and not on error / early-exit responses (no sessions found, transcript missing). Its presence signals the skill ran and produced real output. The "Unanswered Question" branch still gets the header.
git log, git status, git branch, ps aux, or any other exploratory commands. Use only the backend CLI commands listed in @Entire.md.Query the current session (@Entire.md). If the output is valid JSON, read its worktree_path field — that is the canonical worktree root for this invocation, set by the backend itself. Use it verbatim in the next step (no cwd heuristic needed; symlinks, /private/var//var quirks, and subdirectory invocation are all handled).
If the output is not JSON (no active session in this worktree), set the canonical worktree path to null and rely on the bidirectional prefix-match fallback in Step 2.
List all sessions as JSON (@Entire.md). Each entry has session_id, agent, status, worktree_path, started_at, last_active, turns, last_prompt, files_touched. Apply filters in this order:
worktree_path equals it exactly. Otherwise, keep entries where cwd starts with worktree_path or worktree_path starts with cwd. If either filter yields zero entries, fall back to the unscoped list — better to summarize a slightly-off session than to refuse the handoff.agent matches case-insensitively as a substring (so gemini matches Gemini CLI).agent matches the agent currently running this skill. If this empties the list, undo this filter and keep self — the user is asking you to summarize your own current session for compaction. Note that fact in the announcement (Step 5).last_active (fall back to started_at) descending; take the first.If filtering still leaves zero entries (truly nothing in the list, even self), print a one-line error (no header) and stop.
Stream the session transcript to a temp file (@Entire.md). The snapshot is bounded to the file size at command start.
Extract the original task (head) and final state (tail) from the transcript using the per-agent extraction recipes in @Entire.md — transcript formats differ by agent. Do not show the raw extracted lines to the user. They are inputs for Step 5.
Announcement. First line of the body: Handing off <agent> session — <turns> turns, last active <relative time>, ID <first-8-of-session-id>. If the picked session is your own (Step 2 self-filter fallback), prepend a one-clause note: Self-handoff (no other sessions in this worktree). This gives the user a chance to catch a wrong pick before reading the summary.
Summary structure (skip any section with no genuine content — do not hallucinate filler):
A one-bug-fix session might legitimately have only Task Overview + Current State + Next Steps. A pure-research session might have only Task Overview + Important Discoveries. Empty sections are a feature; pad them only if you have real content.
Continue. Show announcement + summary.
Enumerate the checkpoint's sessions, stream the relevant transcripts, then merge into the same five-section summary — full procedure in @Entire.md. Treat earlier sessions as the source of "Important Discoveries" and "Context to Preserve"; the latest session feeds "Current State" and "Next Steps". Announce as Handing off checkpoint <short-id> — <M> sessions, <total turns> turns total.
npx claudepluginhub n4m3z/forge-coreCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.