You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Log subagent token usage, costUsd, and effective model ID in session logs and agent_output #1195
Ran an 11-worker blind-review subagent workflow (5 parallel background advisors, 5 parallel background reviewers, 1 foreground chair) end-to-end on cmd 1.93.6 using custom agents in ~/.commandcode/agents/ (omitted tools cleanly enforced 0 worker tool calls, 11/11 workers completed on attempt 1, 95.7% parent cache hit rate).
Feature Requests
1. Per-subagent token usage, costUsd, and effective model ID logging (primary ask)
Currently, local session JSONLs under ~/.commandcode/projects/ record usage (inputTokens, cacheReadTokens, outputTokens, costUsd) only for the parent coordinator's turns (e.g., 31 parent turns summing to $0.7979), while the 11 subagent workers' token usage, credit draw, and resolved model IDs are not written to local session logs or returned in agent_output.
Requested:
Include per-worker token usage (inputTokens, cacheReadTokens, outputTokens, costUsd) and resolved model ID in agent_output metadata and/or child session JSONLs (or rolled up distinctly in the parent session log).
Makes full-run credit accounting and multi-agent cost verification transparent for users on plan credits.
2. Optional ambient-instruction opt-out for isolated/blind subagents (nice-to-have)
For pure-reasoning or blind-review custom agents (where tools is already omitted), an optional frontmatter flag to skip project/ambient workspace instructions (similar to Claude Code's omitClaudeMd: true) would tighten context isolation further.
3. Clarify Desktop beta /agents support in docs (minor)
Noting clearly in commandcode.ai/docs/agents whether ~/.commandcode/agents/ custom subagents are supported in Desktop beta builds alongside CLI.
Strong request. Once you run 10+ parallel subagents, parent-only session logs hide both per-worker token burn and which model actually handled each sub-run.
Two edge cases worth pinning when adding per-subagent JSONL logging: keep parent_session_id / subagent_id disjoint so downstream rollups never double-count parent + child totals, and deduplicate sibling content blocks by message_id (plus separate 5m vs 1h cache writes) so multi-block turns do not inflate costUsd. We published two tiny open fixtures for those exact checks if useful:
Activity
roy-tong commentedon Dec 4, 2026
Strong request. Once you run 10+ parallel subagents, parent-only session logs hide both per-worker token burn and which model actually handled each sub-run.
Two edge cases worth pinning when adding per-subagent JSONL logging: keep
parent_session_id/subagent_iddisjoint so downstream rollups never double-count parent + child totals, and deduplicate sibling content blocks bymessage_id(plus separate 5m vs 1h cache writes) so multi-block turns do not inflatecostUsd. We published two tiny open fixtures for those exact checks if useful: