← ClaudeAtlas

subagent-report-recoverylisted

Recover a background subagent's full report when its completion notification or final message is empty or a one-liner ("Done.", "Complete.", "Standing by."). Use when a Claude Code Agent-tool task finishes with a high token count and many tool uses but the result text is missing the actual report, when the task's output file is 0 bytes, or when re-asking the agent with SendMessage also returns one-liners.
ychampion/ystack · ★ 4 · AI & Automation · score 77
Install: claude install-skill ychampion/ystack
# Recovering reports from subagent transcripts Claude Code specific: it reads the transcripts Claude Code writes for subagents. Other harnesses keep their own session logs; the same idea (find the longest assistant text block) applies if you can locate them. ## When this applies - A background agent (Agent tool, `run_in_background: true`) completes with a useless result like "Done." or "No action pending.", but it clearly did the work (high token count, many tool uses). - Re-prompting it with SendMessage returns another one-liner: the resumed agent has lost the thread or believes it already delivered. - The `output_file` named in the task notification is **0 bytes**. This has been seen on Windows, where the tasks directory sits under `%TEMP%\claude\...\tasks\`. ## When it does not apply - The result text contains the report. Use it. - The agent failed early (few tool uses, small token count). There is nothing to recover; dispatch it again. ## Recovery procedure The real transcript lives in the session directory, not in the task's output file: ``` ~/.claude/projects/<project-slug>/<session-id>/subagents/agent-<agentId>.jsonl ``` `<project-slug>` is the working directory with path separators replaced by dashes; the agent id is in the task notification. If you can't find it, list the session's `subagents/` folder by modification time. Don't read the whole JSONL into context: it can be enormous. Extract only long assistant text blocks: ```python import json, io