Show HN: Mindwalk – 在代码库的 3D 地图上回放编码代理(coding-agent)的操作过程
Show HN: Mindwalk – Replay coding-agent sessions on a 3D map of your codebase

原始链接: https://github.com/cosmtrek/mindwalk

**Mindwalk** 是一款本地可视化工具,它能将编码智能体的会话日志转化为直观的 3D 代码库“城市地图”。原始的 JSONL 日志往往让智能体的推理过程变得难以捉摸,而 Mindwalk 则将智能体的活动呈现为代码库中移动的“光点”——当智能体进行搜索、阅读或编辑时,光点会变得更加明亮。 主要功能包括: * **视觉化上下文:** 通过径向树或矩形树图界面,清晰呈现智能体对代码的理解“足迹”。 * **状态追踪:** 文件根据操作状态进行颜色编码(例如:绿色表示已查看,白色表示已读取,琥珀色表示已编辑),HUD(平视显示器)则会实时显示错误率和代码变动情况。 * **回放控制台:** 利用基于直方图的时间轴,轻松查看会话过程。该时间轴可区分观察型任务(冷色调)和修改型任务(暖色调)。 * **隐私优先:** 使用 Go 语言编写,完全在本地运行,确保任何会话数据都不会离开你的机器。 用户可以通过命令行界面(CLI)自动扫描项目或打开特定会话,从而检查智能体行为、浏览文件历史,并直接跳转到编辑、错误或用户交互等关键事件。该工具采用解耦架构设计,将数据标准化(追踪记录)与代码库布局(城市地图)分离开来,以确保一致性和可扩展性。

**Mindwalk** 是一个新项目,它通过在代码库的 3D 地图上重现 AI 编程代理的操作过程,将 AI 的工作流可视化。该工具由 GitHub 用户 *cosmtrek* 开发并在 Hacker News 上分享,旨在帮助开发者检查和评估大语言模型(LLM)如何在项目中导航并解决任务。 该项目在其效用方面引发了广泛讨论。批评者质疑 3D 可视化相较于 `git diff` 等标准命令行工具的实际价值,认为它主要是一种“视觉点缀”。然而,支持者认为空间化表示提供了代理行为必要的宏观视角,能够更轻松地发现模式、评估模型性能,并识别代理可能“迷失”或曲解指令的地方。 讨论还强调了该项目与其他工具(如 *Glyph3D*)协同的潜力,并提出了未来改进的建议,包括累积会话历史记录和性能诊断测试。虽然一些用户对该项目的意义表示怀疑,但另一些用户将其与 *Gource* 相提并论,并称赞它是迈向更直观、更具空间感的 AI 交互界面所迈出的前瞻性一步。该项目以 MIT 协议开源。
相关文章

原文

A visualization tool that replays coding-agent sessions on a 3D map of your codebase.

A session log records what an agent did, but not how it understood the task: which parts of the repo it treated as relevant, where it explored before it acted, whether its footprint matched the scope you had in mind. Reading the raw JSONL line by line doesn't answer any of that.

Draw the repository as a night map, and play the session back as light moving through it: where the agent searched, read, and edited, the map glows — everything else stays dark. The agent's understanding of the task becomes a shape you can see at a glance. One Go binary reads Claude Code and Codex session logs, fully local; no session data leaves your machine.

mindwalk replaying a session in the tree view

curl -fsSL https://raw.githubusercontent.com/cosmtrek/mindwalk/master/scripts/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
mindwalk

The installer verifies the binary against checksums.txt and installs to ~/.local/bin (override with INSTALL_DIR; pin a release with VERSION). Windows archives are on GitHub Releases. To build from source: make setup && make buildbin/mindwalk.

With no arguments, mindwalk scans ~/.claude/projects and ~/.codex/sessions, serves the UI on a random local port, and opens a browser:

mindwalk serve [--port N] [--no-open] [--claude-dir DIR] [--codex-dir DIR]
mindwalk open [--no-open] <session.jsonl>   open one specific session
mindwalk build <repo> [-o out]              write the repository citymap JSON
mindwalk trace <session> [-o out]           write the normalized trace JSON
  • Tree / Terrain views — the repo as a radial tree or a treemap plain; glow ∝ how deeply and how often a file was touched.
  • Touch states — each file keeps its deepest touch: seen (moss green), read (moon white), edited (warm amber), unvisited (dark). The HUD folds friction signals — error rate, churned files, edits after the last verify — into a review strip.
  • Playback deck — scrub or play the session over a bucketed histogram of the run. Bars sit on a cool/warm spectrum: observation stays cool (search, read, exec), mutation glows warm (edit, verify), so editing phases jump out at a glance.
  • Timeline marks context compactions, subagent launches, user turns; every mark is a click-to-jump target.
  • Inspector — click a file to pin its visit history; click a visit row to jump the playhead to that moment.

the same session on the terrain view

Keyboard: Space play/pause · / step ( ×10) · Home/End ends · S speed · E next edit · X next error · M next mark · ⌘B session rail.

Two artifacts, kept deliberately separate:

  1. a trace — the session log normalized into an ordered stream of file-touch events (internal/adapter, one adapter per agent format);
  2. a citymap — a deterministic layout of the repository (internal/citymap); the same tree always produces the same map, so replays are comparable across sessions.

A local Go server (internal/server) joins the two and serves the React/Three.js frontend (web). schema/ mirrors the exported JSON contracts.

Issues and pull requests are welcome. To get a working dev setup:

make setup   # install frontend dependencies
make serve   # dev server on :8765, serving web/dist from the working tree
make test    # go test + frontend build — run before sending a PR
make build   # regenerate embedded assets and bin/mindwalk

Ground rules (see AGENTS.md for the full architecture notes):

  • Keep the boundaries: adapters don't know about rendering, citymap generation doesn't depend on playback, the server just connects the two.
  • Keep Go code gofmt-ed; never hand-edit internal/server/static — regenerate it with make build.
  • When trace or citymap JSON shapes change, update schema/ and the relevant tests in the same change.
联系我们 contact @ memedata.com