session-handoff
Skill5 starsChanged 3 months agoApache-2.0View on GitHub
Generate a handoff prompt that lets a fresh Claude Code session resume a complex task from a crashed/restarted CloseCrab bot session. Reads the old session jsonl plus the bot's recently-written CC Pages docs, extracts task identity / latest state / file locations / pitfalls / team coordination signals, and synthesizes a concise markdown prompt to paste into the new session. Use when a CloseCrab bot's session crashed (API error, context overflow, OOM-killed), or when the user says "wrap up this context for a new session", "give me a handoff prompt for {bot}", "{bot} 的 session 挂了写个交接", or "总结一下让新 session 接着干".
139 other projects use a version of this.
Adopted by
Most recently taken up by
- aktsmm/Agent-Skillstheir own version, first seen Nov 8, 2026
- wanshuiyin/HERO-Anti-OverDefensetheir own version, first seen Nov 8, 2026
- alapha888/session-handoff-kittheir own version, first seen Nov 8, 2026
- zedarvates/frugal-skillstheir own version, first seen Nov 8, 2026
- Sirius-Ji/dsh-disciplinary-skills-for-greenhandstheir own version, first seen Nov 8, 2026
- maideps/ai-harness-frameworktheir own version, first seen Nov 8, 2026
Used with
Projects with it also use ascii-diagram, research-fleet and 10 more.
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.
SethGammonSkillascii-diagram
Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid approach so alignment is guaranteed by math, not token prediction. Includes post-render verification.
Also in 4 projects that use this
SethGammonSkillresearch-fleet
Parallel research using Fleet wave mechanics. Spawns multiple scout agents, each investigating a different angle of the same question. Findings are compressed between waves. Produces a unified research brief from multiple independent perspectives.
Also in 3 projects that use this
vicoa-aiSkilllive-preview
Start a local app in the current user project, expose it through a tunnel, and return preview details in structured Markdown. Use when the user asks for a preview URL, public URL, shareable localhost, mobile/web preview, or tunnel setup.
Also in 4 projects that use this
botlearn-aiSkilldoc-gen
Also in 4 projects that use this
flyingobsidianSkillterminology
Read a codebase, find terminology, create/update definitions into a markdown document.
Also in 3 projects that use this
Dizzy-TenSkillbug-diagnosis
Diagnose bugs and product issues without modifying code. Use when the user explicitly invokes $bug-diagnosis or asks for diagnosis, root-cause analysis, issue classification, or fix strategy for code bugs, failing tests, configuration/dependency problems, deployment issues, performance regressions, data anomalies, or frontend/user-experience problems described through screenshots, annotations, logs, errors, or natural-language reports. Prioritize analysis and recommendations only; do not edit files.
Also in 3 projects that use this
- +1 more from SethGammon
Other versions139 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 139
- rohitg00/pro-workflow★ 2.9ksame name
- SethGammon/Citadel★ 927same name
- wanshuiyin/HERO-Anti-OverDefense★ 805same name
- OneWave-AI/claude-skills★ 378same name
- ai-analyst-lab/ai-analyst★ 304same name
- entireio/skills★ 239same name
- Innei/SKILL★ 92same name
- yuzushi-dev/session-handoff★ 67same name
- Hive-Academy/ptah-extension★ 34same name
- Hive-Academy/PtahCode★ 34same name
129 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 repository54 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-teamsSkill
- bilibili-channelSkill
- bot-configSkill
- browser-cliSkill
- bwrap-bypassSkill
- cc-pages-backupSkill
- chat-styleSkill
- chinese-dictationSkill
- code-wiki-reconSkill
- deck-builderSkill
- docx-form-fillerSkill
- evolutionSkill
- explainer-distillSkill
- feishu-bitableSkill
- feishu-docSkill
- feishu-mailSkill
- feishu-sheetSkill
- feishu-user-msgSkill
- fireworks-tech-graphSkill
- frontend-slidesSkill
- gemini-ui-reviewerSkill
- hk-busSkill
- hk-share-award-tax-dipn38Skill
- imagen-generatorSkill
- issue-handlerSkill
- lecture-videoSkill
- lecture-voiceSkill
- lesson-read-aloudSkill
- live-canvasSkill
- lustre-mounterSkill
- manim-teaching-figuresSkill
- math-video-tutorSkill
- memory-gcSkill
- memory-lintSkill
- multimodal-explainerSkill
- music-generatorSkill
- notifySkill
- page-styleSkill
- paper-explainerSkill
- skill-creatorSkill
- smoke-testSkill
- study-materialSkill
- tmux-installerSkill
- tmux-orchestratorSkill
- tpuguruSkill
- tts-generatorSkill
- veo-generatorSkill
- vscode-referenceSkill
- weather-forecastSkill
- wechat-readerSkill
- wikiSkill
- youtube-channelSkill
- zsh-installerSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 117 edited versions we read keep these.
5
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 67
Read references/handoff-template.md for:
- Distinctive: line 95
Mine pitfalls from user corrections: Search user messages for "不要", "千万别", "为什么", "❌", "你这个怎么..." — these are pitfall-shaped statements …
- Distinctive: line 99
Don't write HTML unless asked: Default output is the markdown prompt only.
- Distinctive: line 103
Does not SSH to remote machines (assumes everything is on local gLinux)
- Very specific: line 104
Does not modify sessions.json (read-only)
- Distinctive: line 105
Does not kill the old session process
- Very specific: line 106
Does not auto-restart the bot (user does that via /restart in 飞书)
“Common” is measured: kept by at least 6 in 10 of the 117 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
Session Handoff
Generate a handoff prompt so a fresh Claude Code session of a CloseCrab bot can resume a long-running task without re-asking the user for context.
When this triggers
- A bot's session crashed (API Error, context too long, OOM-killed bot.py)
- User wants to restart a bot mid-task and preserve state
- User says variations of: "give me a prompt for {bot}", "{bot} session 挂了,写交接", "总结一下让新 session 接着干"
Workflow
1. Run extract_session.py {bot} → structured markdown extract
2. Read top 1-2 most recent CC Pages → ground truth latest state
3. Synthesize 8-section handoff prompt → markdown ready to paste
4. Output the prompt in chat → optionally save HTML briefStep 1: Extract session signals
python3 ${SKILL_DIR}/scripts/extract_session.py {bot_name}Or with explicit jsonl:
python3 ${SKILL_DIR}/scripts/extract_session.py --jsonl /path/to/session.jsonlThe script emits markdown sections:
- User Messages Timeline — every
[from: ...]user msg in order. Mine task evolution from this. - Last N Records — final tool calls / assistant turns. Confirms where it crashed.
- Documents — cc.higcp.com Pages Mentioned — URLs the bot already wrote/referenced.
- Recent Local cc-pages files — mtime-sorted local HTML files. ⚠️ The newest one is often newer than the jsonl — it has the freshest state.
- GitHub URLs / Files Worked On / GCS Paths — code locations, including
/lustre/,/workspace/,/tmp/claude/paths. - Git Signals — branches and commit hashes mentioned.
- Version Iterations —
v1...vNsequence (telling for "what version is current"). - Errors / Crash Points — API errors, OOMs, tracebacks.
Step 2: Read the freshest CC Pages
Identify the 1-2 most recent HTML files from the "Recent Local cc-pages files" section. These are usually the bot's own status/plan documents written after the most recent debugging round.
# Strip HTML tags for plain-text reading
python3 -c "
import re, html
raw = open('/usr/local/google/home/chrisya/gcs-mount/cc-pages/pages/{file.html}').read()
t = re.sub(r'<script.*?</script>', '', raw, flags=re.DOTALL)
t = re.sub(r'<style.*?</style>', '', t, flags=re.DOTALL)
t = re.sub(r'<[^>]+>', ' ', t)
print(html.unescape(t)[:8000])
"Why this matters: the jsonl captures conversation, but the bot often writes the final state ("✅ commit d905b434 pushed", "40L sanity PASS", "next: extend to 61L") into an HTML doc after the last conversation turn. Trust the HTML.
Step 3: Synthesize the 8-section prompt
Read references/handoff-template.md for:
- The 8 required sections
- The format skeleton
- Synthesis hints for picking content from the extract
The 8 sections (中文 by default — matches user's working language):
- 角色 + 任务一句话
- 当前最新状态(带 ✅❌⏳ + 具体数字)
- 必读文档链接(按优先级)
- 关键文件位置(已 patched,不要重写)
- 绝对不要再踩的坑
- Node pool / 资源现状
- 团队 + 沟通规则
- 第一步具体行动清单(精确到 kubectl / git / curl 命令)
Target length: ~80 lines. If detail overflows, link to a HTML brief.
Step 4: Output to user
Print the prompt as a fenced markdown block in chat, ready to copy-paste.
Key principles
The extract is mechanical, the synthesis is judgmental. The script gives you raw signals. Picking which user message captures the "real task", which version is current, which pitfalls actually matter — these all require reading and judgment.
Trust HTML > jsonl for state. The bot writes its final status to CC Pages after the last conversation turn. Use the HTML for §2.
Mine pitfalls from user corrections. Search user messages for "不要", "千万别", "为什么", "❌", "你这个怎么..." — these are pitfall-shaped statements where the user told the bot to stop doing something.
Concrete > abstract. §8 first-step list should have actual commands the bot can run, not "check the status".
Don't write HTML unless asked. Default output is the markdown prompt only. Generate a HTML brief on cc.higcp.com only if the user explicitly asks for one or if the prompt would otherwise exceed 100 lines.
What this skill does NOT do
- Does not SSH to remote machines (assumes everything is on local gLinux)
- Does not modify
sessions.json(read-only) - Does not kill the old session process
- Does not auto-restart the bot (user does that via
/restartin 飞书)
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.

