ClaudeCodeMod

All shelves / Mods / Usage

agent-trace

By krika2810

agent-trace is a Claude Code usage mod by krika2810.

Draws a pane beside the chat that lists every step after a prompt: each model request, tool call, and subagent, with time, tokens, context, and API-rate cost.

Draws

Install

The marketplace name is agent-trace.

In your shell
claude plugin marketplace add krika2810/agent-trace
claude plugin install agent-trace@agent-trace
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
0.1.0
License
MIT
Repo stars
7
Last change
2026-11-05

What it can reach

  • Draws in the session
  • Reads usage or context figures
  • Sees tool calls
  • Calls another program on this machine

Claude Code 2.1.275 or newer, Git so Claude Code can clone the marketplace, and Python 3 for the Today figure; the rest of the pane works without it. Start a new session or enter /reload-plugins; the pane opens on its own, or run /agent-trace, and /agent-trace clear resets it. Each session's trace is saved as one JSON file in ~/.claude/agent-trace/history/ and deleted after 30 days. Costs are API-rate estimates, not a bill. It works in the terminal, Claude Desktop's Code tab, and the VS Code extension. Inside a session the same two commands are /plugin marketplace add krika2810/agent-trace and /plugin install agent-trace@agent-trace.

The marketplace, agent-trace, holds only this plugin. Seeing what each prompt cost in time, tokens, and money is why this page files it under usage. session-meter draws a pane of context by category, the 5-hour and 7-day windows and their pace, and the last 30 tool calls and model requests. agent-profiler draws where a session's time goes, model wait against tools and subagents, in a status line and a live pane, and can write the session out as an OTLP trace. This one lists every step after a prompt as a card with its time, tokens, and cost, nests tool calls under the request that asked for them, and marks calls that ran in parallel. Its views are Inspect, Context, Agents, Story, Prompts, and Analytics, and the footer copies a run as CSV, Markdown, or JSON with credentials, emails, and home folders masked.

Demo

The author's screenshot of the Agent trace pane on the Inspect tab: a finished prompt (Done in 1m 06s) with its context, tokens, cost and today's total; Insights for the slowest and costliest step; then each model request with its input, output and cached share, time and API-rate cost, and the tool calls under it. The prompt and the numbers are the author's samples.
From the author's repo.

What it hooks into

  • session.startWhen a session starts
  • session.endWhen a session ends
  • command.runWhen you run its slash command/agent-trace
  • prompt.submitWhen you send a prompt
  • turn.startWhen Claude starts a turn
  • prompt.composeWhile you write a prompt
  • turn.stepAt each step of a turn
  • agent.spawnWhen a subagent starts
  • tool.checkA Claude Code event
  • classic.PostToolUseA Claude Code event
  • classic.PostToolUseFailureA Claude Code event
  • tool.callAround a tool call, where it can hold one

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 1

  • /agent-traceOpen the agent trace (/agent-trace clear resets it)

Files

The author's README and source, 4 files. They load when you open them.

Facts

Author
krika2810
Category
Usage
Marketplace
agent-trace
Repo
krika2810/agent-trace
Version
0.1.0
License
MIT
Repo stars
7
Last change
2026-11-05
Language
TypeScript
Files
30

Other mods in Usage

idle-compactdavidarCompacts an idle session after 50 minutes, while the prompt cache is still warm, and pins a status line under the prompt with the before and after sizes.compact-timinglbzepoqoLets the model mark task boundaries and compacts at the end of a turn once the context passes 200k tokens, then resumes the work; a toast shows each compaction.context-metervumichienDraws a band above the prompt with what fills the context window by category, a countdown to when the prompt cache expires, and a Compact button.usage-meterhamzaferDraws the 5-hour and 7-day plan limits as small bars above the prompt, with the reset countdown and what this session cost.context-barhamzaferDraws the context window as one stacked bar, a color per category, with token counts and the compaction point.token-weatherAnthropicDraws a one-line forecast of the context window above the prompt. Fuller goes from clear toward a storm.token-weatherhamzaferDraws the context-window forecast above the prompt, plus how long the prompt cache has left.cache-clockhamzaferDraws a prompt-cache line under the status line: time left while warm, hits and misses, and how many tokens the next message re-caches once it goes cold.openai-balancehamzaferDraws your OpenAI API credit above the prompt: an estimated balance, today's spend, where the money went, and the last call.cost-meterSingh-APHolds a commandDraws session cost, context fill, and the 5-hour and 7-day windows on the status line, plus each turn's cost. An optional budget asks before the next tool call.session-meterarasovicDraws a pane of context by category, the 5-hour and 7-day windows and their pace, and the last 30 tool calls and model requests.cache-timerarasovicDraws a countdown above the prompt until the prompt cache expires, then how many tokens the next message writes again.
All 183 in Usage