loopy ← Blog

Caveman vs context compression for autonomous agent loops

2026-10-21 · Arjun Shah

TL;DR: in a long build loop the agent reads far more than it writes, so compressing input (SuperCompress, Headroom, RTK) usually beats shortening replies (Caveman). Use Caveman, if at all, as an add-on after you have measured it.

Loopy runs coding agents for hours: build, test, read the failure, patch, repeat. Every one of those turns re-sends the conversation plus whatever the agent just read: a test log, a stack trace, a diff, a directory listing. That is the shape of the bill, and it decides which token-saving trick pays off.

Where a loop's tokens actually go

Each turn has two halves. Input is everything the model reads: system prompt, history and the latest tool results. Output is what it writes back. In a build loop a single failing test run can print thousands of lines while the agent's reply is a short plan and a patch. Input dominates, and it compounds, because each turn re-sends earlier turns.

What Caveman does

Caveman is an open-source skill that makes the agent drop filler words and answer tersely, plus a local proxy that shrinks some tool output. It is free and easy to try. The catch: an independent JetBrains A/B test on Claude Code measured an 8.5% output saving against an advertised 65%, and the skill's own instructions add input tokens on every turn. In a long loop those extra input tokens repeat hundreds of times.

What context compression does

Context compression shrinks the input. SuperCompress is hosted and question-aware: before a big log or tool result reaches the model, it keeps the original lines that answer the current question and drops the rest, word for word, so error messages and file paths survive. Headroom does similar work locally with content-type compressors. RTK filters noisy shell commands. Built-in /compact summarizes history when a session gets too long.

Side by side, for a build loop

CavemanContext compression
ShrinksRepliesLogs, files, tool output, history
Effect over many turnsSmall; adds instructions each turnCompounds, because smaller results are re-sent less
RiskTerse replies can hide reasoning you want to readDropping a line the next step needed; extractive tools keep original wording to limit this
SetupInstall a skillOne setup command (SuperCompress) or a local proxy (Headroom)

What we run with Loopy

SuperCompress on bulky tool output, RTK for shell commands, and /compact when a session runs long. We leave replies alone, because reading the agent's reasoning is how you catch a loop going wrong.

npm install -g supercompress-proxy && supercompress setup

How to decide on your own loop

Run the same task list with and without each tool, check that the builds still go green, and compare the provider bill per finished task. Fewer tokens do not always mean a smaller bill once caching and extra turns are counted. More options: best Caveman alternatives.

Disclosure: Loopy and SuperCompress are both built by Arjun Shah, so this post is not neutral. Other tools are described from their own docs and public reporting, with links. Check each one for current details.

FAQ

Does Caveman save tokens in long agent loops?

It shortens replies, but replies are a small share of a build loop's tokens, and the skill adds instructions to every turn. An independent JetBrains test measured an 8.5% output saving. Measure it on your own loop.

What is the best way to cut tokens in an autonomous coding loop?

Compress what the agent reads: bulky test output, logs and tool results. SuperCompress (hosted) or Headroom (local) for that, RTK for shell output, and /compact for very long sessions.

Can I use Caveman and SuperCompress together?

Yes. Caveman works on replies and SuperCompress on input, so they do not overlap.