subagent-report-recoverylisted
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