clemvault internals alpha

Token Thrift

Measured 111 agent sessions to find where the tokens actually went, then built the layer the data justified instead of the one that was fashionable.

Claude CodePythonOllama

Every “cut your AI token bill” tool I looked at compresses command output. So I nearly built one. Then I measured my own 111 sessions first, and the addressable slice came back at 2.8%.

What It Is

A skill inside my command center that governs what each operation costs. Three parts: a discipline layer that costs nothing, a compression benchmark that ships deliberately switched off, and a delegation lane pointed at a model running on my own machine.

What The Measurement Found

I streamed every session transcript and paired each tool call to its result.

SinkVolume
Reading files~1,694k tokens across 1,646 calls
Running commands~1,627k tokens across 7,579 calls
Everything else10% of the total

Reads and commands are 92% of the bill. That part was expected. The second finding was not.

Compression tools protect correctness by refusing to touch anything risky: no pipes, no chained commands, no redirects. Sensible rules. Applied to my transcripts they excluded 96% of my commands, because almost everything I run is compound. What remained was worth maybe 150 tokens a session against a 30,000 token bill.

So the compression engine ships as a benchmark, not a filter. Dry-run mode, a stats file, wired to nothing. If the numbers ever justify switching it on, that becomes a decision made with evidence.

What Actually Got Built

The Part I Kept

Four open-source projects informed this. I borrowed patterns from all four and installed none of them. One rewrites every shell command machine-wide. One routes code through a third-party model account. One wants four separate tool installs. One is a proxy sitting between the agent and the shell. Patterns are cheap to borrow. Dependencies are expensive to keep.

Stack

ToolRole
Claude CodeSkill, hooks, session wiring
Python 3.12Compression benchmark, 20 precision tests
Ollama (gemma3:4b)Local delegation target, nothing leaves the machine

Development timeline

1 logged update on 30 Jul 2026.

  1. Built (Phases 0, 1, 2 and 4)feature

    Token spend across ClemVault sessions had never been measured, only assumed. The available prior art all converges on one mechanism: intercept and compress command output.

Written from this project's decision log as work happened, not afterwards. See every project →