Mindwalk Maps Your Agent's Session in 3D — And Shows Where Tokens Get Wasted
By Eric Bush · July 14, 2026 · 6 min read
Seeing What Your Agent Actually Did
Mindwalk is a visualization tool that replays the session logs of coding agents like Claude Code and Codex on a 3D map of your repository. It renders the codebase as a night-time cityscape: files the agent searched, read, and edited glow, while untouched regions stay dark. At a glance you can see how broadly — or how wildly — the agent ranged across your code to complete a task.
It ships as a single Go binary, processes all session data locally (nothing leaves your machine), and offers treemap and terrain views. Files are color-coded by touch state — unvisited, viewed, read, edited — and the playback UI surfaces friction signals like error rates and file-modification volume.
Why Visualization Is a Cost Tool
Token bills are abstract. "You spent $4.20 on this task" tells you nothing about why. Mindwalk-style replay makes the waste visible, and in agent workflows the waste is almost always one of a few recognizable patterns:
- Over-reading — the agent loads dozens of files it never edits, pouring irrelevant code into the context window at input-token cost
- Re-reading — the same file gets pulled into context repeatedly across turns because context was reset or truncated
- Wandering — the agent explores unrelated corners of the repo before finding the right file, a sign the task or context was under-specified
- Thrashing — high error rates and repeated edits to the same file, each retry burning more output tokens
A bright-but-untouched cluster of files on the map is a literal picture of tokens you paid for and did not use.
The Token Math of Over-Reading
Suppose an agent on a $5/M input model reads 40 files averaging 400 lines (~5K tokens each) to make a change that actually only needed 3 of them. That is 200K input tokens ingested, ~185K of them irrelevant. At $5/M, you paid roughly $0.93 in wasted input on a single task — and because that bloated context is resent on every subsequent turn, the waste multiplies across the conversation.
Multiply by hundreds of daily agent runs and over-reading becomes one of the largest silent line items in an AI coding budget. You cannot fix what you cannot see; a session map turns the invisible into an obvious hotspot.
Turning Insight Into Savings
Once replay reveals the pattern, the fixes are concrete:
- Scope context better — if the agent wandered, your prompt or file-attachment strategy was too vague; point it at the right directory
- Tune retrieval — if it over-read, tighten the file-search or RAG step so it pulls fewer, more relevant files
- Manage context resets — if it re-read, adjust when you reset versus continue a session to avoid re-ingesting the same code
- Catch thrashing early — high error-rate signals tell you to intervene or switch models before retries pile up
The Broader Point: Observability Is Cost Control
Mindwalk is one of a growing class of agent-observability tools, and the trend matters for anyone managing spend. As agents get more autonomous, their token usage becomes harder to reason about from a bill alone. The teams that keep costs under control are the ones instrumenting why tokens are spent — file access patterns, retry rates, context growth — not just how many. Local, privacy-preserving tooling like a single Go binary lowers the barrier to adopting that discipline.
The Takeaway
A 3D session replay is more than eye candy — it is a debugging tool for your token budget. Over-reading, re-reading, and thrashing are expensive and invisible until you visualize them. Pair session-level observability with task-level cost modeling to find and eliminate waste. Estimate what a given workflow should cost with our AI coding cost calculator, then use replay to see where reality diverges.
Want to calculate exact costs for your project?
Frequently Asked Questions
What is Mindwalk?
Mindwalk is a visualization tool that replays Claude Code and Codex session logs on a 3D map of your codebase. Files the agent searched, read, and edited glow while untouched files stay dark. It runs as a single Go binary, processes data locally, and shows friction signals like error rates and file-modification volume.
How does visualizing an agent session help cut costs?
It makes token waste visible. Common expensive patterns — over-reading files that never get edited, re-reading the same file across turns, wandering through unrelated code, and thrashing with repeated failed edits — show up clearly on the map, so you can target the specific behavior inflating your bill.
How expensive is agent over-reading?
If an agent reads 40 files (~5K tokens each) to make a change that needed only 3, it ingests ~200K input tokens with ~185K irrelevant. At $5/M input that's roughly $0.93 wasted on one task, and it multiplies because bloated context is resent on every turn.
What fixes does session replay point toward?
Scope context better when the agent wanders, tune file search or RAG when it over-reads, manage context resets when it re-reads the same files, and intervene early when high error rates signal thrashing before retries accumulate cost.
Why is observability considered cost control for AI agents?
As agents become more autonomous, their token usage is hard to understand from a bill alone. Instrumenting why tokens are spent — file access patterns, retry rates, context growth — lets teams find and eliminate waste that a raw cost total hides.
Related Articles
How Many Tokens Does an AI Coding Agent Use Per Session? Real Data Breakdown
Real token consumption data for AI coding sessions. Learn how many tokens Claude Code, Cursor, and other agents use per session, why input tokens dominate, and how to predict costs before you start.
How to Count Tokens Before Sending: Tokenizer Tools, Prompt Sizing, and Cost Control for Coding Agents
Surprised by an AI bill? You probably sent more tokens than you thought. We compare tokenizer libraries for Claude, GPT, Gemini, and DeepSeek, and lay out a pre-send sizing workflow that prevents bill shock.
Qwen-AgentWorld Open-Sources 'Predict-Then-Act': How Environment Modeling Cuts Wasted Agent Tokens
Alibaba's Qwen-AgentWorld makes environment prediction a first-class training objective. We analyze how predict-then-act agents avoid the token waste of reactive trial-and-error.