Deep-research / workflow subagent transcripts aren't discovered (nested under…
- User
Deep-research / workflow subagent transcripts aren't discovered (nested under subagents/workflows/)
What I was doing
Running Claude Code's
/deep-researcha few times, then looking for those sessions in agentsview. Each run fans out into ~100 subagents and leaves a large pile of per-agent transcripts on disk — exactly the kind of session history I'd want to browse and analyze in agentsview after the fact.What happened
None of the deep-research subagent transcripts show up in agentsview. The parent session imports fine; the ~100 subagents per run are invisible.
The cause is a path-depth assumption in discovery.
DiscoverClaudeSessionslooks for subagent transcripts exactly one level down:<project>/<session>/subagents/agent-<id>.jsonland in that loop it skips any directory entry:
// internal/parser/discovery.go ~L359 for _, sub := range subFiles { if sub.IsDir() { continue // ← never descends } name := sub.Name() if !strings.HasPrefix(name, "agent-") || !strings.HasSuffix(name, ".jsonl") { continue } ... }But deep-research (and Workflow-tool runs generally) write their subagent transcripts one level deeper, grouped by workflow id:
<project>/<session>/subagents/workflows/<wf_id>/agent-<id>.jsonlsubagents/here contains only theworkflows/directory, which the loop skips — so the entire tree underneath is never discovered. Each transcript carriesisSidechain: trueand an accompanyingagent-<id>.meta.jsonwhoseagentTypeisworkflow-subagent.Concretely, in one session three
/deep-researchruns produced 312agent-*.jsonlfiles undersubagents/workflows/, and zero directly undersubagents/. All 312 are currently dropped.Why it matters
Deep research is one of the highest-value things to capture: a single invocation can spawn a hundred subagents and burn a lot of tokens, and right now that whole tree is invisible in agentsview — no transcripts, no token/usage attribution, no way to review what the subagents actually did. As more people lean on workflow-style fan-out, this is a growing blind spot.
The fix looks small: walk
subagents/recursively (or specifically also descend intosubagents/workflows/<wf_id>/) instead of only reading its top level, and treatagent-*.jsonlfound anywhere beneath it the same way. The.meta.json() is available alongside each transcript if the workflow grouping is worth surfacing in the UI. - Assistant
I’ll update Claude session discovery to traverse nested subagent directories, add focused unit coverage for workflow paths, then run Go formatting, tests, vet, and diff checks. I’ll preserve unrelated work and leave the changes uncommitted because the workspace-level instruction forbids state-changing Git operations.
- Assistant
rgisn’t installed in this environment, so I’m usingfind/grepfor the repository inspection and keeping the same narrow scope. - Assistant
The same one-level assumption also exists in Claude’s source-file resolver, which is used after discovery to locate original transcripts. I’m applying one shared recursive walker to both paths so nested workflow transcripts remain discoverable and resolvable, while still accepting only
agent-*.jsonlfiles. - Assistant
The implementation and regression tests are in place. The focused parser test suite is still running; once it finishes I’ll address any failures and then run the repository-required formatting and vet checks.
- Assistant
The full parser package reached an unrelated pre-existing permissions test failure (
TestParseCortexSession_SplitHistoryReadErrorexpects a chmod-based read error, but the suite is running as root). I’m isolating the changed behavior now, then I’ll run the required repository-wide formatter and vet independently. - Assistant
go fmt ./...exposed an unrelated, pre-existing unformatted integration test and reformatted it. I’m removing that incidental formatting-only diff so the final change stays limited to Claude discovery and its focused tests. - Assistant
A second production path validates filesystem-change events before syncing. Without updating it, nested transcripts would appear on periodic/full sync but could still be ignored by live updates. I’m extending that validator and adding an integration regression case for a workflow subagent path.
- Assistant
Both regression paths now pass: bulk discovery/source resolution and live
SyncPathsingestion. The unrelated integration file is clean again, and vet passes; I’m doing one broader short-suite run plus a final production-diff and whitespace audit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.