agenttrail README

项目的 README,来自 github.com/sodiumsun/agenttrail。合并为一个 markdown 文件:README.md。

agenttrail

agenttrail

Local observability for AI coding agents.

Map on npm Map checks license

Agenttrail draws a live map of your project and shows where your coding agents are working on it: which part is changing, which tasks each session has reported, and what it is doing now. You see that in one browser tab instead of piecing it together from several terminal windows.

Your agents keep running in tools such as Claude Code and Codex. Agenttrail reads local files, your plan and the agents' local logs, and shows that evidence. It does not run agents, assign their work or decide that a task is finished.

Agenttrail Map showing live sessions, component progress and file changes

Run it in your repo

You need Node.js 20+ and a local project folder.

cd your-repo
npx agenttrail

The map opens in your browser at localhost:5330, or the next free port. Keep working in your coding agent. Claude Code and Codex sessions in this repo appear as run cards from their local logs, with nothing to install. File changes appear as they happen.

Watching does not change your repo. In an interactive terminal, starting without a PLAN.md offers to set one up, and you can decline.

Draw the component map

File activity and run cards work on their own. With no plan, the map is inferred from git, read-only and across every branch and worktree: the handful of branches and worktrees with recent work, drawn as the plan's cards flowing from the trunk by what grew out of what. Each card shows the folders it touched, its latest commit, a bar of its commits in the window against the busiest branch, any agent session in it, and more commit subjects underneath. Commit subjects stay on your machine. A repo with one branch shows code areas only, and a folder with no commits keeps the plain Watching view. Add a plan for real tasks and progress.

Run npx agenttrail init, review the setup, then give your agent the backfill prompt from the board. It adds the convention to CLAUDE.md and AGENTS.md, creates a starter plan, offers local Claude Code hooks, and adds .agenttrail/ to .gitignore. Setup writes these files; normal watching does not. Noninteractive init assumes yes, so run it only when you intend to configure the repo.

The map combines declared intent in PLAN.md with observed file changes. A completed component lights up when its files change again. It also has a live file tree, dependency links, session trails and an overview of multiple repos. npx agenttrail up relaunches saved boards after a reboot; npx agenttrail autostart configures startup at login.

The PLAN.md convention
# my project

## Capture the audio {#capture}
tech: coreaudio tap + ring buffer
files: [src/audio/**]
- [x] Grab the mic feed {#capture-mic}
  by: claude
- [~] Keep the last 30 seconds ready {#capture-ring}
  by: claude

## Classify the alerts {#classify}
needs: [capture]
links: [notify]
- [ ] Score events by urgency {#classify-score}
  from: roadmap

## decisions
- 2026-08-21: dropped redis for summaries; in-process queue instead
  • Components use stable {#id} values and concrete, owner-readable names
  • files: connects observed writes to the component they belong to
  • [~] means working, [x] means done, and [!] means stuck
  • needs: draws dependency arrows; links: draws dashed connections
  • by: records who did the work; from: separates agent intent from roadmap intent
  • kind: knowledge renders a component as a purple knowledge organ; kind: human renders it dashed in its own color — the step where a person enters the loop; url: with an http(s) address makes the card clickable, opening the artifact it produces
  • Backfilled completed tasks cite their implementing file as evidence
  • Agents record plan-affecting decisions before they act on them

What it can see

Tool How Map sees it What you get
Claude Code Local logs in ~/.claude/projects, automatically. Hooks are optional Sessions, tool activity, file trails, sub-agents, and task lists from TaskCreate/TaskUpdate or TodoWrite
Codex Local logs in ~/.codex/sessions, automatically Sessions, tool activity and file trails. Plans appear only when the log contains an update_plan call, which recent versions rarely write, so they usually show as unknown
pi The Agenttrail extension for pi Sessions, tool activity, file trails, and todo lists from a todo tool
Any other agent Events it posts to Map, see Reporting runs from any agent Whatever it reports: sessions, tools, written files and task lists
Cursor and other tools No session adapter File changes and whatever the agent records in PLAN.md

Claude Code hooks are not needed to see a session. They add three things: events the moment they happen rather than within a few seconds, a reminder to the agent when the plan has fallen behind the code, and a terminal id in Map's data when the terminal sets HC_TERMINAL_ID. A session seen through both hooks and its log stays one run.

Map reads logs touched in the last two hours and at most the last 2 MiB of each. Cloud sessions with no logs on this machine are not visible. Local log formats can change between agent versions. How observability works

Beside your agents in Herdr

A mod for the Herdr desktop app draws Map natively beside your agents: the same cards and connectors from PLAN.md, in a side panel that expands to full size and follows the repo of the focused terminal. With no plan it falls back to a simple view from git. It only reads. See herdr/README.md.

Local by construction

Map binds to 127.0.0.1. It needs no account, telemetry, transcript upload, model call or cloud service, and it opens agent logs read-only. Run cards can show shortened command text, search terms and other tool details, and Map saves recent activity under ~/.agenttrail. Review what is visible before sharing a recording. Data sources and local storage

Map is a dependency-free Node daemon and a static page. It does not control your agents, send prompts, approve actions or mark their tasks complete.

FAQ

Is Agenttrail an agent framework? No. You run agents in their existing tools, and Agenttrail shows the available evidence of what they are doing. Token billing and full model traces are not implemented.

Will this work in an existing repo? Yes, run it from that folder. Git and PLAN.md are optional.

Why is a session missing? A new session can take about ten seconds to appear. It must be working inside the watched repo, with its logs on this machine. A session that has been silent for two hours drops off the live view.

Does a finished task mean the work shipped? No. It means the agent reported the task complete. A turn ending or a file changing does not prove an outcome either.

What changes in my repo? Watching changes nothing. init creates the plan and agent instructions, offers hooks in .claude/settings.local.json, and adds a .gitignore entry.

What is still unverified? Windows has not been tested. Automated checks run on Linux and macOS.

What happened to Kitchen? The experimental 3D view has been retired so the project can focus on Map. Its last release stays on npm as agenttrail-kitchen, without further updates.

Contribute and license

Report a bug · Contributing

MIT for the project code and original assets.

agenttrail (sodiumsun/agenttrail)

正在搜索数据库…

这是什么?Agenttrail 是一个本地可观测性工具,它会监视 Codex 和 Claude Code 等 AI 编程智能体,把它们的活动变成实时可视化视图,无需再拼凑多个终端窗口。
这是智能体框架,还是只是一个查看器?它纯粹是一个可观测性层,带有两个视图——Map 展示项目结构,Kitchen 展示 3D 任务/角色视图——它们读取本地文件、计划和智能体日志。它从不运行智能体、分配工作或判定任务完成。
怎么开始观察我的项目?在你的仓库中运行 'npx agenttrail' 打开 Map 视图,或运行 'npx agenttrail-kitchen .' 在 localhost:4780 打开 3D Kitchen 视图。基础观察不需要 PLAN.md、API 密钥或新的智能体会话。
运行它需要安装什么?你需要 Node.js 20+、支持 WebGL 的浏览器和一个本地项目文件夹;npm 包已捆绑图形资源和字体,无需单独构建。
它对每个编程智能体的支持都一样吗?Codex CLI 和 Claude Code 拥有经过实际演练的本地协作支持;Cursor 的适配器测试已通过,但原生实时验证仍未完成,不支持的智能体只能看到基本的文件变更。macOS 经过直接实测,Windows 和原生 Cursor 的验证仍待完成。
我的活动数据会离开我的电脑吗?不会。Map 和 Kitchen 都只绑定 127.0.0.1,没有账号、遥测、对话记录上传或云端调用,Kitchen 也只把白名单内的活动字段发送给它自己的本地浏览器视图。
Map 和 Kitchen 有什么区别?Map 借助 PLAN.md 和可选的 Claude Code hooks 展示整体项目结构、依赖和文件活动。Kitchen 则利用原生 todos 和本地 Codex/Claude 活动,把当前任务和角色贡献可视化为一个 3D 烹饪场景。它们作为独立的本地服务运行,不过 Kitchen 可以读取正在运行的 Map 的上下文。
PLAN.md 约定是干什么用的?它是一种轻量级 markdown 格式:用稳定的 {#id} 标签声明组件、依赖关系(needs/links)和状态标记([~]、[x]、[!]),Map 借此把观察到的文件变更关联到地图上正确的组件。
不连接真实智能体能试用吗?可以,在任一命令后加上 --example,然后点击“下一个示例步骤”,即可逐步体验带标注的脚本化演示,它与实时观察相互独立。
它支持 Cursor 或 VS Code 吗?Cursor 智能体通过可选的仓库 hooks 连接(适配器测试已通过,但原生实时验证仍未完成);VS Code 尚无专用扩展,你可以在它的集成终端里运行 Kitchen 命令,让浏览器视图与编辑器并排显示。
作者
sodiumsun
大小
32.4 MB
星标
1K
更新
提交Nov 06
时长
3个月
提交 · 90 天