AgentTrace
Audit AI coding-agent sessions locally: cost, tokens, latency and failures in a terminal TUI, plus why a run was slow.
- Source repo
- luoyuctl/agenttrace
- Stars
- ★ 157
- Last updated
- 1d ago
- FARS reviewed
- Oct 13, 2026
- License
- MIT
- Primary language
- Rust
- FA score
- 54/100 · Major gaps
At a glance
- Works with
- Universal · cross-platformCodex · Claude Code
- You'll need
- Typical use
- A developer running Claude Code and Codex CLI side by side sorts the overview by cost over 7d to see which agent and model burned the most tokens and money.
- Main limitation
- Cost and delivery signals are explicitly estimates or heuristics, not provider billing; accuracy depends on you maintaining AGENTTRACE_PRICING_FILE overrides.
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-23
- Source review
- 54/100 · Major gaps
What does this agent do, and when should you use it?
AgentTrace is a local-first Rust tool whose single agenttrace binary opens either a terminal TUI or a set of CLI report commands for auditing AI coding-agent session history. It reads the logs agents already write — Claude Code, Codex CLI, Qwen Code, Cline, Aider, Cursor exports, Hermes Agent, OpenCode, OpenClaw, Pi, Oh My Pi, Kimi CLI, Copilot-style logs and generic JSON/JSONL traces — and normalizes them across projects, agent sources and models. Every session gets input/output/cache token counts, estimated cost, wall-clock time, turn counts, a health score, failures and anomaly flags, tagged with a Detailed, Aggregate or Limited capability level so missing event evidence is never shown as a complete trace. A diagnostics view targets slow runs specifically: long gaps, hanging sessions, retry loops, slow tool calls, oversized parameters and context pressure. Governance reports via --audit, --recommend, --mcp-governance, --context-trends and --delivery-evidence add pricing source and confidence, prioritized remediation ideas, MCP invocation review, cross-session cache and read/write trends, and read-only local Git commit correlation. Output can be JSON, Markdown or self-contained HTML, with no hosted backend and no prompts, code or logs leaving the machine.
AgentTrace scans local disk for the logs coding agents write, detects their format in the parser layer (crates/agenttrace-core/src/parser.rs), and extracts roles, timestamps, models, token usage, tool calls and tool errors step by step. It folds those records into a session index grouped by project, agent source and model, then computes per-session cost, token components, wall-clock duration, turn counts, health score, failure counts and anomaly flags, and assigns a Detailed, Aggregate or Limited capability level. In the TUI you sort and filter by cost, duration, turns, health, failures, anomalies, model, source or text search, while the insight panes show latency stats, long gaps, hanging sessions, retry loops, slow tools, large parameters and context pressure. On the command line, running the binary without a report action opens the TUI and flags such as --sessions and --overview produce reports; --audit reports token component rates, pricing source and confidence; --recommend ranks evidence-backed actions by severity and estimated impact; --mcp-governance reports observed MCP invocations and explicitly marks loaded-server coverage as unavailable when the log does not record it; --context-trends summarizes cross-session context, cache, repeat-read and read/write trends; --delivery-evidence correlates read-only local Git commit timestamps with sessions. AGENTTRACE_PRICING_FILE supplies model aliases and per-million-token prices, reports export as JSON, Markdown or self-contained HTML, and agenttrace --doctor checks the installation.
- A developer running Claude Code and Codex CLI side by side sorts the overview by cost over 7d to see which agent and model burned the most tokens and money.
- A session took 40 minutes to answer; the diagnostics view points at the long gaps, retry loop and slow tool calls responsible.
- A platform team needs a recurring governance artifact and exports agenttrace --overview --range 7d -f markdown with scope, pricing confidence, recommendations and MCP governance attached to a review.
- After renaming model aliases, a user supplies AGENTTRACE_PRICING_FILE with local prices so cost audits remain comparable across sources.
- Someone holding a Cursor export or a home-grown JSONL trace wants it on the same cost timeline as their CLI agents.
- A contributor adds a new agent format by writing a parser in crates/agenttrace-core/src/parser.rs with a redacted or synthetic fixture and tests for both valid and malformed input.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
curl -fsSL https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.sh | shirm https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.ps1 | iexbrew install luoyuctl/tap/agenttracenpm install -g @zack78/agenttrace
- Config files
~/.local/binpricing-overrides.json- Install notes cover
- Windows · macOS · Linux
How do you install or deploy this agent?
On macOS and Linux, the install script downloads the release binary for your platform, verifies its SHA-256 against the published checksum, and adds ~/.local/bin to PATH:
curl -fsSL https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.sh | shOn Windows, PowerShell does the same into %LOCALAPPDATA%\agenttrace:
irm https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.ps1 | iexTo pin a specific release, set AGENTTRACE_VERSION:
curl -fsSL https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.sh | AGENTTRACE_VERSION=v0.9.1 shPackage managers work too:
brew install luoyuctl/tap/agenttracenpm install -g @zack78/agenttraceOr build from source with a stable Rust toolchain:
cargo install --git https://github.com/luoyuctl/agenttrace agenttraceConfirm the installed version with agenttrace --version.
How do you use this agent?
Run the binary with no report action to open the TUI:
agenttracePress L inside the TUI to toggle language; CLI reports, help and errors follow --lang en|zh (default en):
agenttrace --overview --lang zhExport a 30-day cost audit as JSON:
agenttrace --audit --range 30d -f jsonFor custom model aliases and per-million-token prices, write a pricing file:
{"aliases":{"provider/raw-model":"my-model"},"prices":{"my-model":{"input":1,"output":2,"cw":0,"cr":0}}}Then point the environment variable at it:
AGENTTRACE_PRICING_FILE=pricing-overrides.json agenttrace --audit -f jsonThe other governance reports follow the same pattern:
agenttrace --recommend --range 30d -f json
agenttrace --mcp-governance --range 30d -f json
agenttrace --context-trends --range 30d -f json
agenttrace --delivery-evidence --range 30d -f jsonHealth check and updates:
agenttrace --doctor
agenttrace update --checkSafety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
What are this agent's strengths and limitations?
- Local-first by design: parsing, analysis and reporting all happen on your machine, with no hosted backend required and no prompts, code or logs leaving it.
- One Rust binary covers both surfaces — a TUI with no arguments and scriptable CLI reports (--overview, --sessions, --audit, …) exporting JSON, Markdown or self-contained HTML.
- Broad log coverage: Claude Code, Codex CLI, Qwen Code, Cline, Aider, Cursor exports, Hermes Agent, OpenCode, OpenClaw, Pi, Oh My Pi, Kimi CLI, Copilot-style logs and generic JSON/JSONL.
- Honest capability levels: each session is Detailed, Aggregate or Limited, and reports surface parse skips, unknown sources/models and pricing fallbacks instead of hiding them.
- Concrete slow-run diagnostics: long gaps, hanging sessions, retry loops, slow tool calls, large parameters and context pressure each have a defined measurement.
- Tool steps keep only metadata and duration, never prompt, response, result or tool-argument bodies, which makes exported reports safer to share.
- Cost and delivery signals are explicitly estimates or heuristics, not provider billing; accuracy depends on you maintaining AGENTTRACE_PRICING_FILE overrides.
- It only works where agents actually write logs to local disk, and parse depth varies by source, with weaker formats falling to Aggregate or Limited.
- The primary experience is a terminal TUI — there is no graphical dashboard, and sharing across a team means exporting static report files.
- The CLI surface is wide (--audit, --recommend, --mcp-governance, --context-trends, --delivery-evidence), so new users need the docs to pick combinations.
- MCP governance only reflects invocations present in the logs and marks loaded-server coverage as unavailable, so it is not a complete inventory.
- The npm path requires Node.js 18+ and the source path requires a Rust toolchain, adding runtime dependencies to those install routes.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| AgentTrace This agent | 54 · Major gaps | — | ★ 157 | 1d ago | Rust | Codex · Claude Code |
| Tokscale – Track token usage across AI coding agents | 70 · Some gaps | CLIFree | ★ 5.9k | today | Rust | ChatGPT · Codex · Claude Code |
| ccxray | 76 · Good | CLIFree + model costs | ★ 295 | 7d ago | JavaScript | Claude Code · Claude API |
| ccusage | 66 · Some gaps | — | ★ 20k | today | Rust | Codex · Claude Code |
How does FollowAgents rate this agent?
Why each dimension lost points
Trust: README explicitly states local-first operation with no hosted backend, and that tool steps retain only metadata and duration without storing prompt/response/tool-argument bodies, which is positive sensitive-data handling (sensitive_data_handling=2). However, installation uses curl|sh and irm|iex piping remote scripts; despite claimed SHA-256 verification, this is a high-privilege external effect with no interactive confirmation or dry-run (user_confirmation=1, external_effects=1). Rollback only mentions checksum verification on update, with no version rollback or backup mechanism (rollback=1). Dependency security has cargo-deny and locked builds (dependency_security=2), but Cargo.toml does not pin patch versions, so no known-vulnerability-free state can be statically confirmed. Source attribution is limited to README and LICENSE credits, with unverified publisher identity (source_attribution=1).
Reliability: CI covers lint, cross-platform tests, MSRV, smoke, coverage, and dependency policy, plus deterministic output and report semantic consistency checks, giving strong internal consistency evidence (self_consistency=2). Dependencies are common crates.io libraries and rusqlite uses the bundled feature, lowering availability risk (dependency_availability=2). Failure messages are only evidenced by a 'checksum mismatch' string match in the npm installer test; no systematic error taxonomy, exit codes, or user-readable diagnostics are shown (failure_messages=1).
Adaptability: README clearly defines the audience (developers auditing AI coding-agent sessions) and scenarios (cost, latency, failure diagnosis), and lists many supported log sources (audience_and_scenarios=2). Capability boundaries are honestly labeled with Detailed/Aggregate/Limited levels, and cost/delivery fields are marked as estimates/heuristics (capability_boundaries=2). Trigger precision is weak: CLI subcommands and TUI interactive mode coexist without explicit rules for when to use which (trigger_precision=1). Environment fit covers macOS/Linux/Windows and Homebrew/npm/cargo, but requires Rust 1.89 and Node 18+, a moderate barrier (environment_fit=2).
Convention: README is well-structured with install, update, quickstart, governance reports, and a docs index (information_architecture=2). Install notes are detailed, including version pinning and package managers (install_notes=2). Naming stability is a concern: the npm package @zack78/agenttrace differs from the repo luoyuctl/agenttrace, and the workspace version is 0.0.0-dev, indicating naming drift (naming_stability=1). Examples are mostly screenshots and commands, lacking an FAQ or troubleshooting section (examples_and_faq=1). Known limitations are clearly stated (known_limitations=2). License is MIT with a complete file (license=2). Versioning has a changelog workflow, but no CHANGELOG.md content is present in the repo (versioning_changelog=1). Maintenance responsibility points only to contributors, with no named maintainer or governance (maintenance_responsibility=1).
Effectiveness: Output supports JSON, Markdown, and self-contained HTML, with machine-readable fields kept in English for integration (output_usability=2). It offers differentiated value for AI agent session cost/latency/failure diagnosis compared to generic log tools (marginal_value=2). Local operation has no hosting cost and helps locate expensive sessions, giving reasonable cost-benefit (cost_benefit=2). No comparison with similar tools or quantified benefit evidence is provided, so full marks are not awarded.
Verifiability: Most README claims (e.g., local-first, no body storage) can be partially matched in code and docs, but there is no claim-to-file/test mapping (claim_traceability=1). Cross-source corroboration relies mainly on CI workflows and npm tests, with no independent third-party verification or external audit (cross_source_corroboration=1). Fact-inference separation is good, with explicit labeling of estimates, heuristics, and confidence (fact_inference_separation=2).
- Install scripts execute remote code via curl|sh and irm|iex; even with claimed SHA-256 verification, users should download and review the script first.
- The npm package @zack78/agenttrace differs from the repo luoyuctl/agenttrace, which may cause supply-chain confusion; verify the publisher before installing.
- The workspace version is 0.0.0-dev and no actual CHANGELOG.md content is present, limiting version and change traceability.
- Publisher identity is unverified and maintenance responsibility points only to contributors, leaving long-term maintenance and update paths unclear.
- Cargo.toml does not pin dependency patch versions, so static review cannot confirm absence of known vulnerabilities; combine cargo-deny and lockfiles for ongoing monitoring.
FAQ
Does AgentTrace work on Windows?
irm https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.ps1 | iex.Is AgentTrace open source?
Is AgentTrace safe to use?
Is AgentTrace still maintained?
Who makes AgentTrace?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.