Skip to content
Skills Library
AI & agents · Writing

session-handoff

/session-handoff

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 "总结一下让

Repository
closecrab ↗
Licence
Apache-2.0
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
1
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.

What to check before installing
  • 1 scripts in this package. Review them before installing, as Claude may execute them.

Scripts: scripts/extract_session.py

What it does and when to use it

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 "总结一下让

Triggers from the description

wrap up this context for a new sessiongive me a handoff prompt for {bot}{bot} 的 session 挂了写个交接
Original author description

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 "总结一下让

How it works

  1. When this triggers
  2. Workflow
  3. Key principles
  4. What this skill does NOT do
Original SKILL.md headings · 103 lines, 675 words
SKILL.md preview
---
name: session-handoff
description: 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 接着干".
---

# 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 brief
```

### Step 1: Extract session signals

```bash
python3 ${SKILL_DIR}/scripts/extract_session.py {bot_name}
```

Or with explicit jsonl:

```bash
python3 ${SKILL_DIR}/scripts/extract_session.py --jsonl /path/to/session.jsonl
```

The 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` ... `vN` sequence (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.

```bash
# 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](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):

1. 角色 + 任务一句话
2. 当前最新状态(带 ✅❌⏳ + 具体数字)
3. 必读文档链接(按优先级)
4. 关键文件位置(已 patched,不要重写)
5. 绝对不要再踩的坑
6. Node pool / 资源现状
7. 团队 + 沟通规则
8. 第一步具体行动清单(精确到 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 `/restart` in 飞书)
Files in this package (3)
  • SKILL.md 5 KB
  • references/handoff-template.md 5 KB
  • scripts/extract_session.py 10 KB

Versions

RepositoryScoreLicence
This page · yangwhale/closecrab100Apache-2.0
iuliandita/skills100MIT
cardene777/agent-shuriken100MIT
mcorbett51090/ravenclaude100MIT
upex-galaxy/agentic-qa-boilerplate100MIT
adobe/spectrum-web-components100Apache-2.0
FrancoStino/opencode-skills-collection100MIT
h2xd/skills100MIT
davila7/claude-code-templates100MIT

Database snapshot: 13.11.2026 · package version db2055dd2290 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100save
    Write a handoff document that lets a fresh Claude session (cold context, any model) continue the current work. Captures the mission, the user's latest request verbatim, state, decisions, dead ends, constraints, open questions and exact next steps, plus git state read from the…
  • 100session-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…
  • 100handoff
    Writes a handoff note that lets a fresh agent session or a teammate resume the current task without re-reading the conversation. Use when the user asks for a handoff, summary for later, or context dump, or before ending a long session, switching machines, or clearing context mid-task.
  • 100bot-config
    管理 CloseCrab bot 配置(Firestore)。添加新 bot、给已有 bot 添加 channel、切换 channel、查看配置。当用户说"添加一个 bot"、"新建 bot"、"加个飞书 channel"、"加个 discord channel"、"切换到飞书"、"bot 配置"、"add bot"、"add channel"等关键词时触发。
  • 100handoff-writer
    把一段长会话整理成 HANDOFF.md,让新会话不读历史就能接手。 当用户说「写个交接」「hand off」「总结上下文给新会话」「收尾」, 或上下文快满了而工作还没做完时使用。 Use when the user asks to write a handoff, wrap up, or summarize context for a new session.
  • 90handoff
    Write a structured session handoff so a fresh session resumes losslessly. Use when context is filling up (around half the window), when wrapping a work session, or when the user says "handoff", "checkpoint", "wrap up", or "save state".

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.