Skip to content

Track + break down workflow/ultra subagent usage (fix #470)#471

Merged
iamtoruk merged 2 commits into
mainfrom
fix/470-workflow-subagent-usage
Jun 10, 2026
Merged

Track + break down workflow/ultra subagent usage (fix #470)#471
iamtoruk merged 2 commits into
mainfrom
fix/470-workflow-subagent-usage

Conversation

@iamtoruk

@iamtoruk iamtoruk commented Jun 10, 2026

Copy link
Copy Markdown
Member

Fixes #470, and adds a Claude-scoped agent-type breakdown so workflow/ultra usage is visible.

1. Fix: workflow/ultra subagent usage was undercounted (#470)

collectJsonlFiles only read agent transcripts directly under subagents/, but the workflow feature nests them at subagents/workflows/<wf>/agent-*.jsonl, so their tokens were dropped. Now walks the subagents/ subtree recursively. Verified live: a workflow-using project recovered ~16% of its cost (no change to other projects, no double-counting). Also confirmed through the installed global CLI.

2. Feature: Claude-scoped agent-type breakdown

Surfaces real subagent-transcript spend grouped by agentType (workflow-subagent / Explore / general-purpose / …), read from each agent's sibling .meta.json (cached on CachedFile; session cache bumped 3→4).

  • New in report --format json: claudeAgentTypes.
  • New "Claude Agent Types" dashboard panel, rendered only when Claude agent transcripts exist — never shown for the other ~24 providers (workflow is Claude-Code-only).
  • The existing cross-provider subagents section is untouched (it's Task-input-based and never sees workflow agents).

Live (week): general-purpose $87.83 · workflow-subagent $4.94 · Explore $3.34.

tsc clean, full suite 1166/1166 (5 new tests). No menubar change.

iamtoruk added 2 commits June 10, 2026 00:42
collectJsonlFiles only read agent transcripts directly under `subagents/`, but
the workflow feature nests them at `subagents/workflows/<wf>/agent-*.jsonl`, so
their tokens were dropped — undercounting whenever workflow/ultracode was on.
Walk the `subagents/` subtree recursively. Verified on real data: a workflow-
using project recovered ~16% of its cost, with no change to other projects.
Surfaces real subagent-transcript spend grouped by agentType
(workflow-subagent / Explore / general-purpose / …), read from each agent's
sibling .meta.json (cached on CachedFile; session cache bumped 3→4). This makes
ultra/workflow usage visible — the existing Task-input-based "subagents" section
never sees workflow agents. Shown in `report --format json` (claudeAgentTypes)
and a "Claude Agent Types" dashboard panel that renders only when Claude agent
transcripts exist, so it never appears for the other providers.
@iamtoruk iamtoruk changed the title fix(parser): count workflow/ultracode subagent usage Track + break down workflow/ultra subagent usage (fix #470) Jun 10, 2026
@iamtoruk iamtoruk merged commit f1bf7a1 into main Jun 10, 2026
3 checks passed
@iamtoruk iamtoruk deleted the fix/470-workflow-subagent-usage branch June 10, 2026 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: codeburn does not track usage when Claude Code workflow feature is enabled

1 participant