Skip to content

MyToken!!!!! 0.3.0

Choose a tag to compare

@github-actions github-actions released this 11 Oct 12:31
· 47 commits to main since this release

A cache ledger: which prompts should have hit the prompt cache, which didn't, why, and what that cost. Plus six more tools.

0.2.2 and later update themselves to this version (MyToken › Settings › Check for updates, or wait for the daily check).

The first launch upgrades your database once. Each request gets a few cache columns (about 5 bytes per request), then the ledger is computed over your whole history — a few seconds, up to ~10 s on a 200K-request history. The upgrade is one-way: an older MyToken can't open the database afterwards.

Cache ledger

  • New Cache page. For every request whose prompt should have been read back from the cache, MyToken checks whether it was. Misses get a reason:
    • Compacted — the conversation was summarised, so the prefix is new (compaction markers from Codex, Claude Code, DeepSeek Harness, Pi, OpenCode and WorkBuddy logs).
    • Expired — too long between turns (Anthropic 5 min / 1 h, OpenAI ~10 min, DeepSeek 1 h).
    • Model changed — caches don't carry across models.
    • No visible reason — same prefix, not expired, still missed. Often a relay that doesn't pass caching through, or routes you to another upstream.
  • It adds up the tokens sent again and what they cost (actual cost minus the cost had they hit), by day, by cause, by provider and by session. Each provider gets a cache health figure: unexplained misses as a share of what should have hit.
  • Cache timeline in each session: one bar per request, coloured by what was read, missed (and why) and new; compactions are marked.
  • mytoken cache in the terminal: totals by cause, --by provider|model|harness|project|session, or mytoken cache <session> for a request-by-request table. --json / --csv as usual.
  • It works for every tool from token counts alone — no prompts are read. Side requests and branch switches inside a session (Pi, DeepSeek Harness) are recognised and not counted as misses. Sessions whose tool reports no cache figures at all are shown as not cacheable and left out.
  • Read "no visible reason" with care: on the history it was tuned on it is 84% of missed tokens but only 1.8% of what should have hit. It tells you where to look, not that a relay is broken.

Six more tools

Amp, Kiro, Zed, Antigravity, Codebuff and Mux are read now. None of them has been checked against real logs yet — if the numbers look off, please open an issue.

Fixes

  • Pi's compaction requests are counted (their usage records failed to parse and were skipped).
  • OpenCode compactions are recognised, so the request after one isn't blamed on the relay.
  • Hit rates never exceed 100% when a request reads back more than its own earlier prompt (a prefix shared with another session).

Roadmap · How the cache ledger decides · Full Changelog: v0.2.3...v0.3.0