with one click
claude-code-session-repair
claude-code-session-repair contains 2 collected skills from wan-huiyan, with repository-level occupation coverage and site-owned skill detail pages.
Skills in this repository
Repair a Claude Code session whose transcript JSONL has an orphan `server_tool_use` / `*_tool_result` content block, causing every API call (including `/compact` and `claude --resume`) to fail with HTTP 400 "unexpected tool_use_id found in advisor_tool_result blocks: srvtoolu_... Each ... block must have a corresponding server_tool_use block before it". Use when: (1) a Claude Code session dies mid-advisor call with "socket connection was closed unexpectedly", (2) resume / compact returns the 400 above naming `srvtoolu_...`, (3) `/remote-control` (or any system event) activated mid-stream while the assistant was emitting an advisor response. Covers diagnosis via grouping JSONL lines by shared `message.id`, surgical deletion of the orphan pair (both halves), and the line-number-drift gotcha that occurs when the file grows between inspection and edit.
Repair a Claude Code session whose transcript JSONL has assistant messages containing a whitespace-only text block (typically `{"type":"text","text":" "}`), causing every API call (including new prompts, `/compact`, and `claude --resume`) to fail with HTTP 400 "messages: text content blocks must contain non-whitespace text". Use when: (1) a session refuses to accept new input with that exact 400, (2) `/compact` fails with the same 400 (since compact replays the full history first — it does NOT bypass the validator), (3) `claude --resume <id>` immediately exits with the same error. Covers diagnosis via JSON-walking the message.content array (NOT plain grep — the empty block is often nested), the distinction between message.content (sent to API → must fix) and toolUseResult (local metadata → harmless, leave alone), the underlying cause (extended-thinking turn serialization emits a synthetic single-space placeholder before the thinking block), and an idempotent fixer script that replaces " " with "." while prese