Repository navigation
No way to see what agents cost per module and task - #15
Merged
Merged
Conversation
… Claude Code subagent logs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
VERDICT: accept
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Friction — token cost is the main complaint of the first project's owner, but dpcli could not say where tokens go:
skills/harness-retro/cost.pymeasures sessions, not modules or tasks, so process changes (v18 per-wave coordinator, v20/v22 Edit instead of Bash edits) could not be verified by numbers.Change —
stats --tokensreads Claude Code's subagent logs of the project (~/.claude/projects/<project>/*/subagents/*.jsonl); an agent is attributed by its first message, which is a dpcli brief (<ID> <type>: …,Review <ID>: …,Module <m>: …; the Russian protocol of older journals too). Prints context tokens of executors / reviewers / coordinators per module and the per-task median. Other agents are not counted. Opt-in: reading the logs takes ~3 s on ~300 agent logs.Real numbers from the first project (anonymized): per module, one coordinator processed 76–148M context tokens — about as much as all executors of the module together; per-task median 4–16M. That is the evidence behind v18's "one coordinator per wave".
Test:
tests/test_stats_tokens.py(fake logs: executors, reviewer, coordinators in both languages, a non-dpcli agent).