An AI coding agent burns most of its context on tool output, not on your conversation. A single file read can dump hundreds of lines into the window; a directory listing, a test run, a log tail — each one eats context the model needs for reasoning. Context windows are finite and tokens are money: agents either forget earlier work or you pay for ever-larger windows.
| Metric | Result | Source |
|---|---|---|
| Measurement window | 17 days, real working sessions | our own runs |
| Projects covered | 18 | our own runs |
| Tokens eliminated | 10.75M | our own runs |
| Reduction on compressed output | 91% | our own runs |
| Share of savings from file reads | 97% | our own runs |
| Latency added per compression | sub-millisecond | our own runs |
Methodology and the live numbers are on the QTK project page, including the honest gap: external/Bash-only tools structurally cannot touch file reads, which is where 97% of the savings come from.
Same idea, two implementations: RTK (rtk-ai/rtk) wraps tools externally; QTK is native to opencode — a plugin that hooks the tool layer directly, so compression happens inside the agent's own tool pipeline. An honest measured comparison table (where each wins) is on the QTK page.
No and no. Compression is deterministic — pattern-based structure preservation, not summarisation. There is no model in the loop, nothing leaves your machine, and there is no prompt-injection surface because no model evaluates your code. That is also why it is fast: the compression overhead is below a millisecond.
Anyone running AI coding agents on real codebases daily — especially on metered APIs or small local context windows. Install from npm: @qalarc/qtk-plugin. Source and releases: github.com/qalarc/QTK.