Claude Code Session Jsonl Orphan Advisor Tool Result
Repair a Claude Code session whose transcript JSONL has an orphan servertooluse / toolresult content block, causing every API call (including /compact and claude --resume) to fail with HTTP 400 "unexpected tooluseid found in advisortoolresult blocks: srvtoolu... Each ... block must have a corresponding servertooluse 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.
Install with
Claude CodeCodexCursorGitHub CopilotGemini CLI
Supported by the Atlas install prompt. Skill-specific requirements vary.
Skill stats
Skills1CategoryContent & writingStars0
About this skill
Repair a Claude Code session whose transcript JSONL has an orphan servertooluse / toolresult content block, causing every API call (including /compact and claude --resume) to fail with HTTP 400 "unexpected tooluseid found in advisortoolresult blocks: srvtoolu... Each ... block must have a corresponding servertooluse 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.
Quick start
Copy the install prompt. Use the green button above this README.
Send it to your agent. Paste it into your coding agent’s chat and send.
Review the setup. Your agent checks the skill’s instructions, requirements, and installation scope.
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.
About this listing
Category
Content & writing
Reported license
MIT
Listing language (estimated)
English
Review status
Not individually reviewed
Agent compatibility
Atlas installation supports Claude Code, Codex, and Cursor. Skill-specific dependencies and features are checked during setup.