feat(cli): show tool call summaries with token estimates in watch recent steps - #64
Merged
Merged
Conversation
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.
Summary
Claude Code's adaptive thinking means thinking text is often absent from logs, making the reasoning-first Recent Steps display in
agtrace watchuseless (it also leaked chain-of-thought when present). This PR makes Recent Steps tool-centric and adds intuitive token visibility per step.Changes
Thinking...placeholder instead of the thinking text.server.toolfor MCP), execution duration ([1.2s]), and(+N more)for multi-tool steps. Existing TodoWrite/AskUserQuestion/Task special cases are preserved.→~3.4k— estimated tokens fed back into context by tool results (~chars/4), making the previously blackbox tool-result cost visible.Δ+5.2k— context window growth vs the previous step (input token delta), color-coded: gray < 2k, yellow ≥ 2k, red ≥ 10k, cyan for negative (compaction).turn_history.rsinto a sharedstep_preview_linehelper.MessageBlock/ReasoningBlock/ToolCallBlock/ToolResultBlockfromagtrace-sdk(CLI depends on sdk only).Tests
10 new unit tests covering priority order, thinking-text suppression, result token estimation, duration formatting, multi-tool counts, delta chaining across steps (including in-progress steps without usage), negative delta after compaction, and error flagging.
mise run verifypasses.🤖 Generated with Claude Code