2026-06-18

How Poco compresses your prompts (without garbling them)

Coding agents are token-hungry. Every turn in Claude Code, Codex, or Cursor resends a pile of context - the conversation so far, files, tool output, logs - and you pay for all of it, every turn. A lot of that text is filler: restated intros, duplicate paragraphs, boilerplate, "just to recap" preambles that carry no new information.

Poco compresses that text before it reaches the model. This post explains exactly how, because "AI compression" usually means "we asked another model to summarize it, hope it got the details right." Poco does not work that way, and the difference matters when the text is your code and your instructions.

Extractive, not abstractive

The most important thing to understand first: Poco never rewrites your words. It does not paraphrase, summarize, or generate new text. It selects a subset of the sentences you already wrote and drops the rest. The output is always made of your original sentences, in their original order.

That choice is deliberate. An abstractive summarizer can hallucinate a fact, soften a constraint, or quietly change "must not" to "should." For a prompt that contains requirements and code, that is unacceptable. Extractive selection cannot invent anything - in the worst case it drops a sentence it should have kept, and the quality gate (below) is there to catch exactly that.

The pipeline, step by step

Compression runs server-side and is deterministic - the same input always produces the same output. There is no extra LLM call in the loop, so it is fast and adds no model cost of its own. Here is what happens to a chunk of text.

1. Detect what kind of text it is

Before touching anything, Poco classifies the content: natural-language prose, source code, a diff, structured data (JSON / XML / YAML), CLI output, or a log. The detection is heuristic - diff headers, JSON/YAML shapes, log timestamps and levels, language keywords.

This step is mostly about knowing what not to compress. Code, diffs, and structured data are protected: prose can have its filler trimmed safely, but dropping a line from a JSON blob or a patch would corrupt it. Short text is skipped too - there is nothing to gain from compressing a one-line prompt.

2. Split into sentences and drop exact duplicates

Poco splits the text into sentences and removes ones that are byte-for-byte identical to a sentence it has already seen, using a fast hash (FNV-1a). Long agent transcripts repeat themselves a lot - the same file header, the same status line, the same error - and de-duplicating is a free win that loses nothing, because an identical sentence carries no new information.

3. Score each sentence by how much it carries

Every remaining sentence gets a score based on its information density, with a penalty for boilerplate - lines containing markers like "all rights reserved", "click here", "subscribe", "privacy policy". Dense, content-bearing sentences score high; padding and boilerplate score low.

4. Keep the highest-value sentences, in order

Poco keeps the top-scoring sentences up to a budget, then re-sorts the kept sentences back into their original order so the result still reads top to bottom the way you wrote it. How aggressive the trim is depends on the content type from step 1: natural-language prose is trimmed the most, while code and structured data are barely touched, if at all.

5. Check the result, and fail safe

This is the part that makes the rest trustworthy. Poco scores the compressed text against your original on two axes:

  • ROUGE (unigram overlap and longest-common-subsequence recall) - how much of the original wording survived.
  • Information density - the fraction of the original's unique content terms that are still present.

Those produce a letter grade, A through F. If the compressed version does not clear a minimum grade, Poco throws it away and sends your original text unchanged. Compression is only applied when it both saves tokens and passes the fidelity bar. The default is to never ship a low-fidelity result.

What Poco deliberately does not do

  • It does not rewrite or paraphrase your text.
  • It does not compress code, diffs, or JSON/YAML/XML structure.
  • It does not touch short prompts.
  • It does not ship a compression that fails the quality gate - your original goes through instead.

Honest about the limits

Compression is lossy by design: Poco drops sentences it judges to be filler, and on text that is already dense it will (correctly) do very little. The savings depend entirely on how much redundancy your prompts actually contain, which varies a lot between workflows. We are not going to quote you a headline "X% saved" number we cannot stand behind yet - rigorous, reproducible benchmarks are in progress, and we would rather show you real numbers than marketing ones. In the meantime, the most honest benchmark is your own: Poco tracks the tokens it saves on your actual prompts.

See the current state on the benchmarks page, and watch your own savings by installing it.

Try it

Poco installs in one line and wires itself into Claude Code, Codex, and Cursor:

curl -sSL https://get.thepoco.io | sh

That is the whole setup. Full install guide.