Token Quotient

Token Quotient

Know what an AI job costs before it starts.

Today an AI job works like a mechanic who fixes your car without telling you the price: you find out at the till. With a subscription the till is the usage limit, and one big job can use up a whole week. Quotient is a plugin for Claude Code that gives you the price first, lets you choose, measures what the job really cost, and learns from the difference.

MIT licensed · version 1.3.7 · needs Python 3.8 or newer

A short film in five scenes. 1, you ask: a big job, the next version, and Claude does not start before the price. 2, the quote: three levels, essential, good and max, each with its total, time and share of the 5-hour and weekly limits, and what would be left after it. 3, you choose: the level max and the pace apart, now, so it starts at once in a separate session with its cap and expected time. 4, inside its cap: a real job of this size, cap 1,364,792, spent 768,134, working up to its cap and no further. 5, the report: the estimate of the work against the real cost, split into work and chat part.
Three phases: the quote and your choice, the nightly installments, the bill with what is left of your limits. Estimates are not guaranteed: at the start they can be quite far off, and they get closer with each finished job.

The price first, the bill after

Quotient does not make the model better at guessing: it measures the miss and corrects the next guess. And it plans big jobs around the limits you actually have.

Before the job

A quote, in a choice window

Above the threshold you set, or when you call it a big job, Claude does not start. A window offers essential, good or max: what each includes, its estimate and, once Quotient knows your limits, the share of them it would take. The pace is yours too: all today, a few days, or your own.

An example quote. 5-hour and Week: the share of each limit a level would take.
LevelIncludesEstimate5-hourWeek
essentialasync client, old tests pass60k5%1%
good (chosen)+ new tests, docs updated150k12%3%
max+ edge cases, full review300k24%6%
After the job

The real cost after

Read from Claude Code's own records and set next to the estimate. Each new quote is corrected by how far off the earlier ones were; it learns from the jobs you did not add to halfway, and until you have five of them it starts from x0.58, what 49 measured test jobs really cost against their quotes.

Actual: 142k tokens (est. 150k)
factor updated
While it works

How long, too

Each level of a quote also says how long the job should take, learned from your own finished jobs. The time is read from what Claude Code and Hermes already record, your turns left out; after the first million tokens the job's own pace re-estimates what is left, and at the end the real time is set next to the expected one.

08:40 of about 9 min expected
time learned
While you are away

Installments, one a day

A job too big for one go is split into daily pieces. At the time you choose, the PC wakes up, Claude Code does the day's piece, and the PC goes back to sleep; a notification tells you what it did. Waking is for Windows; macOS and Linux get the line to schedule it.

PACE: days=4
Next installment: 03:00
All week

Your limits at a glance

How much of the 5-hour and weekly limits you have used, and what is left, in percent and in tokens, right in Claude Code's status line. Several jobs together never eat the share of the week you keep for yourself.

5-hour: 31% used, 69% left (~22M of ~32M wt)
week: 70% used, 30% left (~87M of ~287M wt)

Install

Two commands, typed in Claude Code.

In Claude Code:

/plugin marketplace add Korvonordico/quotient-claude-tokens
/plugin install token-quotient@token-quotient
/token-quotient:setup
set Quotient up, or change its settings
/token-quotient:report
estimates against real costs, your limits, the weeks (add page for charts)
/token-quotient:rate <job>
split a big job into installments
/token-quotient:share
exactly what is shared, and turning it on or off
/token-quotient:help
every command, with what it does
  • Needs Python 3.8 or newer and sh. On Windows, sh comes with Git for Windows, which Claude Code already uses.
  • The first time, a window asks four settings: from what size a job gets a quote, how much of the week to keep for yourself, the language, and whether Quotient may wake the PC for installments and put it back to sleep.
  • Change them any time with /token-quotient:setup.
  • In OpenAI Codex (experimental): codex plugin marketplace add Korvonordico/quotient-claude-tokens in a terminal, then /plugins in Codex. All the steps.

Made for Claude Code

Token Quotient (Quotient for short) is a Claude Code plugin, and since 1.3.7 an experimental OpenAI Codex plugin too. It does not replace anything; it adds a step before a big job and a measurement after it.

In Claude Code

Hooks run its Python script at the start of a session, at each message and at the end of each reply. It reads Claude Code's transcripts for numbers: token counts, the machine lines Claude writes, and which tools were called; in a reply that gives a quote, also what Claude wrote and the choice window, only to check the quote. Installments run Claude Code itself, in the background, in the job's folder.

Hermes Agent too

If you use Hermes Agent with your Claude login, its chats spend the same 5-hour and weekly limits. Quotient reads Hermes' token counters (read-only: numbers, model and chat title; in a reply that gives a quote, also what Hermes wrote, only to check the quote; never your messages) and, with two shell hooks, quotes and measures jobs there as well.

How to add the hooks

OpenAI Codex too (experimental)

Since 1.3.7 Quotient is also a plugin for OpenAI Codex: quotes, the real cost of each job, and installments that Codex runs itself, stopped at their cap. It reads Codex's own session log for the same numbers it reads in Claude Code, and keeps Codex's figures apart from Claude Code's. It is new: tested with a stand-in for Codex and on sample logs, not yet in a long real use, and it weighs tokens with Claude's price ratios, so its numbers are a rougher estimate there.

How to install it in Codex

What leaves your computer

Everything Quotient records stays on your computer, in ~/.quotient. After each finished job it sends one line of numbers for the shared average, so new users start from real jobs instead of from zero. Exactly this line, and nothing else:

{"v":1,"q":"1.3.7","family":"opus","estimate":225000,"actual":259000,"plan":"max5","per_point":3220000,"per_point_5h":322000}

The plan only if you chose it; per_point and per_point_5h (how many weighted tokens 1% of your week and 1% of your 5 hours hold) only once Quotient has learned them from your own readings. No dates, no names, no text, no paths, no session or user ids. Turn it off with /token-quotient:share off; you still get the shared average.

Read the full privacy note (PRIVACY.md)

  • Writes in ~/.quotient and, for installments, a report page in the job's folder. Claude Code's settings only when you choose the status line, auto-compaction or Claude Code's telemetry (whose receiver listens on this computer only).
  • Sends one line of numbers per finished job, unless sharing is off.
  • Fetches the shared average once a day, from GitHub (or from the author's service when GitHub does not answer).
  • Schedules Windows tasks for installments only after you choose them in the window.