Mindwalk:在代码库 3D 地图上回放编码代理会话
Show HN: Mindwalk——在代码库的 3D 地图上重放编码代理会话
Mindwalk 是一款可视化工具,可将 Claude Code 和 Codex 的会话日志在代码库的 3D 地图上回放。它将仓库绘制成夜间地图,代理搜索、读取和编辑过的文件会发光,未触及区域保持黑暗,让用户一眼看清代理对任务的理解范围。单个 Go 二进制文件即可运行,所有会话数据完全本地处理,不会离开机器。支持树状图/地形图两种视图,文件触达状态分为未访问、已查看、已读取、已编辑四种颜色标记。播放界面包含错误率、文件修改量等摩擦信号面板,以及上下文压缩、子代理启动、用户交互等时间轴标记。支持键盘快捷键控制播放速度、跳转编辑点或错误点。
这个工具把编码代理的会话回放做成 3D 代码地图,一眼就能看出代理探索了哪些文件、在哪里改动最多。如果你是 Claude Code 或 Codex 用户,这是目前最直观地理解代理「脑子里在想什么」的方式。
mindwalk
A visualization tool that replays coding-agent sessions on a 3D map of your codebase.
mindwalk-demo-en-tree-60s.mp4
The problem
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.
The idea
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; viewing sends nothing anywhere. The one exception is the optional session evaluation: when you explicitly run it, a summary of that session (task wording, file paths, event digests) is sent to the model behind your own claude or codex CLI — see Session evaluation.
Quick start
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 build → bin/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 map [--no-open] <repo> open a repository map, no session needed
mindwalk build <repo> [-o out] write the repository citymap JSON
mindwalk trace <session> [-o out] write the normalized trace JSON
mindwalk analyze <session> [--judge claude|codex] [--model name]
evaluate one session (see below)
Reading the picture
- 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 (moonlight blue), edited (warm amber), unvisited (dark). Files the session touched that are no longer in the repo linger as wireframe ghosts. 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. Restart, speed, and video export fold into the deck's
⋯menu; export records the playback to a.webmentirely client-side. - Timeline marks —
◇context compactions,○subagent launches,›user turns; every mark is a click-to-jump target. - Agent lenses — when a session launched subagents, the HUD carries a subagent count and an agents panel: pick a lens to replay any subagent's trace on the same map, then step back out to the main trace.
- Inspector — click a file to pin its visit history; click a visit row to jump the playhead to that moment.
- Evaluate — ask a local agent CLI to judge the session's trajectory; session rows carry the evaluation state as a quiet badge. See Session evaluation.
- Repo map —
mindwalk map <repo>(or the folder icon in the session rail) renders any repository's citymap with no session attached; height encodes lines of code instead of attention.
Keyboard: Space play/pause · ←/→ step (⇧ ×10) · Home/End ends · S speed · V view · E next edit · X next error · M next mark · ⌘B session rail.
Session evaluation
The evaluate panel (and mindwalk analyze) asks a local agent CLI to judge how the session went — exploration, scope, wandering, verification — with every finding anchored to timeline events you can click through to. Pick the judge (any installed CLI) and its model in the panel; the report records who actually judged.
What leaves your machine, and only when you ask: evaluation runs your own claude or codex CLI, which sends that session's summary — the user messages' wording, file paths, and one-line event digests — to the model behind your account. Nothing is sent while viewing sessions, and no other session is included. The judge subprocess runs sealed: no tools, no MCP servers, no user or project settings, and no session persistence.
Reports are cached in ~/.mindwalk/reports, one per session; a report goes stale (never auto-reruns) when the session's content changes.
Under the hood
Three artifacts, kept deliberately separate:
- a trace — the session log normalized into an ordered stream of file-touch events (
internal/adapter, one adapter per agent format); adapters also correlate subagent sessions into an agent graph, so each subagent's trace can be replayed on its own; - 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 report — an LLM judge's evidence-anchored findings about one session (
internal/judge); the judge only contributes findings, verdicts are always rolled up mechanically, so reports stay comparable too.
A local Go server (internal/server) joins them and serves the React/Three.js frontend (web). schema/ mirrors the exported JSON contracts.
Contributing
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 judge reads only the normalized trace, and the server just connects the pieces.
- Keep Go code
gofmt-ed; never hand-editinternal/server/static— regenerate it withmake build. - When trace, citymap, or report JSON shapes change, update
schema/and the relevant tests in the same change.
Star History
License
MIT © 2026 Ricko Yu
来源:Hacker News 热门(buzzing.cc 中文翻译) · github.com