AB
AiBoss
Tutorials

Caveman Tested - A Minimalist Output Compression Plugin for AI Agents

Today I'll share some tips for making AI agents output more concise. Normally, when we use AI agents, the output, regardless of its accuracy, often includes a lot of rambling and unnecessary information, which is a waste of our time and energy to read. Using them...

Today I'll post something suitable. AI Agent A concise output.

We usually use AI Agent At that time, regardless of whether the output is correct or not, there will be some rambling nonsense, which wastes our time and energy to read and also wastes tokens to use.

As long as it's given to you AI Agent After installing this GitHub project called Caveman, the output immediately became concise, focusing only on the key points and eliminating unnecessary details.

Caveman is a place for... AI Agent The compression expression plugin used.

Project address: https://github.com/JuliusBrussee/caveman

Caveman could Claude Code, CodexGeminiUse tools like Cursor, Windsurf, Cline, and Copilot to provide more effective information rather than engaging in preambles or platitudes.

The key is to compress the "expression method," not the model's thought process, context, document content, or tool calls themselves. The official 65% savings refers to an average reduction in output tokens, not a direct 65% reduction in the total bill.

Caveman's approach is to write language conventions as strong rules and continuously feed them to the agent. This includes removing articles, small talk, weak words, and unnecessary connections, allowing sentence fragmentation, and preserving code, commands, errors, API names, and technical terms.

Core skills include caveman, caveman-commit, caveman-review, caveman-stats, caveman-compress, and caveman-shrink.

  • /caveman: Enables output compression. Supports strengths such as lite, full, ultra, and wenyan. full is the default mode.
  • /caveman-commit: Generates short Conventional Commit messages that emphasize why the changes were made, rather than a chronological description of what was changed.
  • /caveman-review: Outputs a single line of comments when reviewing code, skipping over polite but useless praise.
  • /caveman-stats: Reads Claude Code local session logs estimate token usage and savings.
  • /caveman-compress Compress natural language memory files such as CLAUDE.md, preferences, and project notes.
  • caveman-shrink: As an MCP proxy, it wraps the upstream MCP server and compresses the description fields in tools/list, prompts/list, and resources/list.

Differences between Caveman's various modes:

  • lite: simply removes unnecessary words, the sentence is still relatively normal.
  • full: Default mode. Shorter sentences, fragments are allowed.
  • ultra: more compressed, eliminating more conjunctions.
  • wenyan: Classical Chinese compression mode, primarily designed for Chinese characters because Chinese characters carry a higher information density. This mode is interesting, but not suitable for all scenarios, especially content requiring team collaboration, PR comments, or explanations for beginners.

caveman-compress has a set of careful file rules:

  • It only processes natural language files, such as .md, .txt, and .tex.
  • Do not process .py, .js, .json, .yaml, .env, .sql, and .sh files.
  • Code blocks, inline code, URLs, paths, commands, and technical terms must be preserved as is.
  • The original file will be backed up as FILE.original.md
  • If verification fails, the original file will not be overwritten.

This design indicates that the author was aware that "compressed memory files" risked damaging information, so file type restrictions and verification processes were implemented.

Case 1 Bug Explanation

Prompt words:

Explain why this React component is rendering repeatedly and provide a minimal fix:

function UserCard({ user }) {

const options = { showEmail: true };

return ;

}

const Profile = React.memo(function Profile({ user, options }) {

console.log("render profile");

return

{user.name}
;

});

Without Caveman:

Using Caveman:

Caveman is significantly shorter, cutting out about a third to half of the content, and contains no obvious errors.

Case 2 Debug Fix

Prompt words:
Please help me troubleshoot this Node.js login middleware issue. The user token has expired, but sometimes it still passes verification. Please point out the bug and provide the fix. The code snippet provided is: `function auth(req, res, next) { const token = parseToken(req.headers.authorization); if (!token) return res.status(401).send("missing token"); if (token.exp < Date.now() / 1000) { return res.status(401).send("expired"); } req.user = token.user; next();}`

Without Caveman:

Using Caveman:

The Caveman version outputs far fewer tokens, and the text and code are shorter. Both versions indicate that missing/illegal exp will be allowed, boundary checks should be performed using now >= exp, and JWTs require signature verification.

Case 3: Architectural Trade-offs

Prompt wordsWe are developing a B2B SaaS application with a team of 8 engineers. Currently, it's a monolithic Rails application with 3 modules: billing, notifications, and reporting. Our management wants to break it down into microservices. Please analyze whether this is a viable strategy and provide suggestions and a migration path.

Without Caveman:

Using Caveman:

The standard version costs approximately 1400 to 1600 tokens, while the Caveman version costs approximately 650 to 800 tokens, a reduction of about 50%, significantly lowering the scanning cost. Furthermore, key points were preserved: avoiding complete splitting, prioritizing modular units, prioritizing notifications/reports, and splitting billing last.

Case 4 PR Review

Prompt words:

Please review the following code snippet, focusing on safety, concurrency, and boundary conditions. Point out the real issues; praise is unnecessary.

async function transfer(fromUserId, toUserId, amount) {

const from = await db.users.findById(fromUserId);

const to = await db.users.findById(toUserId);

if (from.balance < amount) {

throw new Error("insufficient funds");

}

from.balance -= amount;

to.balance += amount;

await db.users.update(fromUserId, { balance: from.balance });

await db.users.update(toUserId, { balance: to.balance });

return true;

}

Without Caveman:

Using Caveman:

The difference between the two versions this time is not as large as in the previous sets. Caveman is roughly 10% to 15% less because Caveman added the "idempotency" problem.

Moreover, in code review scenarios, even without Caveman, the existing problem list approach already has limited space compression.

Case 5 Docker Optimization

Prompt words:

Please help me optimize this Dockerfile. The goal is to reduce the image size, improve the build cache hit rate, and avoid including sensitive files in the image.

FROM node:20

WORKDIR /app

COPY.

Run npm install

Run npm run build

CMD ["npm", "start"]

Without Caveman:

Using Caveman:

The Caveman version reduces the number of tokens by approximately 35% to 45%. The difference lies in the base image: the regular version uses bookworm-slim for more stable compatibility; Caveman uses alpine for a smaller file size.

Case 6: Database Issues

Prompt words:

Explain why this PostgreSQL query is slow, and provide troubleshooting and optimization solutions.

The `orders` table has 80 million rows, with fields including `id`, `user_id`, `status`, `created_at`, and `total_amount`.

Common queries:

SELECT *

FROM orders

WHERE user_id = $1

AND status = 'paid'

ORDER BY created_at DESC

LIMIT 20;

Without Caveman:

Using Caveman:

Without Caveman, it costs approximately 1000 to 1200 tokens; with Caveman, it costs approximately 500 to 650 tokens, a reduction of about 45% to 50%.

The standard version adds stable sorting for `created_at` and `id`, which Caveman missed.practicaldetail.

Case 7 Refactoring Task

function loadUser(id, callback) {

db.findUser(id, function(err, user) {

if (err) return callback(err);

api.fetchProfile(user.profileId, function(err, profile) {

if (err) return callback(err);

cache.set(id, profile, function(err) {

if (err) return callback(err);

callback(null, { user, profile });

});

});

});

}

Without Caveman:

Using Caveman:

Without Caveman, it costs approximately 850 to 1000 tokens; with Caveman, it costs approximately 650 to 800 tokens, a reduction of about 20% to 30%.

Caveman Token is slightly cheaper, but the advantage is not significant. This is because this problem inherently requires code blocks, and the token is mainly used for code, leaving limited space for style compression.

Case 8 New Feature Design

Prompt wordsDesign a backend API that exports reports as CSV files. It must support large data volumes, permission verification, asynchronous tasks, and expired download links. Please provide the API design, data flow, and main table structure.

Without Caveman:

Using Caveman:

Without Caveman, it costs approximately 1300 to 1600 tokens; with Caveman, it costs approximately 900 to 1100 tokens, a reduction of about 25% to 35%.

The standard version adds Idempotency-Key, a separate table for report_export_files, and CSV injection protection details.

Case 9: Accident Review

Prompt wordsOur online service experienced a large number of 500 errors between 10:05 and 10:27 yesterday. Initial findings indicate that the Redis connection pool was exhausted, causing the application to continuously retry, and simultaneously increasing the database QPS. Please write an internal incident debriefing, including the timeline, root cause, impact, fixes, and follow-up actions.

Without Caveman:

Using Caveman:

Without Caveman, it costs approximately 900 to 1100 tokens; with Caveman, it costs approximately 550 to 700 tokens, a reduction of about 35% to 45%.

The standard version adds placeholder hints, data consistency checks, and standby mechanisms; Caveman emphasizes retry budget, jitter, circuit breakers, and database protection.

Explanation of code in case 10

Prompt wordsPlease explain to a newly hired backend developer what a database connection pool is, why a new connection cannot be created for every request, and provide an example from a real-world service.

Without Caveman:

Using Caveman:

Using Caveman costs approximately 700 to 850 tokens; using Caveman costs approximately 300 to 400 tokens, a reduction of about 50% to 60%.

Both versions address connection reuse, connection establishment cost, connection limit, and the importance of not arbitrarily configuring the pool size. The standard version includes complete code examples and a visual explanation of "waiting for the 21st request."

Running through these 10 cases, Caveman did not show any obvious technical errors and preserved the core judgments. However, Caveman sacrifices some details, but it is very beneficial in well-defined problems and familiar scenarios.

Finally, I'd like to mention a few points that you should pay attention to:

  • Caveman only reduces the output token; it does not reduce the input token.automaticreduce
  • The skill itself adds approximately 1k to 1.5k input tokens per round.
  • If a normal answer would only yield 150 output tokens, enabling Caveman might actually be more expensive.
  • If the platform charges per request instead of per token, short responses will not reduce the number of requests.

Caveman's work isn't a small need to save a few tokens, but rather... AI Agent As this became part of our daily development, the requirements for output efficiency, reading cost, and collaboration quality increased.

After testing 10 cases, Caveman's value is quite clear. For tasks that are easy to expand upon, such as architectural trade-offs, database optimization, incident debriefing, and conceptual explanation, the output can be reduced by 35% to 60%; for tasks with a high proportion of code blocks, the compression rate can be reduced to 10% to 30%. It is very suitable for scenarios where the model is verbose, but engineers only want to see the conclusion.

For us, Caveman can reduce daily reading AI Response time; making review, debugging, and solution discussion more like engineering communication, helping to unify output style and reduce the cost of back-and-forth confirmation.

Caveman shouldn't be simply seen as a money-saving tool. It primarily compresses the output token, while the input token and inference cost remain unchanged.automaticdisappear.

AI Agent Once the production process begins, the difference lies not only in whether or not an answer can be generated, but also in whether the generated answer can be understood and accepted by others.fastuse.

Original link:It has garnered 85,000 stars on GitHub.AI Agent No more nonsense