Usage Insights: tokens from all my machines in one Herdr dashboard

My fork of a Herdr token dashboard adds the other machines where my agents run, with a collector for Linux hosts without Herdr App. How it works, what it costs and how to install it.

AI-assisted translation, approved by Mateo.

Real capture of the Insights dashboard in a Herdr App window: lifetime tokens, history by machine and a daily heatmap; the figures come from invented sessions, not my usage.

In this post I bring you Usage Insights, a Herdr dashboard that shows how many tokens our coding agents use, by model and by day. It is my fork of a mod that already existed, and I added what I needed: seeing the other machines where my agents run too.

Usage Insights dashboard on All time: lifetime tokens, peak day, longest task, streaks, history by machine and a daily heatmap; a real Herdr App capture with demo data.Enlarge image
The dashboard on All time: totals, streaks, history and heatmap, over 341 invented sessions. Lab capture.

What is Usage Insights?

It is a native Herdr mod. It reads local Claude Code, Codex, Pi, OpenCode and Antigravity sessions, and builds totals, a ranking by model, a usage chart and a heatmap. It keeps usage metadata only, never prompt text, and uploads nothing.

The base is Insights: I forked Gagan Devagiri's herdr-insights (MIT), by way of harshcurious's fork. I added three main things:

  • a "Fleet usage" card with one row for each machine connected to Herdr;
  • a headless installer for Linux hosts without Herdr App;
  • a quota bar based on Anton Nozikov's herdr-usage-limits.
Model usage section on All: a stacked weekly chart of seven models, period, provider and model filters, and a ranking with each model's provider; a real capture with demo data.Enlarge image
Usage by model: stacked chart, period, provider and model filters, and a ranking. Invented sessions. Lab capture.

Why I built it

I work with Herdr on the Mac, and some of my agents run on a Linux machine I reach over SSH from the same window. The catch is that the collector reads local session files. In other words, the dashboard only saw what happened on the Mac.

I wanted to see, from that one window, how many tokens each machine used. That is why I made a fork and not a separate tool: I reuse its analytics and keep the diff additive so I can keep merging upstream.

Illustration: the Mac with Herdr App and its sessions, and a Linux machine over SSH with its own. A teal arrow takes the Mac's sessions to the dashboard. The dashed amber arrow from Linux ends in a cross: it never gets there.Enlarge image
Before the fork: the Mac's dashboard reads its own sessions; the Linux ones never reach it. Illustration.

What it looks like

The dashboard captures use 341 demo sessions, not my real usage. The machine selector shows All, This Computer and each machine connected to Herdr, and the token history follows that selection.

The "Fleet usage" card shows the fleet total and one row per machine, with its tokens for the period and how fresh its data is. A machine that cannot be read shows up with the reason and stays out of the total: it never counts as zero (README).

On a host without Herdr App, install-headless.sh --check reports what it found, what it would install and what is missing, and verifies the systemd units without changing anything.

Terminal with the output of bash scripts/install-headless.sh --check in a throwaway HOME: it finds Claude Code, Codex and Pi session folders, lists the files it would install, verifies the systemd units and ends in a dry run; a real capture, excerpted.Enlarge image
Real output of the check in a throwaway HOME: it finds session folders, verifies the units and changes nothing. Excerpt. Lab capture.

How it works

Each machine collects its own data where its sessions live. The Mac's dashboard reads the Linux summary over Herdr, with the exec the mod already uses, writing nothing there.

Illustration: on the Mac with Herdr App, the collector reads the sessions; on the headless Linux machine, a collector with a timer reads its own. The Mac's dashboard reads a summary from each; the Linux one over Herdr.Enlarge image
Each machine collects its own data, and the Mac's dashboard reads a summary from each one. Illustration.
PieceWhat it is forWhy this oneAt the cost of
Mod's collectorreads the sessions with Herdr Appsession files are localmeasures only its machine
Collector + timercollects every 5 minutesuses the host's systemdLinux with systemd only
Summarywhat the dashboard readstens of KB, not the storeas fresh as the last pass
Analytics in Nodetotals with the same filtersthe local dashboard's analytics.jsNode.js 22.15 or newer
Quota bareach provider's limitsasks with that machine's sign-inon another machine, an enrolled helper

Numbers

On the 341 demo sessions, turning the "Include cache tokens" switch off drops the all-time total from 162M to 13.7M. In other words, cache tokens are over 90% of the count. The peak day changes too: it moves from November 16 to May 18.

NOTE: the dashboard counts tokens, not money. To know what we spend, it is best to check each provider's usage page.

Bar chart of all-time tokens on 341 invented sessions: with cache tokens, 162M and a peak day on November 16; without cache tokens, 13.7M and a peak day on May 18. Below, the Include cache tokens switch.Enlarge image
Without cache tokens, the total drops from 162M to 13.7M, on 341 demo sessions. Illustration.

Pros and cons

What we gain

  • One window with the usage of every connected machine.
  • To measure tokens it asks no provider for anything, and it uploads nothing.
  • A machine that cannot be read shows the reason; it never counts as zero.
  • The same period, provider and cache filters for all of them.

What it costs

  • One collector per machine, and the headless one only runs on Linux with systemd.
  • The installer needs Herdr App open, and Settings applies changes only after "Save configuration".

When it does not fit: with a single machine, the original Insights is enough. And if what you want is dollar spend, each provider's usage page fits better.

How to install it

We need Node.js 22.15 or newer and Herdr App open. IMPORTANT: the README still clones harshcurious's repo, so we clone this fork and run the installer from the copy:

git clone https://github.com/mdiloreto/usage-insights.git

cd usage-insights and then npm run install:local

On a Linux host without Herdr App, we first run bash scripts/install-headless.sh --check, which only reports, and then bash scripts/install-headless.sh --install --enable. The quota bar is a separate mod that npm run install:local does not install; the steps are in the README.

Herdr App terminal running npm run install:local: check passed, herdr-app check passed (insights, staged source) and Installed 38 owned file(s); a real capture in a demo home folder.Enlarge image
The installer on its second run in the demo home folder: 38 files unchanged. Lab capture.

Done! The dashboard is now in Herdr :)

In conclusion, if your agents run on more than one machine, Usage Insights shows you the count for all of them in one Herdr window, without uploading anything.

I hope you find it useful! Cheers :)

Thanks for reading. The learning continues in the next article.