ClaudeMods
☰
EN
● 0 online · Views 0 times
SponsorsSubmit a project
GitHub repositories · by mrzzmrzz

omni-token

A Claude Code plugin that shows a live context-window forecast, tok/s, prompt-cache hit rate and TTL in the band above the prompt, with optional cache auto-warm and /omni-token controls.

mrzzmrzz@mrzzmrzz

mrzzmrzz/claude-code-mods/tree/main/plugins/omni-token

Translated

About this mod

omni-token is a Claude Code plugin from the claude-code-mods marketplace that renders a live forecast of your context window in the band above the prompt, updated after every turn. The display shows a weather-style fill indicator (Clear to Compact soon), absolute and percentage context usage, a 12-turn sparkline, last-turn output tokens per second, prompt-cache hit rate, and a countdown to prompt-cache expiry that turns yellow under 5 minutes and reads expired after. Install via /plugin marketplace add mrzzmrzz/claude-code-mods and /plugin install omni-token@claude-code-mods. Options include cacheTtl (5m or 1h), autoWarm, and warmHours. With auto-warm on, an idle session sends one tiny forked request shortly before the cache expires to restart the TTL, never entering the transcript, and stops after warmHours or if the cache is already cold. The /omni-token command reports status and can turn warming off, on, or reset per session.

Installation

Check the author's README for the marketplace and plugin name first. Commands may change as the repository evolves.

claude plugin marketplace add mrzzmrzz/claude-code-mods
claude plugin install omni-token
Original text / README

claude-code-mods

Mods for Claude Code, packaged as a plugin marketplace.

Install

In Claude Code:

/plugin marketplace add mrzzmrzz/claude-code-mods
/plugin install omni-token@claude-code-mods

Mods

omni-token

A live forecast of your context window, shown in the band above the prompt and updated after every turn:

Cloudy  67% 134.4k / 200k  ▂▃▄▅▆█  ▲ +98.3k last turn  95 tok/s  cache 96% 58:12

| Fill | Forecast (color) | | --- | --- | | < 25% | Clear (yellow) | | 25–49% | Cloudy (cyan) | | 50–74% | Showers (blue) | | 75–89% | Storm (magenta) | | ≥ 90% | Compact soon (red) |

  • The sparkline covers the last 12 turns, scaled to the highest of them.
  • tok/s is the last turn's output tokens (thinking included) over the time from each request's start to its response's end.
  • cache 96% is the last turn's prompt-cache hit rate: cache reads over all input tokens.
  • 58:12 counts down to when the prompt cache expires: the last main-loop request's start plus the cache TTL. It turns yellow under 5 minutes and reads expired after.

Options

| Option | Values | Default | | --- | --- | --- | | cacheTtl | 5m, 1h | 1h | | autoWarm | true, false | false | | warmHours | hours | 24 |

Auto-warm

With autoWarm on, while the session is idle the mod sends one tiny forked request over the main thread's own prefix shortly before the cache expires (3 minutes before on 1h, 1 minute on 5m). The cache read restarts the TTL, so the next real message reads the cache instead of rewriting the whole context. The fork never enters the transcript.

  • Each warm bills a cache read of the whole context (on Claude Opus 5.5, context × $0.20/MTok) plus a few hundred output tokens.
  • It stops warmHours after the last turn started, and never warms an expired cache (that would pay the full write it exists to avoid) or a context under 50k tokens.
  • warmed 3x shows how many warms ran since the last turn; warm missed means a warm found the cache already cold, and warming stops until the next turn.

/omni-token

| Command | Effect | | --- | --- | | /omni-token | Status: auto-warm on or off and why, cache TTL and time left, warms since the last turn, option names | | /omni-token warm off | Stop auto-warming in this session, at once; other sessions and the autoWarm option are unchanged | | /omni-token warm on | Auto-warm this session even with autoWarm off | | /omni-token warm reset | Follow the autoWarm option again |

On a 1-hour TTL, keeping a cache warm costs 0.2/7.8 of a cold restart per hour, so it pays off for gaps under about 39 hours, if you come back.

The API's usage figures don't say which TTL a session runs on, so set it to match yours: 1h on most Claude subscriptions, 5m on the API default or in usage overage.

Developing

Load a mod straight from this checkout, with hot reload on save:

claude --plugin-dir ./plugins/omni-token

Check one before committing:

claude plugin validate ./plugins/omni-token
claude plugin test ./plugins/omni-token

Similar projects