Tokens Not Included: Overlays
With several agents running, where is the spend going, and which agent is burning the most tokens? Tokens Not Included, my colony viewer for Claude Code agents, only showed what was happening right now. I had to be watching to catch the agents doing something, and it didn’t show tokens or spend. I’ve added overlays to see that data at a glance.
These are ideas I’m exploring, borrowing from Oxygen Not Included’s overlays, which let you inspect characteristics like temperature and power in the colony. TNI reads Claude Code’s session logs to show token heat, spend as power, run time and git activity. The small colony below makes it easier to follow the changes as I switch layers.
Token heat
Which agents and machines are using the most tokens right now? Token heat shows how many new tokens each agent and each machine used per minute, averaged over the last 15 minutes. A machine represents a file or command the agents work at. As token use rises, the glow goes from dim red to bright red, then toward a white-hot core.
The count includes input tokens, output tokens and tokens written to the cache. Input is everything the agent sends the model: my message, the files it read, the output of its commands. Output is what the model writes back. Cache writes are context the model stores so the next call can reuse it. Reading that cache back isn’t counted, since it reuses work the model already did.
Claude Code saves every reply from the model in a session log on my machine, and each reply comes with its token counts. Trimmed down, one looks like this:
"usage": {
"input_tokens": 2,
"output_tokens": 556,
"cache_creation_input_tokens": 52193,
"cache_read_input_tokens": 20520
}
TNI adds up the first three and skips the cache reads. Each session log belongs to one agent, so that agent glows with those tokens. A single reply can also use more than one machine, like reading server.py and then running pytest, so TNI splits its tokens evenly between the server.py machine and the pytest machine. A reply with no tool call, like an answer to me, counts toward the agent’s next call.
The color scale starts at 40 tokens a minute, with its top set at 61,500 tokens a minute from my hottest agent from last week. The color eases toward it. The scale is logarithmic, so the colors spread out the lower rates and compress the higher ones. That lets smaller differences stay visible alongside the hottest agents.
In the clip below, Sirius climbs from 11.6k to 14.9k tokens a minute, so it glows bright red but not white-hot. The machines it works at glow with it, since its tokens count toward them too.
I toggle the overlays often, and this is the one I’ve been using most. With it on, I can spot an agent running hot even when it isn’t one I’m working with, and check on it right away instead of finding out later.
Spend as power
Where is the money going? The power overlay shows how much each machine draws in dollars per hour at API prices. Each floor is a repository, with a cable whose color follows how much spend passes through each part of it. A socket is where a machine plugs into its floor’s cable.
TNI prices every token the model is billed for, including cache reads, then splits each reply’s cost evenly across the machines its tool calls used, the same way heat splits tokens. A reply with no tool call, like an answer to me, gets charged to the agent’s next call. That’s usually where the agent acts on what it just said or thought, so the cost lands on the machine the work was for.
For each machine, TNI adds up the cost over the last 15 minutes and shows it as an hourly rate. A machine turns yellow from $0.91 an hour and red from $4.23. In the clip below, the socket under server.py is red, and its card climbs from $6.83 to $8.38 an hour, so that file is where the money is going right now.
Hovering over a socket shows the hourly rate, the number of calls in that window and the average cost per call. It also shows each agent’s share of the cost and a small chart of the last hour, so I can see which file is costing the most and which agent is behind it.
Run time
Where are the agents spending their time? The run-time overlay puts a ring on each machine showing the aggregated run time over the last seven days. The number in the center is the total, and a larger ring means more time spent there. Each colored slice shows how much of that total time was spent on slow runs versus fast runs.
TNI adds up how long each finished call took. It groups the runs into five bands: under a second, one to ten seconds, ten seconds to a minute, one to ten minutes, and ten minutes or longer. The colors move from green for the shortest runs to red for the longest. Calls that just wait, like an agent waiting for my next message, or that launch another agent are left out.
In the clip below, uv has a big red ring: about 0.2 hours this week, mostly from long runs. Compare it to a source file the agents read and edit, whose small green ring adds up to under a minute of quick calls.
I can look across the colony and see how much time went into a given script. It makes sense for agents to spend a lot of time running scripts through python, npx and similar commands. I’m looking for a command that doesn’t make sense to run for so long.
Git
How often do commits land, and how much changes? The git overlay shows the last eight hours of commit activity on each repository’s floor. Green bars extend up for lines added, and red bars extend down for lines removed.
TNI reads the repository’s git history across all branches and groups commits into five-minute slots. It counts commits and sums the lines added and removed per slot.
Bigger changes make taller bars, but the bars grow more slowly than the line count, so one huge commit doesn’t drown out the small ones. Every floor uses the same scale, so I can compare repositories.
In the clip below, each repository’s floor scrolls its own timeline of green and red bars, so I can see which repositories had commits in the last few hours and how big they were.
I look at how often commits are landing and compare how many lines we’re changing across repositories.
What comes next
I’m still working on how to open source TNI. In the meantime, I’m sharing these overlays to get feedback and more ideas, so if there’s something you’d want to see about your own agents, let me know.
I’m also exploring a way of understanding an agent’s history by drawing each agent as a spacetime worm. Now that we can see agents move physically through space and time, I believe there must be a way of tracing an agent’s behavior using this technique, but I haven’t yet been able to make it look as nice as that video. If I figure it out, I’ll show it in a later post.