all posts
2026-07-09 · 2 min read

Where your AI coding spend actually goes

ledgent reads the session logs your AI agent already writes and turns token spend into a number. Most of it is context upkeep, not output.

If you run an AI coding agent all day, you are spending money in a way you cannot really see. The tokens go by in a stream, the bill shows up later, and the link between the two is hard to feel. ledgent closes that gap. It reads the session logs Claude Code already writes to your disk and turns them into a plain cost report. No API calls, no network, nothing leaves your machine.

The number it surfaces is usually not the one people expect. On real workloads, most of the spend is not the model writing code for you. It is context upkeep: re-reading and re-writing cached context, turn after turn. On one 30-day sample that came out to 89% of the total, split between cache reads and cache writes, with actual generated output down at 9%.

That is worth sitting with for a second. You are mostly paying to carry the conversation forward, not to think. Once you can see it, some habits change on their own. A long-lived session dragging a huge context gets expensive in a way a fresh, tighter session simply does not.

Mechanically, ledgent prices every billable event across five buckets at the published per-model rates: fresh input, cache read at a tenth of that, cache writes at the 5-minute and 1-hour tiers, and output. The buckets reconcile to the total, so the report is an accounting of the whole bill and not a sample of it. From there it works out the context-upkeep percentage, a ranking by model and by project, and a run-rate forecast.

There is one caveat, which ledgent prints itself. The dollar figures are API-equivalent. If you run agents on a subscription, you did not literally pay those amounts. The number is what the same work would cost a la carte, which is the fair way to compare one session against another.

It is a single command. npx @nexalix/ledgent report gives you the full picture, or report --brief for five lines you can screenshot. It reads your logs, prints the report, and exits. The only command that ever touches the network is the optional self-update, and only when you ask for it.

Published 2026-07-09