---
title: "Caveman vs RTK for coding-agent token costs"
description: "RTK is a strong fit when verbose terminal output is the main source of wasted context. Caveman is useful when you want recoverable compression across a supported agent's provider requests, or a comman"
canonical: https://caveman.so/compare/rtk
last-updated: 2026-09-07
---

# Caveman vs RTK for coding-agent token costs

RTK is a strong fit when verbose terminal output is the main source of wasted context. Caveman is useful when you want recoverable compression across a supported agent's provider requests, or a command-output wrapper with the same local recovery store.

The first decision is where the waste enters the conversation. A large test log comes from a shell command. A large database result or browser response may enter through an entirely different tool. Choose the integration boundary that can actually see it.

## Command output and request context

[Rust Token Killer](https://github.com/rtk-ai/rtk) filters output from common development commands. Its setup can install a hook that rewrites commands to use RTK. Caveman offers `caveman shrink` for a command boundary and a local proxy for eligible request context.

| Area | RTK | Caveman |
| --- | --- | --- |
| First boundary | Development commands and their output | Command output or supported provider requests |
| Typical trial | Run existing test and Git commands through RTK | Wrap the agent, or run one command with `caveman shrink` |
| Recovery approach | Inspect the command-specific behavior and retained-output options you use | Content-addressed originals and a retrieval command or MCP tool |
| Reduction report | RTK documents estimated token counts | Local inferred counts; provider usage remains authoritative for spend |
| Agent setup | Command-rewriting hooks for supported hosts | Native wrap profiles and separate tool-output integrations |

A proxy has broader visibility into eligible request content, but that does not guarantee a bigger saving. If RTK already removes the repetitive output before the provider request exists, a second compressor may have little left to do.

## Caveman's useful difference

`caveman shrink` captures a command's output and can return a smaller view while keeping the source recoverable. The command's exit status remains part of the result. That matters for tests: a concise failure must still be a failure.

The local proxy adds another option when large results come from non-shell tools. It can operate around a supported agent's model traffic, provided that the selected path supports safe recovery. You can keep the agent and its tool definitions rather than rewriting each tool's implementation.

For small outputs or unsupported content, expect pass-through. A visible reduction is not required for every command, and forcing one can hide information the model needs.

## Read token reports carefully

RTK's [savings explanation](https://github.com/rtk-ai/rtk/blob/develop/docs/guide/resources/savings-explained.md) separates command-output reduction from the total bill. Caveman makes the same distinction between a local inferred reduction and provider-reported usage.

Suppose a tool returns fewer tokens but the model needs two extra calls to complete the task. The report for that one tool can improve while the session cost rises. Cache pricing can also make the next request cheaper than its raw token count suggests.

Use the [whole-task measurement guide](/guides/measure-agent-cost) to compare accepted results and total spend. Keep the direct arm and the losing cases. We do not have a matched Caveman-versus-RTK benchmark to turn into a general performance claim.

## Should you run both?

Start with separate trials. Command-rewriting hooks can make it hard to tell which tool changed the output. If you later combine them, inspect one real transcript and confirm that recovery markers survive and the underlying command still behaves correctly.

A tool can only recover the bytes it received. If an upstream filter already removed a line, Caveman's stored original is the filtered input. It cannot reconstruct a raw command transcript it never saw.

## Try the smaller migration

Use [the RTK switching guide](/switch/rtk) to replace one test hook or compare one command. Keep the rest of your development setup intact. For a broader provider-request trial, start with [Caveman Proxy](https://docs.caveman.so/docs/proxy).
