v0.1.2 is on PyPI

Send less.
Lose nothing.

One local proxy in front of every AI coding tool on your machine. It shrinks each request without losing a byte, keeps the prompt cache intact, and can send a turn to the model that turn actually needs.

$pip install tokunseba

Works anywhere Python does. Installs into whichever environment is active.

Python 3.12 to 3.14 · macOS, Linux and Windows · MIT licensed

It runs on your machine

No account, no sign in, no telemetry. The only outbound traffic is the request your tool was already making, to the provider it already chose.

It does not lose anything

Every removal is content addressed and stored locally. Expand a handle and the original comes back byte for byte, failures and stack traces still in it.

It measures itself

Sessions are split at random into a control arm and a treatment arm, both in the same ledger, so you can check the claim against your own traffic.

What it removes

Almost none of your context is your thinking

An agent reads a file, runs the tests, lists a directory, reads the file again, and carries the whole transcript forward on every call. The question you typed is a few hundred tokens. What surrounds it is tens of thousands, and most of that is text the model has already seen or never needed.
tokunseba top
where the tokens went          was     now
outline:python               23k    3.1k
summary:pytest             11.7k      55
dedup_ref                  11.7k      38
junk:lockfile              8.4k      31

what could not be helped
passthrough  6.6k  a first read of a short file
passthrough  4.9k  prose the model has to see

Each of those is a different kind of waste and each gets a different answer. The table below is the whole list, and every row leaves a handle behind.

How the pipeline decides
Arrives asGoes out asRecorded
A file read twiceThe second copy becomes a pointer to the firstdedup_ref
A file read again after an editOnly the diff since the model last saw itdiff_ref
A long source fileImports, signatures, decorators and docstrings kept; bodies foldedoutline
A test or build runWhat failed, the assertion text and the countssummary
A lock file or a bundleOne line describing what it wasjunk
Terminal escapes and progress barsRemoved losslessly, nothing else touchedcanonical

Four ways in

Use it whichever way fits what you already run

The same pipeline behind every one of them, writing to the same ledger and the same handle store.

Every tool at once

Point everything at it and carry on

One command finds the AI tools on this machine, backs up every file it touches, points them at the proxy and starts it in the background. It prints each change before making it, and one command puts it all back.

setup
$ tokunseba init

  claude-code   ANTHROPIC_BASE_URL -> 127.0.0.1:7777
  codex         model_provider = "tokunseba"
  shell-env     env block added to ~/.zshrc
  backups       ~/.tokunseba/backups

  proxy running on 127.0.0.1:7777

$ tokunseba doctor
  ok  proxy reachable
  ok  tool: claude-code
  ok  tool: codex

Routing

The right model for the turn, across protocols

Claude Code speaks Anthropic to everything. Codex speaks OpenAI. That is why “send the easy turns to the local model” is usually a slide rather than a feature: the client cannot address the other endpoint and the other endpoint cannot read the client.
routing across protocols
$ tokunseba models add deepseek https://api.deepseek.com
$ tokunseba route add --domain devops \
        --to ollama --model qwen3-coder:30b
$ tokunseba route enable

$ tokunseba route test "bump the docker base image"

  domain      devops      confidence 0.88
  difficulty  trivial     confidence 0.45  discarded
  sensitive   no
  would go to ollama / qwen3-coder:30b
  arrives as anthropic, translated on the way out
  and translated back on the way home
  nothing was sent.

tokunseba rewrites the turn instead. System prompts, tool definitions, tool calls and their results, images, stop reasons and usage are all mapped, and a streamed reply is rebuilt event by event rather than buffered.

How routing decides

What it costs you

Nothing is free, including this

Every one of these is a real trade, measured where it can be measured. If a page about a tool only lists what it gives you, it is an advertisement.

Latency, in single milliseconds

Measured on this pipeline: 0.6 ms at the median for a turn carrying one file read and one test run, 3.1 ms for a ten-turn transcript of 339 KB. It is not zero, and against a provider round trip of one to four seconds it is not something you will feel.

Reach, at tier 2

A summarised log and an outlined file are one call away rather than already in the context. If the answer depended on line 4,000, the assistant has to ask for it. That is a real cost and it is why tier 2 has its own switch.

Your code, on your disk

The originals behind handles live in ~/.tokunseba/blobs, and stored request bodies include your prompts. They never leave the machine, but they are on it. Both have retention windows and both can be shortened or turned off.

Memory and disk

Measured on a clean install: 75 MB on disk with its dependencies, 14 MB resident while idle, 43 MB once the tokenizer has loaded. The optional local judge is a separate opt-in on top of that: 808 MB of weights and about 2.2 GB of memory while loaded, downloaded only when you ask for it by name.

An upgrade does not improve what it has already seen

The same original always produces the same replacement, forever, because a prompt cache matches on an exact byte prefix. New content gets new behaviour; history keeps what it had.

Some tools cannot be reached at all

Copilot, Cursor and Windsurf talk to their own backends over closed protocols. A proxy can only sit in front of a client whose protocol it can parse. tokunseba says so rather than listing them as coming soon.

And the honest headline: savings depend entirely on what you do. Long agentic sessions with heavy tool use are where the wins are. A short chat saves almost nothing, and no setting changes that. Which is why the control arm exists rather than a number on this page.

Point your tools at it and keep working

One command configures every supported tool, backs up every file it touches, and starts the proxy in the background. tokunseba off puts it all back.

$pip install tokunseba
$tokunseba init
Installation guide