Parse the local Claude Code session jsonl structure, diagnose the cause of interruption, automatically restore context or a handoff document, and guide the continuation of the task.
Use Cases
- Task handoff: Development work was started with Claude Code CLI and is halfway done, and now needs to be taken over by Gemini (Antigravity platform).
- Deadlock/limit interruption recovery: Claude Code encountered errors during operation such as API rate limit exceeded (429 Rate Limit) or context window exceeded (422 Context Window Exceeded), causing a forced stop, and the work needs to be seamlessly migrated to Gemini to continue.
- Status diagnosis: Quickly view the latest local Claude Code session, inspect the last executed conversation history, the tools called, and the runtime git branch and cwd information.
How It Works
- Locate the Session file:
Based on the passed-in
session ID(such as a UUID) orsession 文件名, automatically search the Claude directories (including the official~/.claude/projects/) for the corresponding.jsonlfile. Passing in a specific local file path is also supported. - Extract history and status:
- Extract the conversation history of the most recent few turns from the session;
- From
attachmentevents, extract the last generatedHANDOFF.md; - Analyze the most recent
systemandassistantevents to see whether there are any errors.
- Output Handoff and write it to disk:
- Automatically generate/update in the project root directory
HANDOFF.md. If the session contains a loadedHANDOFF.mdattachment, use it as the source of truth; otherwise synthesize a draft version based on the recent context. - Generate a piece of instruction for the user to directly copy and paste to the continuing Agent to guide the follow-up work.
- Automatically generate/update in the project root directory
Usage Steps
- The user invokes this skill in the conversation, passing in a specific session ID or jsonl file path.
- The Agent executes the parsing script:
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] - According to the prompt in the output, copy the handoff instruction and load the updated
HANDOFF.mdto continue working.