feat: agent-claude-code reports real $usage from stream-json #83
Reference in New Issue
Block a user
Delete Branch "feat/77-claude-code-usage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Claude Code adapter now reports real token usage from stream-json output — not just placeholder nulls.
What is reported
turns— fromnum_turnsin result lineinputTokens— fromusage.input_tokensoutputTokens— fromusage.output_tokensduration— fromduration_ms(converted to seconds)Claude Code already parsed all this data into
ClaudeCodeParsedResult— this PR just maps it to theUsagetype.Changes
claude-code.ts— buildUsagefrom parsed result inprocessClaudeOutputpackage.json— add@united-workforce/protocoldependencytsconfig.json— add protocol reference747 tests pass.
Note
Stacks on PR #82 (hermes usage). Both can merge independently.
Ref
Fixes #77
Refs #68
LGTM ✅