← Back to Discover

agent-trace

A command-line tool that reads the session files coding agents leave on your machine and reports cost, token use, tool success rates and conversation timelines. Runs locally with no API keys; MIT licensed.

Observability & evalsCommand-line tools

What it does

agent-trace analyses the session records that AI coding agents store on your machine. You run it with npx or install it globally, and it either auto-detects supported agents or is pointed at one with a flag. It supports OpenCode, Claude Code, Kimi Code and Codex, and lists Cursor, Windsurf, Cline and Continue as coming soon. The summary view shows totals across sessions and ranks the most expensive ones. The session view covers duration, message and tool-call counts, errors and retries, estimated cost based on standard API pricing, per-tool success rates and timings, flagged anomalies, active periods and the conversation with timestamps. Output goes to the terminal or as JSON, and the README shows a GitHub Actions step that fails a build when cost passes a threshold. The page states that it makes no network requests, never modifies session files and needs no API keys, and that it collects no analytics or telemetry.

Capabilities

  • Cost and token estimates per session and in total
  • Tool health with success rates and timings
  • Anomaly flags for high failure rates, retries and cost
  • Terminal and JSON output for use in CI checks
  • Supports OpenCode, Claude Code, Kimi Code and Codex
  • Local and read-only, with no API keys or telemetry

When to use it

  • You want to know what a long coding-agent session actually cost
  • You are chasing repeated tool failures or retries in an agent run
  • You want a cost check in a CI pipeline