项目介绍
Agent 配套工具 · 2026-11-09 更新 · 本站尚未实测
agenttrace 是一个本地优先(local-first)的终端 TUI 与报告生成工具,用于查看 AI 编程 Agent 的历史会话。它会读取 Claude Code、Codex CLI、Qwen Code、Cline、Aider、Cursor 导出文件、Hermes Agent、OpenCode、OpenClaw、Pi、Oh My Pi、Kimi CLI、Copilot 风格日志,以及通用 JSON/JSONL 轨迹文件,帮助回答两个日常问题:多个 Agent 在成本、Token 与时间上各花了多少;某次任务为什么跑得慢。
同一个 agenttrace 二进制同时提供两种界面:不带报告参数运行会打开 TUI;传入 --sessions、--overview 等参数则输出 CLI 结果。README 说明其处理完全在本地进行,提示词、代码与日志无需离开本机,也不需要托管后端。
核心能力
点击能力名称查看输入、输出和原文依据。
- 历史花费回顾:按项目、Agent、模型分组,支持 Today / 7d / 30d / All 时间范围。
- 数据可信度说明:报告范围、各来源覆盖情况、解析跳过、缓存命中、未知来源与模型、定价回退等。
- 成本审计与行动建议:Token 分项费率、定价来源与状态、预估成本置信度,并给出有证据支撑的优先修复建议。
- 治理类报告:MCP 调用治理(仅基于源日志实际记录的调用)、跨会话上下文/缓存/读写趋势、只读 Git 提交与会话的时间相关性(启发式)。
- 能力等级标注:每个会话标记为
Detailed、Aggregate或Limited,避免把缺失事件级证据的会话当成完整轨迹。 - 隐私安全的步骤信息:当源日志提供调用 ID 与时间戳时,仅记录工具步骤元数据与时长,不存储提示词、响应、结果或工具参数正文。
- 慢任务诊断:延迟统计、长空档、挂起会话、重试循环、慢工具、大参数与上下文压力。
- 回归证据:在提供本地基线时可做对比,报告中含事件时间线与保守的工具权限分类。
- 首个会话的分诊:按成本、时长、健康度、失败、异常、模型、来源或文本搜索排序过滤。
- 可分享输出:JSON、Markdown 与自包含 HTML 报告。
实际应用场景
适用场景
适合日常使用多个 AI 编程 Agent、希望统一查看各工具会话开销与耗时的开发者;也适合排查某次编码任务为何长时间卡住、反复重试或工具调用异常的场景。需要把会话证据以报告形式留存或分享给团队时,可输出 JSON/Markdown/HTML。README 明确指出所有成本与交付相关字段均为估算或启发式结果,不代表服务商真实账单,也不构成提交已进入 main 的证明。
安装与接入
README 提供的安装方式:
- macOS 与 Linux 安装脚本:
curl -fsSL https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.sh | sh
- Windows PowerShell:
irm https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.ps1 | iex
- Homebrew(macOS 与 Linux):
brew install luoyuctl/tap/agenttrace
- npm(macOS、Linux、Windows,需 Node.js 18+):
npm install -g @zack78/agenttrace
- 从源码安装:
cargo install --git https://github.com/luoyuctl/agenttrace agenttrace
安装脚本会下载对应平台的发布二进制、校验 SHA-256 并将安装目录加入 PATH。可用 agenttrace --version 检查版本。更新方式按安装渠道区分:安装脚本使用 agenttrace update(--check 仅检查),Homebrew 使用 brew upgrade luoyuctl/tap/agenttrace,npm 使用 npm install -g @zack78/agenttrace@latest,cargo 使用带 --force 的重新安装命令。
接入方面,README 的日志读取流程未要求额外模型 API Key;这仅说明本次文档给出的接入路径,它直接读取各 Agent 已写在本地的会话日志文件;各来源日志的默认路径与识别规则详见仓库 docs/guides/parser-guide.md,本页不作推测。
使用条件与限制
- 是否需要部署
- 需自行准备运行环境,具体要求见正文
- 是否需要注册
- 账号和认证要求见正文;未明确说明的项目仍待核验
- 是否需要 API Key
- 待核验
- 费用与额度
- 费用边界见正文,项目许可不代表模型或托管服务免费
- 所需权限
- 待核验
- 许可证与服务条款
- 待核验
权限费用与限制
- 成本字段为估算:基于 Token 分项与可覆盖的定价信息计算,README 明确其不是服务商账单。
- 定价覆盖:可通过
AGENTTRACE_PRICING_FILE指向本地 JSON,配置模型别名与每百万 Token 单价覆盖,以修正估价。 - 数据读取范围:仅读取本地会话日志与(可选)本地 Git 提交时间,交付相关性为启发式、只读。
- MCP 治理的局限:已加载服务器的覆盖情况在源日志未记录时会明确标记为不可用,不能据此判断实际启用了哪些 MCP 服务器。
- 工具权限分类为“保守分类”,用于报告参考,不是安全审计结论。
- 工具本身以 MIT 许可发布;但这不代表被读取的各家 Agent、模型或云服务免费或条款相同,相关费用与授权以各自官方为准。
- README 未说明是否存在付费模块或托管服务,费用情况待向官方核验。
- 未提供性能基准或与其他工具的对比数据,实际效果需用户自行验证。
国内使用情况
网友核验 用户经验分享
与站长实测独立,不代表官方认证或本站已实测。
最近核验:暂无有效核验。参与人数按当前项目有效身份去重;不同核验项分别统计,不合并成用户总结果。仅统计审核通过且未过期的记录。
分项统计、有效期与样本量
| 核验项目 | 有效人数 | 成功 / 部分 / 失败 / 无法判断 | 成功率 | 最近核验 / 有效期 |
|---|---|---|---|---|
| 官方网站访问 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| GitHub 仓库访问 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| 安装与运行 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 官方服务国内连接 / MCP 连接 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 国内网络情况 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 7 天 |
| 国内模型兼容性 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 自定义 API | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 海外服务依赖 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 海外账号要求 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 中文界面 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 客户端兼容性 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
| 账号及费用信息 | 0 | 0 / 0 / 0 / 0 | 样本不足 | 暂无 / 30 天 |
成功率 = 成功 ÷(成功 + 部分成功 + 失败);无法判断不计入分母。至少 5 份可判断结果才显示成功率。账号、费用、海外依赖与语言等事实项,成功表示核查结论与资料吻合,具体观察另行统计;不表示免费或没有海外依赖。不同网络、客户端和版本的结果不能直接等同。
最近有效核验
暂无审核通过且未过期的网友核验。欢迎提交真实使用记录。
查看全部有效核验 →国内实测状态:国内可用性待核验。协议兼容和官方资料说明不等于国内网络可用。
- 官方网站访问
- 尚未实测 待核验
- GitHub 仓库访问
- 尚未实测 待核验
- 官方服务国内连接
- 尚未实测 待核验
- 国内网络情况
- 尚未实测 待核验
- 国内模型兼容性
- 尚未实测 待核验
- 自定义 API
- 尚未实测 待核验
- 海外服务依赖
- 尚未实测 待核验
- 海外账号要求
- 尚未实测 待核验
- 中文界面
- 尚未实测 待核验
- 国内最后核验时间
- 尚未实测
许可与国内使用
仓库 LICENSE 为 MIT 许可证,版权归 agenttrace contributors,允许在保留版权与许可声明的前提下使用、修改与分发,软件按“原样”提供、不含担保。
README 列出支持的来源中包含 Qwen Code、Kimi CLI 等国内相关 Agent 的日志格式,说明其解析层覆盖这些来源;但这仅指日志读取,不构成对这些服务在国内可用性、合规性或计费方式的结论。工具本身可完全离线本地运行,安装脚本、Homebrew、npm 与 cargo 渠道均依赖境外托管服务,国内网络能否顺利访问待核验。
项目资料与来源
字段依据与待核验事项
access:来源确认 · npm install -g @zack78/agenttrace
project_type:来源确认 · **agenttrace** is a local-first terminal TUI and report generator for AI coding-agent session history.
原始 README(折叠技术参考)
<p align="center">
<img src="assets/logo-icon.png" alt="agenttrace logo" width="256" height="256">
</p>
<h1 align="center">AgentTrace</h1>
<p align="center">
Local-first TUI and reports for AI coding-agent session history, cost, tokens, time, and slow-run diagnosis.
</p>
<p align="center">
English | <a href="README.zh-CN.md">简体中文</a>
</p>
<p align="center">
<a href="https://github.com/luoyuctl/agenttrace/actions/workflows/ci.yml"><img src="https://github.com/luoyuctl/agenttrace/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
<a href="https://codecov.io/gh/luoyuctl/agenttrace"><img src="https://codecov.io/gh/luoyuctl/agenttrace/graph/badge.svg" alt="Coverage"></a>
<a href="https://scorecard.dev/viewer/?uri=github.com/luoyuctl/agenttrace"><img src="https://api.scorecard.dev/projects/github.com/luoyuctl/agenttrace/badge" alt="OpenSSF Scorecard"></a>
<a href="https://github.com/luoyuctl/agenttrace/releases/latest"><img src="https://img.shields.io/github/v/release/luoyuctl/agenttrace?color=00ADD8" alt="Release"></a>
<img src="https://img.shields.io/badge/Rust-stable-f74c00.svg" alt="Rust">
<img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License">
<a href="https://github.com/luoyuctl/homebrew-tap"><img src="https://img.shields.io/badge/Homebrew-tap-2bbc8a.svg" alt="Homebrew tap"></a>
<a href="https://www.npmjs.com/package/@zack78/agenttrace"><img src="https://img.shields.io/npm/v/@zack78/agenttrace?label=npm" alt="npm"></a>
</p>
<p align="center">
<img src="assets/readme-real-run.gif" alt="agenttrace running locally against real AI coding agent session logs" width="100%">
</p>
---
**agenttrace** is a local-first terminal TUI and report generator for AI coding-agent session history. It reads 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, then helps with two daily jobs: see what multiple agents spent across cost, tokens, and time; and diagnose why a task ran slowly.
One `agenttrace` binary provides both interfaces: run it without a report action to open the TUI, or pass flags such as `--sessions` and `--overview` for CLI output.
## Why agenttrace?
AI coding agents now behave like small build systems: they call tools, retry, stall, and spend tokens while you only see the final answer.
**agenttrace** reads the logs your agents already write and puts cost-heavy or slow sessions first.
It helps you answer:
- **What did my agents spend?** Compare historical sessions by agent source, model, input/output/cache tokens, estimated cost, and wall-clock time.
- **Why was this task slow?** Catch long gaps, hanging sessions, retry loops, slow tool calls, large parameters, and context pressure.
- **Did a run regress?** Compare against a local baseline when supplied, then inspect incident timelines and conservative tool authority categories in reports.
- **What should I inspect first?** Rank sessions by cost, duration, turns, health, failures, anomalies, model, source, or text search.
- **Can I inspect this privately?** Everything runs locally; prompts, code, and logs do not need to leave your machine.
## Real local run
```bash
agenttrace
```
| Overview | Critical sessions |
|---|---|
| <img src="assets/readme-real-overview.png" alt="agenttrace overview showing real local AI coding agent sessions, token cost, errors, and health" width="100%"> | <img src="assets/readme-real-critical.png" alt="agenttrace critical session list from real local AI coding agent logs" width="100%"> |
| Session detail | Diagnostics |
|---|---|
| <img src="assets/readme-real-detail.png" alt="agenttrace detail view showing health, cost, tool failures, and next action from a real local session" width="100%"> | <img src="assets/readme-real-diagnostics.png" alt="agenttrace diagnostics view showing latency, context window, and large parameter calls from real local logs" width="100%"> |
## Install
macOS and Linux:
```bash
curl -fsSL https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.sh | sh
```
Windows PowerShell:
```powershell
irm https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.ps1 | iex
```
The install scripts download the release binary for your platform, verify its
SHA-256 against the published checksum, and add the install directory to your
PATH (`~/.local/bin`, or `%LOCALAPPDATA%\agenttrace` on Windows). To pin a
release, set `AGENTTRACE_VERSION`:
```bash
curl -fsSL https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.sh | AGENTTRACE_VERSION=v0.9.1 sh
```
```powershell
$env:AGENTTRACE_VERSION = "v0.9.1"; irm https://raw.githubusercontent.com/luoyuctl/agenttrace/master/install.ps1 | iex
```
Package managers:
```bash
# macOS and Linux
brew install luoyuctl/tap/agenttrace
# macOS, Linux, and Windows (requires Node.js 18+)
npm install -g @zack78/agenttrace
# From source
cargo install --git https://github.com/luoyuctl/agenttrace agenttrace
```
Check the installed version with `agenttrace --version`.
### Update
| Installed with | Update command |
| --- | --- |
| Install script | `agenttrace update` (`--check` to only look) |
| Homebrew | `brew upgrade luoyuctl/tap/agenttrace` |
| npm | `npm install -g @zack78/agenttrace@latest` |
| cargo | `cargo install --git https://github.com/luoyuctl/agenttrace agenttrace --force` |
`agenttrace update` verifies the release checksum before replacing the binary,
and points package-manager installs back to their manager.
## Quickstart
```bash
agenttrace
```
Reports, help, and errors follow `--lang en|zh` (default `en`; the TUI also
remembers the language you toggle with `L`). Machine-readable fields such as
JSON keys, codes, and the `--sessions` TSV header always stay English.
```bash
agenttrace --overview --lang zh
```
### Governance reports
```bash
# Audit raw token components, normalized pricing, and fallback confidence.
agenttrace --audit --range 30d -f json
# Optional local model aliases and per-million-token price overrides.
AGENTTRACE_PRICING_FILE=pricing-overrides.json agenttrace --audit -f json
# Rank evidence-backed actions by severity and estimated impact.
agenttrace --recommend --range 30d -f json
# Inspect observed MCP invocations. Loaded-server coverage is intentionally
# reported as unavailable unless the source log actually records it.
agenttrace --mcp-governance --range 30d -f json
# Review cross-session context, cache, repeat-read, and read/write trends.
agenttrace --context-trends --range 30d -f json
# Correlate local Git commit timestamps with sessions (heuristic, read-only).
agenttrace --delivery-evidence --range 30d -f json
```
`pricing-overrides.json` accepts `aliases` plus per-million-token `prices`:
```json
{"aliases":{"provider/raw-model":"my-model"},"prices":{"my-model":{"input":1,"output":2,"cw":0,"cr":0}}}
```
`--overview` now includes scope, parse and pricing confidence, cost audit,
prioritized recommendations, MCP governance, context trends, and delivery
signals in JSON, Markdown, and HTML output. All cost and delivery fields are
explicitly estimates or heuristics; they are not provider billing or proof that
a commit reached `main`.
## What you get
| Need | agenttrace gives you |
| --- | --- |
| Historical spend review | Sessions grouped across projects, agents, and models with Today/7d/30d/All ranges |
| Data confidence | Report scope, per-source coverage, parse skips, cache hits, unknown sources/models, pricing fallbacks, and latest observed session |
| Cost audit and action plan | Token component rates, pricing source/status, estimated cost confidence, and prioritized, evidence-backed remediation suggestions |
| Governance trends | Canonical project grouping, observed MCP invocation governance, cross-session context/cache/read-write trends, and read-only Git delivery correlation |
| Honest capability levels | `Detailed`, `Aggregate`, or `Limited` per session so missing event-level evidence is never presented as a complete trace |
| Privacy-safe steps | Tool-step metadata and duration when the source provides call IDs and timestamps; no prompt, response, result, or tool-argument body is stored in steps |
| Slow-task diagnosis | Latency stats, long gaps, hanging sessions, retry loops, slow tools, large params, and context pressure |
| Regression evidence | Local baseline comparison when supplied, incident timelines, and conservative tool authority categories in reports |
| First-session triage | Sort and filter by cost, duration, health, failures, anomalies, model, source, or text search |
| Shareable evidence | JSON, Markdown, and self-contained HTML reports |
| Local-first inspection | No hosted backend required |
## Docs
- Documentation index: [docs/README.md](docs/README.md)
- CI setup: [docs/guides/ci-integration.md](docs/guides/ci-integration.md)
- Governance reports: [docs/guides/governance-reports.md](docs/guides/governance-reports.md)
- Usage over time (daily/weekly/monthly, 5-hour blocks): [docs/guides/usage-over-time.md](docs/guides/usage-over-time.md)
- Cursor import: [docs/guides/cursor-import.md](docs/guides/cursor-import.md)
- Parser guide: [docs/guides/parser-guide.md](docs/guides/parser-guide.md)
- Maintainer distribution guide: [docs/maintainers/distribution.md](docs/maintainers/distribution.md)
Listed in these open source projects:
- [awesome-mac](https://github.com/jaywcjlove/awesome-mac)
- [antigravity-awesome-skills](https://github.com/sickn33/antigravity-awesome-skills)
- [awesome-claude-skills](https://github.com/BehiSecc/awesome-claude-skills)
## Contributing
Parser PRs are welcome. A good parser contribution usually includes:
- a tiny redacted fixture or synthetic sample
- format detection in `crates/agenttrace-core/src/parser.rs`
- role, timestamp, model, token usage, tool call, and tool error extraction
- tests for successful parsing and malformed input
Run before sending a PR:
```bash
cargo test
cargo build --release -p agenttrace
target/release/agenttrace --doctor
```
See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for the full contribution flow.
## License
[MIT](LICENSE) © 2026 agenttrace contributors
历史前置条件说明(补充参考)
运行环境:预编译二进制或 Homebrew/npm 渠道;从源码安装需 Rust 工具链(README 标注 Rust stable);npm 安装需 Node.js 18+。操作系统:README 提供 macOS、Linux 与 Windows 的安装方式。凭据:README 未提及需要 API Key。费用:工具本身在 MIT 许可下发布,README 未说明付费模块或托管服务费用,待向官方核验。网络:安装脚本、Homebrew、npm、cargo 均依赖境外服务,国内访问情况待核验。
项目来源与清单版权许可
https://github.com/luoyuctl/agenttrace
整理来源:https://github.com/slavakurilyak/awesome-ai-agents
清单版权与许可:
MIT License
Copyright (c) 2024 Slava Kurilyak
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.