Skip to content
Docs

Output shortening: Lossless, Recoverable and Unchanged

TokenNibbler shortens long, routine tool output, such as test runs, search results and file lists, before Claude Code or Codex reads it, so your agent’s context holds the work instead of the noise. Every result is Lossless, Recoverable or Unchanged, and shortening is part of every plan, Free included.

On this site we describe results as Lossless, Recoverable or Unchanged. In the app, the Activity page labels each result Shortened, Kept as is or Observed.

On this siteIn the appWhat it means
LosslessShortenedThe output is regrouped so it takes less space, and every match, path and line count is still there. TokenNibbler checks that the grouping expands back to the original exactly before using it.
RecoverableShortenedSome routine detail is left out of what the model sees, such as the names of passing tests. The full original is saved on your computer and the agent is told where to read it.
UnchangedKept as isThe output reaches the agent exactly as the tool printed it.
Unchanged (measured)ObservedWith Observe only on, output passes through unchanged and TokenNibbler measures what it could have shortened.

Every Shortened result, Lossless or Recoverable, keeps its exact original on your computer.

Search results, grouped by file

The same lines, with each file path written once. Expands back exactly.

Before · est.~133 tokensAfter · est.~113 tokens
Originalkept on your computer
src/api/orders.ts:118: const refund = await createRefund(order)
src/api/orders.ts:204: export async function createRefund(order: Order) {
src/api/orders.ts:251: logRefund(refund)
src/api/orders.ts:262: return refund
src/api/orders.ts:300: // refunds are idempotent per order
tests/api/refund.test.ts:12: const refund = await createRefund(order)
tests/api/refund.test.ts:31: expect(refund.status).toBe("ok")
tests/api/refund.test.ts:44: expect(logRefund).toHaveBeenCalled()
tests/api/refund.test.ts:58: // refund twice, same result
What the model sawLossless
[TokenNibbler file: src/api/orders.ts (5 matches)]
118: const refund = await createRefund(order)
204: export async function createRefund(order: Order) {
251: logRefund(refund)
262: return refund
300: // refunds are idempotent per order
[TokenNibbler file: tests/api/refund.test.ts (4 matches)]
12: const refund = await createRefund(order)
31: expect(refund.status).toBe("ok")
44: expect(logRefund).toHaveBeenCalled()
58: // refund twice, same result

Example data. Choose each kind to compare the original with what the model saw.

Choose how far shortening goes in Settings › Optimiser › Compression mode.

Conservative keeps every result Lossless:

  • Removes terminal colour codes.
  • In search results (file:line:content), groups repeated file paths under one heading, keeping every match, its line and its content, in order.
  • Groups file listings (git ls-files, rg --files, find) by folder, keeping every path.
  • Folds a long run of identical test or progress lines into one line and states how many more there were.
  • Writes MCP records as compact tables, with nothing removed.

Balanced (the default) does everything Conservative does and adds Recoverable shortening:

  • Folds runs of eight or more successful test lines, keeping the first, the last and the exact count. It recognises jest, vitest, mocha, TAP, cargo test, go test -v, pytest -v and dotnet test.
  • In MCP results, trims web-page metadata, images and tracking links, and folds a repeated result.

Balanced is the default from version 1.0.2. If you were on Conservative before 1.0.2, the update moves you to Balanced. From 1.0.2 on, a mode you choose in Settings stays as you set it.

Observe only is a separate switch in the same tab. It measures potential reductions while passing every result through unchanged, and saves no original output.

MCP tool results are shortened in Claude Code, with their own switch: MCP tool results (Claude Code).

TokenNibbler only shortens output from simple, recognised build, test, lint, type-check, search and listing commands, such as npm test, pytest, cargo test, rg, git grep, Select-String and Get-ChildItem -Name. Claude Code’s Grep and Glob results count as searches and listings. A leading cd <folder> && or cd <folder>; (also Set-Location) and a trailing 2>&1 are fine.

Everything else reaches the agent exactly as printed:

  • Failed commands, and anything written to standard error.
  • Output with errors, warnings, failures or similar diagnostics (search results and file lists are only regrouped, so they still qualify).
  • All Git status, log, diff, show and branch output.
  • Pipes (except a final | head, | tail or | Select-Object -First/-Last after a search or file listing), redirects other than a trailing 2>&1, other compound commands, and unrecognised commands.
  • Source files read in full, images, and interrupted or background results.
  • Short output (under 1,200 characters) and very large output (over 2 MB).
  • Any result where shortening saves under 300 characters, or, with the recovery note added, under 100 characters or 5%.
  • Projects outside your project scope, and everything while the optimiser is paused.

For MCP results, images, errors and results Claude Code saved to a file are left as they are.

Where originals are kept, and the note the agent sees

Section titled “Where originals are kept, and the note the agent sees”

Before TokenNibbler returns a shortened result, it saves the exact original in the originals folder of its data folder. If the original cannot be saved, the agent gets the original output instead.

The shortened result starts with a note that tells the agent where the full original is:

[TokenNibbler: output shortened. Full original: <path>. Use Read to recover omitted detail. Local retention: up to 7 days, subject to storage limit.]

Claude Code reads the file with its Read tool. For Codex, the note says “Read that file to recover omitted detail”.

To see exactly what happened to a result, open Activity and select View on its row. The viewer has four tabs: Changes, Side by side, Original and What the model saw. Open in editor opens the saved original.

Choose both limits in Settings › Data:

  • Keep original output: 1, 3, 7 (the default) or 14 days.
  • Original output storage limit: 25, 50, 100 (the default) or 250 MB. When it is reached, the oldest originals go first.

The overall Storage limit in the same tab (500 MB by default) covers everything TokenNibbler keeps. When it is reached, the oldest saved output goes first, and originals saved in the last hour always stay.

Once an original is removed, its recovery path no longer opens, so choose a longer period if you often return to long sessions. Originals are kept as local files in TokenNibbler’s data folder on this computer and hold whatever the command printed. To open the folder, use Settings › Data › Local files › Open folder.