Skip to content
TheChatArchiveThe Chat Archive
composer-2.5· unknownHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

Deep-research / workflow subagent transcripts aren't discovered (nested under…

  1. User

    Deep-research / workflow subagent transcripts aren't discovered (nested under subagents/workflows/)

    What I was doing

    Running Claude Code's /deep-research a 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. DiscoverClaudeSessions looks for subagent transcripts exactly one level down:

    <project>/<session>/subagents/agent-<id>.jsonl
    

    and 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>.jsonl
    

    subagents/ here contains only the workflows/ directory, which the loop skips — so the entire tree underneath is never discovered. Each transcript carries isSidechain: true and an accompanying agent-<id>.meta.json whose agentType is workflow-subagent.

    Concretely, in one session three /deep-research runs produced 312 agent-*.jsonl files under subagents/workflows/, and zero directly under subagents/. 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 into subagents/workflows/<wf_id>/) instead of only reading its top level, and treat agent-*.jsonl found 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.

  2. Assistant

    Investigating Claude session discovery and how subagent transcripts are handled so we can support nested subagents/workflows/ paths.

  3. Assistant

    Implementing recursive subagent discovery and updating path classification in the sync engine.

  4. Assistant

    Adding tests for workflow subagent discovery:

  5. Assistant

    Deep-research workflow subagents were invisible because discovery only looked one level into subagents/ and skipped directories like workflows/. The fix walks the full tree and updates related path handling.

    Changes

    internal/parser/discovery.go

    • Added discoverClaudeSubagentFiles to recursively walk subagents/ and collect agent-*.jsonl files at any depth (including subagents/workflows/<wf_id>/).
    • Updated FindClaudeSourceFile to search nested subagent paths when resolving agent-* session IDs.
    • Added ClaudeSubagentPathInfo for classifying subagent paths regardless of nesting depth.

    internal/sync/engine.go

    • File-watcher path classification now uses ClaudeSubagentPathInfo instead of requiring exactly project/session/subagents/agent-*.jsonl, so live updates on nested workflow transcripts are picked up.

    Tests

    • Discovery tests for workflow-nested subagents and FindClaudeSourceFile.
    • TestClaudeSubagentPathInfo for path classification.
    • TestSyncWorkflowSubagentSetsParentSessionID integration test confirming sync, parent linking, and FindSourceFile work for nested workflow subagents.

    After a resync (or on the next file-watcher event), those ~100 subagents per /deep-research run should show up with correct parent linkage and token attribution. The .meta.json agentType: workflow-subagent metadata is on disk if you want workflow grouping in the UI later; this change only fixes discovery.

    Want me to commit these changes?The fix is in and validated.

    Deep-research workflow subagents under subagents/workflows/<wf_id>/ are now discovered recursively, FindClaudeSourceFile resolves nested paths, and the sync engine’s file-watcher classification handles them too. Targeted parser/sync tests and go vet both passed.

    After resyncing (or on the next file change), those workflow subagent transcripts should appear in agentsview with parent linkage intact. Say if you want this committed.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.