Concept · Cost · 4 min read

Token awareness

Token cost in agent systems is dominated not by answers but by everything resent around them: history, scaffolding, tool output. Treating that as a mechanism problem — not a "use a cheaper model" problem — is where the real savings are.

Where tokens actually go

Every turn resends the conversation so far. Every tool result lands in context and is resent forever after. Injected scaffolding is re-paid every round on runtimes without stable prefix caches. Multiply by scheduled runs replaying their own history and the bill has little to do with the questions you asked.

Kaptain's mechanisms

Context prepared up front — KodeGraph hands the model the relevant code instead of letting it grep around: the published benchmark measures the difference at equal recall. Delegation moves mechanical output tokens onto local hardware, with batch results written to disk instead of into context. Compaction folds old history into a summary the moment a conversation outgrows its window — visibly, with the summary inspectable. Fresh-by-default scheduled runs refuse the replay tax entirely. Lean scaffolding for small windows, because a runtime that re-prefills pays for every injected line, every round.

Small windows are real

A 4B model with an 8k window running tools is one failed round from a full context — at which point Kaptain says so and wraps up honestly rather than hallucinating a finish. Give small models bigger windows where the hardware allows; the ⚙ context-window control shows the runtime's real default and maximum.

You can see the bill

BlackBox ▸ Model usage shows exact provider-reported tokens — per run, daily, monthly, per route. Cost control starts with a bill you can actually read: BlackBox.

Agent-readable version: index.md