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:<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(agentType: workflow-subagent) is available alongside each transcript if the workflow grouping is worth surfacing in the UI.Interface
No new interfaces are introduced.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
- I have thought about edge cases and made sure my fix handles them as well.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.
Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!
(Current directory: /agentsview, current file: none) bash-$
- Assistant
I'll start by inspecting the repository structure and the discovery code that skips nested workflow subagent transcripts.
- Assistant
I'll open the discovery code around the subagent scan loop mentioned in the issue.
- Assistant
Next I'll locate the subagent discovery loop inside
DiscoverClaudeSessions. - Assistant
rg is not available, let me use grep instead.
- Assistant
Let me read the DiscoverClaudeSessions function around line 300-400.
- Assistant
There's related path-resolution logic too — I'll inspect that and the discovery tests next.
- Assistant
I'll review the Claude discovery tests and search for other flat
subagentspath assumptions. - Assistant
I'll inspect the engine path logic next—it also hard-codes a flat
subagentslayout. - Assistant
I need to also look at line 5590 and understand the watch/sync logic. Also check if there's file watching that walks directories.
- Assistant
I'll check subagent parent linking and any workflow-related path handling next.
- Assistant
I'll inspect how parent session IDs are derived from subagent paths.
- Assistant
Let me look at the section where parentSessionID is derived, around lines 83-220.
- Assistant
I'll check how directory watchers examine the tree and whether nested paths are already covered.
- Assistant
I have enough context—implementing recursive discovery and fixing path classification.
- Assistant
I'll confirm the Go version and whether
filepath.SkipAllis available. - Assistant
Implementing the recursive walk in discovery and relaxing the engine path classifier.
- Assistant
Updating
FindClaudeSourceFileto search nested workflow subagent paths. - Assistant
There's an extra brace to remove from the edit.
- Assistant
There's a duplicate return to clean up.
- Assistant
Next I'll update the engine's path classifier for nested workflow subagents.
- Assistant
Cleaning up leftover braces from the previous edit.
- Assistant
The brace structure is still off—I'll reopen that section and correct it.
- Assistant
Yes, missing two closing braces for the
if relandforloops. Line 504 only has one}. - Assistant
I'll verify compile health and write a temporary script to exercise nested workflow discovery.
- Assistant
Need to set GOPATH/GOMODCACHE
- Assistant
It seems the build finished with no errors (just downloads). Let me confirm by running go build again and then a verification script.
- Assistant
Writing a temporary verification script for nested workflow discovery.
- Assistant
Need to fix the module path in the test script.
- Assistant
Can't import
internalfrom outside the module — I'll drop a temp test under the package instead. - Assistant
Discovery is good—next I'll exercise engine path classification for nested agents.
- Assistant
Let me look at how Engine is constructed for these tests.
- Assistant
I'll add a temporary engine test covering nested workflow classification.
- Assistant
Running the existing discovery and related engine tests, then cleaning up temp files.
- Assistant
Checking other Claude path parsers that may still assume a flat subagents layout.
- Assistant
There's another discovery entrypoint named in the report—I want to confirm what it maps to.
- Assistant
Removing temporary tests and running a broader verification pass.
- Assistant
That cortex failure looks unrelated—I'll confirm and re-run only discovery-related tests.
- Assistant
I'll re-verify quickly, then inspect the final diff.
- Assistant
I'll clean up a redundant suffix check in the engine classifier.
- Assistant
Final verification, then submit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
claude-sonnet-5Compare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.6-35B-A3BCompare side by side →
Qwen/Qwen3.5-35B-A3BCompare side by side →
Qwen/Qwen3.5-35B-A3BCompare side by side →