ISSUE DESCRIPTION Deep-research / workflow subagent transcripts aren't discovered…
- User
ISSUE DESCRIPTION
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:code<project>/<session>/subagents/agent-<id>.jsonland in that loop it skips any directory entry:
go// 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:
code<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.
Assistant
Let me start by understanding the repository structure and the issue at hand. The issue is about
DiscoverClaudeSessionsininternal/parser/discovery.gowhich only looks for subagent transcripts one level deep undersubagents/, but deep-research and workflow subagents write transcripts one level deeper:subagents/workflows/<wf_id>/agent-<id>.jsonl.Let me first explore the repository structure and then look at the specific file mentioned.
Assistant
Let me look at the discovery.go file mentioned in the issue.
Assistant
The file is quite long. Let me find the specific
DiscoverClaudeSessionsfunction that's mentioned inAssistant
Let me look at the specific areas around lines 308-375 and 450-490 where the subagents discovery happens:
Assistant
Now let me also see around line 440-500 for the second location
Assistant
Let me find and read the
FindClaudeSourceFilefunction to understand the second location:Assistant
Let me read the full
FindClaudeSourceFilefunction.Assistant
Now let me check for existing tests related to discovery:
Assistant
Let me check the testdata and test files:
Assistant
Let me look at the discovery_test.go to see how the tests are structured and if there are already tests covering the Claude subagent discovery.
Assistant
Let me read the full test functions for Claude projects:
Assistant
Now I have a clear picture. There are two functions that need to be fixed:
DiscoverClaudeProjects(~line 352-374): The subagent scanning loop atsubagents/skips directories (if sub.IsDir() { continue }), so theworkflows/directory is never descended into.FindClaudeSourceFile(~line 461-482): Same issue - only looks at<session>/subagents/agent-<id>.jsonl, not deeper.
The fix is to make both locations walk the
subagents/tree recursively. Let me open the file and make the changesAssistant
Let me try again with the correct syntax for the open command.
Assistant
Let me try open with the correct syntax.
Assistant
Now let me look at the
FindClaudeSourceFilefunction:Assistant
Now I have a clear picture. Let me make the edits to both functions. First, let me fix
DiscoverClaudeProjectsby replacing the subagent scanning loop (lines 347-376) to usefilepath.WalkDirfor recursive discovery:Assistant
Now let me fix the
FindClaudeSourceFilefunction. Let me navigate to the current location:Assistant
Let me view the function:
Assistant
Now let me edit the subagent search block in
FindClaudeSourceFileto walksubagents/recursively:Assistant
Both edits look correct. Let me verify the code compiles:
Assistant
Let me check the Go setup:
Assistant
Let me set up the Go environment:
Assistant
Let me set more Go env variables:
Assistant
The code compiles. Now let me run the tests:
Assistant
All existing tests pass. Now let me create a temporary test to verify the new workflow subagent discovery works:
Assistant
Let me put the test inside the repo module
Assistant
Let me create the directory first
Assistant
Now let me write the test file.
Assistant
Now let me run the test
Assistant
The fix works perfectly. Let me now clean up the temporary test and run the full test suite:
Assistant
Now let me run the full parser package tests
Assistant
Let me see which test failed:
Assistant
Let me look specifically for the failing test
Assistant
Let me check if this test failure is pre-existing and unrelated to my changes:
Assistant
The failure is pre-existing and unrelated to my changes. Let me confirm all discovery-related tests pass:
Assistant
All discovery-related tests pass. Let me review the final diff:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.