agenttrace

local-first AI coding agent observability

Know what your agents spent. Find why they slowed down.

agenttrace turns Claude Code, Codex CLI, Gemini CLI, Cursor, Aider, OpenCode, and other local session logs into a fast terminal cockpit for cost, token, health, latency, failure, and slow-run diagnosis. No hosted backend. No prompt upload.

curl -sL https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.sh | sh
agenttrace v0.4.4
agenttrace overview from a real local run with sessions, token cost, latency, and health
sessions analyzed1,761
tokens traced9.13B
estimated cost$5,037.26
critical runs16
average health91%
01 / Observe

One local timeline for messy agent history.

Bring together multi-agent runs, source tools, models, turns, tokens, cost, latency, and health without sending prompts to another service.

02 / Rank

Start with the run that wastes review time.

Sort and filter by cost, duration, tool failures, anomaly type, source, model, text, or health threshold before opening the detail view.

03 / Diagnose

Move from slow to a specific reason.

Surface hanging gaps, slow tools, retry chains, repeated loops, large params, rare tools, context pressure, and concrete next actions.

real local screenshots

Built around the debugging path, not a vanity dashboard.

Overview points you at the trouble. Session List ranks the blast radius. Detail and Diagnostics explain the slowdown. Diff compares adjacent runs when a regression appears.

agenttrace session list showing critical local sessions with cost, tokens, duration, health, and issue columns
RankCritical sessions with cost, tokens, duration, anomaly count, health, and primary issue.
agenttrace detail view with primary issue, metrics, and fix suggestions
InspectPrimary issue, impact, evidence, fix suggestions, and tool warnings in one terminal view.
agenttrace diagnostics view showing tool latency, context utilization, loops, and parameter calls
DiagnoseTool latency ranking, context pressure, loop detection, and large parameter evidence.

operator workflow

Use it live, then leave artifacts.

0Overview

Read the operating picture across sessions, sources, models, spend, health, and failure rate.

1List

Filter and sort until the expensive, failing, or regressing run is at the top.

2Detail

Inspect the selected run with impact, evidence, and suggested next action.

3Diag

Check latency rankings, loops, context headroom, large params, and warnings.

4Diff

Compare neighboring runs to see whether cost, health, duration, tools, or model changed.

reports and gates

Same evidence, outside the TUI.

HTML report agenttrace --overview -f html -o agenttrace-overview.html
PR markdown agenttrace --overview -f markdown -o agenttrace-overview.md
CI gate agenttrace --overview --fail-under-health 80 --fail-on-critical --max-tool-fail-rate 15
Session compare agenttrace --compare -f json -o compare.json

Reads the logs developers already have.

Claude Code, Codex CLI, Gemini CLI, Qwen Code, Cline, Aider, Cursor exports, Hermes Agent, OpenCode, OpenClaw, Oh My Pi, Kimi CLI, Copilot-style traces

open source

Small enough to run locally. Useful enough to attach to a review.

agenttrace is MIT licensed, built in Go, and shaped around real agent operator pain: cost surprises, long-running tasks, tool loops, failing calls, and unclear regressions.