recover-killed-session-from-transcript-and-worktree

Recover a killed Claude Code session's plan, work, and cause of death from its transcript and worktree.

3|Updated May 8, 2026
One-click install
npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill recover-killed-session-from-transcript-and-worktree-wan-huiyan
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: recover-killed-session-from-transcript-and-worktree
Source: https://github.com/wan-huiyan/agent-traffic-control/tree/main/plugins/agent-traffic-control/skills/recover-killed-session-from-transcript-and-worktree
Command: npx skills add https://github.com/wan-huiyan/agent-traffic-control --skill recover-killed-session-from-transcript-and-worktree-wan-huiyan

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When a Claude Code session crashes or is killed mid-task, it leaves behind uncommitted WIP, a half-finished plan, and no handoff. Starting fresh wastes the completed work and risks repeating whatever killed the session, while trusting the dead session's "done" claims can ship incomplete fixes. ## Core Features & Use Cases - Worktree artifact recovery: Locate the leftover worktree, uncommitted WIP, reflog history, and leftover plan files like tasks/session_N_todo.md to reconstruct what the session was doing. - Transcript mining with jq: Extract user decisions, the plan, and the last tool calls before death from the session's JSONL transcript at ~/.claude/projects/<encoded-cwd>/ without loading multi-MB files into context. - Re-verification of inherited work: Treat the dead session's "fixed and verified" claims as partial and re-verify them end-to-end before trusting or shipping them. - Use Case: A session died from an API 529 after a hung screenshot call while fixing three issues. Use this Skill to find its worktree, mine its transcript for the plan and user decisions, identify the screenshot hang as the cause of death, and re-verify its claimed fixes before continuing. ## Quick Start Ask the AI to recover the killed session from worktree X by reading its leftover plan file and mining its transcript for the plan, user decisions, and cause of death.

Frequently Asked Questions about recover-killed-session-from-transcript-and-worktree

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I recover a Claude Code session that was killed mid-task?▼

Find the leftover worktree with git worktree list, read any leftover plan file like tasks/session_N_todo.md, then mine the session's JSONL transcript for the plan, user decisions, and last tool calls. Re-verify any claimed fixes before continuing the work.

Where are Claude Code session transcripts stored?▼

Transcripts live at ~/.claude/projects/<encoded-cwd>/*.jsonl, where the encoded path replaces slashes with dashes. The killed session is usually the most recently modified file, often abnormally short or ending abruptly.

How do I extract user messages from a Claude Code JSONL transcript?▼

Use jq to filter lines where type is "user" and the message content is a string, then grep out system reminders and tool results. This avoids loading multi-megabyte transcript files into context.

Can I trust a killed session's claims that fixes were verified?▼

No. Killed sessions often wrote "fixed and verified" notes mid-verification before dying. Re-verify inherited fixes end-to-end, since the dead run may have checked only one symptom of an incomplete fix.

What should I do if transcript mining with a subagent fails?▼

Transcript mining can overload and fail with API errors when dispatched to a fan-out subagent. Fall back to running jq queries directly yourself to extract the plan, decisions, and cause of death.