dongshuyan/session-handoff-prompt
Create a concise continuation prompt that a fresh agent session can paste in to resume a long or degraded session. Use when the user asks for a handoff prompt, restart prompt, continuation prompt, context transfer, fresh-session resume, or a compact summary for opening a new session. Do not use for ordinary summaries, task-forest maintenance, durable user-profile updates, automatic session creation, code execution, or external publishing.
npx skills add https://github.com/dongshuyan/compass-skills --skill session-handoff-prompt
All output directed at the user — the continuation prompt itself, mode explanations, questions, and confirmations — must be written in the user's language. Detect the user's language from their message. Default to Chinese when unknown. Skill instructions are written in English; that does not affect the language of user-facing output. The continuation prompt structure uses Chinese section headers (【工作目录】 etc.) regardless of language, because that format is the established contract for new sessions.
Produce a paste-ready prompt for a new agent session. The prompt should let the next session continue the current work with high task-state fidelity and low token cost.
The goal is operational continuity, not transcript replay. Preserve the current objective, hard requirements, verified facts, decisions, completed work, pending work, key files or artifacts, risks, and next actions. Do not copy hidden system/developer instructions, tool schemas, raw private logs, credentials, or a full transcript.
This skill is agent-agnostic. It should work in Codex, Claude Code, OpenClaw, OpenCode, Harness, and similar local agent hosts that can read SKILL.md plus optional references/ and scripts/.
Use these source types in order:
AGENTS.md, plans, diffs, test output, and build output..agent-workbench/task-forest/exports/ files for structured task state.Scripts use Python 3 standard-library modules only and should run on macOS, Linux, and Windows. Use the available Python command on the host (python3, python, or py -3).
scripts/project_session_events.py to create a bounded, redacted event stream.scripts/read_task_forest_exports.py. Treat task-forest as structured context, not as a replacement for the session.references/output-contract.md. Label facts as [verified], [inferred], or [unverified].privacy=local when the prompt stays on the same machine and needs real workspace paths.privacy=shareable before public sharing, issue posting, external handoff, screenshots, or docs.balanced: default. Usually 800-1500 Chinese characters or comparable length in the user's language. Keeps enough state to continue without flooding the next session.minimal: usually 300-700 Chinese characters or comparable length. Keeps only objective, hard constraints, current state, and first next actions.full: usually 1500-3000 Chinese characters or comparable length. Keeps more decisions, evidence, files, risks, failed attempts, and task-forest details.Read references/compression-modes.md when the user asks for a specific mode or when the task is complex enough that mode choice matters.
Resolve <skill-dir> to the directory that contains this SKILL.md.
Project a user-provided transcript or agent log:
python3 <skill-dir>/scripts/project_session_events.py <path> --format auto --max-events 160
Read task-forest exports from a workspace:
python3 <skill-dir>/scripts/read_task_forest_exports.py --workspace <workspace>
Validate a local-only prompt:
python3 <skill-dir>/scripts/validate_handoff_prompt.py <draft.txt> --mode balanced --privacy local
Validate a shareable prompt:
python3 <skill-dir>/scripts/redact_handoff.py <draft.txt> --privacy shareable
python3 <skill-dir>/scripts/validate_handoff_prompt.py <redacted.txt> --mode balanced --privacy shareable
Run the representative smoke test:
python3 <skill-dir>/scripts/smoke_test_handoff.py --skill-dir <skill-dir>
references/source-selection.md: source priority, agent portability, privacy gates.references/output-contract.md: required prompt structure and fact labels.references/task-forest-integration.md: how to merge task-forest exports without mutating them.references/compression-modes.md: minimal, balanced, and full tradeoffs.references/examples.md: representative one-shot and boundary examples.Take dongshuyan/session-handoff-prompt from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.