mcpbeat Sign in

Claude Code Handoff Skill for Claude

从 Claude Code 的 Session 解析 jsonl 对话记录,接续执行任务

5k tokens
context cost
the whole folder, loaded on every use
2
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
249
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/cafe3310/public-agent-skills --skill claude-code-handoff

The instruction itself

1 sections, as written by the author

claude-code-handoff

解析本地 Claude Code 的 session jsonl 结构,诊断中断原因,自动恢复上下文或交接文档并指导接续任务。

适用场景

  • 任务接力:开发工作由 Claude Code CLI 启动并开发至一半,现在需要由 Gemini (Antigravity 平台) 接管。
  • 死锁/限制中断恢复:Claude Code 在运行过程中遇到了 API 频率超限 (429 Rate Limit) 或上下文超长窗口超限 (422 Context Window Exceeded) 等错误强制中止,需要无缝迁移至 Gemini 续作。
  • 状态诊断:快速查看本地最新的 Claude Code session,查看最后执行的对话历史、调用的工具以及运行时的 git 分支和 cwd 信息。

工作原理

  • 定位 Session 文件:

根据传入的 session ID(如 UUID)或 session 文件名,在 Claude 目录(包括官方的 ~/.claude/projects/)中自动搜索对应的 .jsonl 文件。同时也支持传入具体的本地文件路径。

  • 提取历史与状态:
  • 提取 session 中最近几轮的对话历史;
  • 从 attachment 事件中提取最后生成的 HANDOFF.md ;
  • 分析最近的 system 和 assistant 事件是否有报错。
  • 输出 Handoff 并落盘:
  • 自动在项目根目录生成/更新 HANDOFF.md。如果 session 包含已加载的 HANDOFF.md 附件,则以它为准;否则根据最近的上下文合成一份草拟版本。
  • 生成一段指令用于用户直接复制粘贴给接续的 Agent 引导后续工作。

使用步骤

  • 用户在对话中调用此技能,传入特定的 session ID 或 jsonl 文件路径。
  • Agent 执行解析脚本:
   python3 {path_to_public-agent-skills}/skills/claude-code-handoff/scripts/claude_handoff_parser.py -f <session_id_or_file_path> [-o /path/to/HANDOFF.md]
  • 根据输出中的提示复制接力指令,并加载更新后的 HANDOFF.md 继续工作。

Other skills for the same job

different authors, same section of the catalogue
Skill Creator
by anthropics
vendor ×10

Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.

56k tokens scripts
Skill Creator
by vercel-labs
vendor ×10

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

12k tokens scripts
Skill Creator
by JayZeeDesign
×9

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

10k tokens scripts
Template Skill
by JayZeeDesign
×7

Replace with description of the skill and when Claude should use it.

35 tokens
Dispatching Parallel Agents
by ZhanlinCui
×5

Use when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies

2k tokens
Skill Development
by anthropics
vendor ×4

This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill content", or needs guidance on skill structure, progressive disclosure, or skill development best practices for Claude Code plugins.

9k tokens
Find Skills
by sanity-io
vendor ×4

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

1k tokens
Writing Skills
by ZhanlinCui
×4

Use when creating new skills, editing existing skills, or verifying skills work before deployment

26k tokens scripts

How to use it

Copy the folder

Take cafe3310/claude-code-handoff from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

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.