AgentTrace

Audit AI coding-agent sessions locally: cost, tokens, latency and failures in a terminal TUI, plus why a run was slow.

Stars
★ 157
Last updated
1d ago
FARS reviewed
Oct 13, 2026
License
MIT
Primary language
Rust

At a glance

Works with
Universal · cross-platformCodex · Claude Code
You'll need
Node.js 18+ (optional, npm install)Rust toolchain (optional, cargo install)Shell / CLINetwork accessLocal filesystem
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

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.

  1. 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.
  2. A session took 40 minutes to answer; the diagnostics view points at the long gaps, retry loop and slow tool calls responsible.
  3. 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.
  4. After renaming model aliases, a user supplies AGENTTRACE_PRICING_FILE with local prices so cost audits remain comparable across sources.
  5. Someone holding a Cursor export or a home-grown JSONL trace wants it on the same cost timeline as their CLI agents.
  6. 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 | sh
  • irm https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.ps1 | iex
  • brew install luoyuctl/tap/agenttrace
  • npm install -g @zack78/agenttrace
Config files
~/.local/bin pricing-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 | sh

On Windows, PowerShell does the same into %LOCALAPPDATA%\agenttrace:

irm https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.ps1 | iex

To pin a specific release, set AGENTTRACE_VERSION:

curl -fsSL https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.sh | AGENTTRACE_VERSION=v0.9.1 sh

Package managers work too:

brew install luoyuctl/tap/agenttrace
npm install -g @zack78/agenttrace

Or build from source with a stable Rust toolchain:

cargo install --git https://github.com/luoyuctl/agenttrace agenttrace

Confirm the installed version with agenttrace --version.

How do you use this agent?

Run the binary with no report action to open the TUI:

agenttrace

Press L inside the TUI to toggle language; CLI reports, help and errors follow --lang en|zh (default en):

agenttrace --overview --lang zh

Export a 30-day cost audit as JSON:

agenttrace --audit --range 30d -f json

For 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 json

The 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 json

Health check and updates:

agenttrace --doctor
agenttrace update --check

Safety 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)

Local shell command execution

Can run terminal commands; pair with approval gates or container/OS sandboxing.

Local filesystem read/write

Modifies local files; work on a clean Git branch or dedicated worktree.

Outbound network access

Makes outbound requests; verify telemetry settings and model data routing on private repos.

What are this agent's strengths and limitations?

Pros
  • 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.
Limitations
  • 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?

FollowAgents source review · FARS-2.1
Major gaps
54/ 100 5-point scale 2.7 / 5
Trust 14/29
Reliability 8/14
Adaptability 10/18
Convention 9/18
Effectiveness 9/13
Verifiability 4/8
Why each dimension lost points
Trust14 / 29 · 2.4/5

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).

Reliability8 / 14 · 2.9/5

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).

Adaptability10 / 18 · 2.8/5

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).

Convention9 / 18 · 2.5/5

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).

Effectiveness9 / 13 · 3.5/5

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.

Verifiability4 / 8 · 2.5/5

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).

Risks and how to mitigate them
  • 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.
Evidence confidence: Low Reviewed Oct 13, 2026 Reviewed revision 15ed07f24f4d
See the full review method →
Maintain this project? Add the FARS badge to your README

The badge shows the current review score and verdict and links back to this page. It refreshes about once an hour after a re-review.

FARS

[![FARS review](https://followagents.com/badge/agenttrace.svg)](https://followagents.com/en/agents/agenttrace)
<a href="https://followagents.com/en/agents/agenttrace"><img src="https://followagents.com/badge/agenttrace.svg" alt="FARS review"></a>

FAQ

Does AgentTrace work on Windows?
Yes. The install notes on this page include a Windows command: irm https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.ps1 | iex.
Is AgentTrace open source?
Yes. The source code is on GitHub (luoyuctl/agenttrace) under the MIT licence.
Is AgentTrace safe to use?
FollowAgents' FARS review (Oct 13, 2026) scored AgentTrace 14/29 on trust and safety. None of the eight safety controls the review checks for was missing outright.
Is AgentTrace still maintained?
Yes. The latest commit on GitHub is from 2026-11-23, within the last 30 days.
Who makes AgentTrace?
AgentTrace is published on GitHub by the account luoyuctl. FollowAgents has not verified which person or company is behind that account.
Was this page helpful?
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related concepts