SuperAPI AI Directory

Caveman hands-on - A minimalist output compression plugin for AI Agents

Author: AI小集 · Original source: AI工具集

Today let's share something that helps AI Agents output concisely.

When we normally use AI Agents, the output is always full of wordy fluff regardless of whether it's correct or not, which wastes our time and energy to read, and also wastes tokens when used.

Once you install this GitHub project called Caveman on your AI Agent, the output immediately becomes concise, with only the key points and no fluff.

 

01. Project Introduction

 

Caveman is a compressed expression plugin for AI Agents.

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

Caveman enables Claude Code, Codex, Gemini, Cursor, Windsurf, Cline, Copilot, etc. to cut the preamble and pleasantries and deliver more useful information.

The focus is on compressing the "way of expressing", not compressing model thinking, context, file content, or tool calls themselves. The official claim of 65% savings refers to the average reduction in output tokens, which does not equal a direct 65% reduction in the total bill.

Caveman's approach is to write language habits into strong rules and continuously feed them to the agent. This includes removing articles, greetings, hedging words, and filler connectives, allowing sentence fragments, and preserving code, commands, errors, API names, and technical terms.

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

  • /caveman: enables output compression. Supports intensities such as lite, full, ultra, and wenyan. full is the default mode.
  • /caveman-commit: generates short Conventional Commit messages, emphasizing why the change was made rather than a running account of what was changed.
  • /caveman-review: outputs one-line comments during code review, skipping pleasantries and useless praise.
  • /caveman-stats: reads Claude Code local session logs and estimates token usage and savings.
  • /caveman-compress <file>: compresses natural language memory files such as CLAUDE.md, preferences, and project notes.
  • caveman-shrink: acts as an MCP proxy wrapping an upstream MCP server, compressing the description fields in tools/list, prompts/list, and resources/list.

Differences between Caveman's several modes:

  • lite: only removes fluff, sentences remain fairly normal.
  • full: default mode. Sentences are shorter, fragments allowed.
  • ultra: more compressed, omits more connectives.
  • wenyan: classical Chinese compression mode, mainly for Chinese, because Chinese characters carry higher information density. This mode is interesting, but not suitable for all scenarios, especially not for content intended for team collaboration, PR comments, or explanations for beginners.

caveman-compress has a careful set of file rules:

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

This design shows that the author knows that "compressing memory files" carries the risk of destroying information, so file type restrictions and a validation process were put in place.

 

02. Project hands-on testing

case 1 Bug explanation

Prompt:

Explain why this React component re-renders repeatedly, and provide a minimal fix:

 

function UserCard({ user }) {

const options = { showEmail: true };

return <Profile user={user} options={options} />;

}

 

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

console.log(“render profile”);

return <div>{user.name}</div>;

});

Without Caveman:

With Caveman:

Caveman is noticeably shorter, cutting about one-third to one-half of the content, with no obvious errors.

case 2 Debug fix

Prompt:
Help me troubleshoot this Node.js login middleware issue. The user's token has already expired, but sometimes it still passes validation. Please point out the bug and provide the fix code. 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:

With Caveman:

The Caveman version outputs far fewer tokens, with both the body and code shorter. Both versions point out that missing/invalid exp will let it through, that the boundary check should use now >= exp, and that JWT needs signature verification.

case 3 Architecture trade-offs

Prompt: We are building a B2B SaaS, the team has 8 engineers, and it is currently a monolithic Rails application. There are now 3 modules: billing, notifications, and reporting. The boss wants to split it into microservices. Please analyze whether it should be split, and give recommendations and a migration path.

Without Caveman:

With Caveman:

The normal version is about 1400 to 1600 tokens, and the Caveman version is about 650 to 800 tokens, a reduction of about 50%, and the scanning cost is noticeably lower. Moreover, the key points are all preserved: do not recommend a full split, start with a modular monolith, prioritize notifications/reporting, and split billing last.

case 4 PR Review

Prompt:

Please review the following code, focusing on security, concurrency, and boundary conditions. Only point out real issues; no praise needed.

 

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:

With Caveman:

This time the gap between the two versions is not as large as in the previous groups. Caveman is roughly 10% to 15% shorter, because Caveman added extra coverage of the "idempotency" issue.

Also, in code review scenarios, not using Caveman is already a problem-list style of writing, so there is limited room for compression.

case 5 Docker optimization

Prompt:

Help me optimize this Dockerfile, with the goals of reducing image size, improving build cache hit rate, and avoiding bringing sensitive files into the image.

 

FROM node:20

WORKDIR /app

COPY . .

RUN npm install

RUN npm run build

CMD [“npm”, “start”]

Without Caveman:

With Caveman:

The Caveman version reduces tokens by about 35% to 45%. The difference is in the base image: the normal version uses bookworm-slim, which is more stable in compatibility; Caveman uses alpine, which is smaller.

case 6 Database issue

Prompt:

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

 

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

Common query:

 

SELECT *

FROM orders

WHERE user_id = $1

AND status = ‘paid’

ORDER BY created_at DESC

LIMIT 20;

Without Caveman:

With Caveman:

Without Caveman is about 1000 to 1200 tokens; the Caveman version is about 500 to 650 tokens, a reduction of about 45% to 50%.

The normal version has extra stable sorting by created_at, id, which is a practical detail that Caveman missed.

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:

With Caveman:

Without Caveman is about 850 to 1000 tokens; Caveman is about 650 to 800 tokens, a reduction of about 20% to 30%.

Caveman has slightly fewer tokens, but the advantage is not large. This is because this task naturally needs code blocks, tokens are mainly spent on code, and there is limited room for style compression.

case 8 New feature design

Prompt: Design a backend API for "export report as CSV". It must support large data volumes, permission checks, asynchronous tasks, and download link expiration. Please provide the API design, data flow, and main table structures.

Without Caveman:

With Caveman:

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

The regular version has more on the Idempotency-Key, the separate report_export_files table, and details of CSV injection protection.

case 9 Incident Retrospective

Prompt: Our production service had a large number of 500s yesterday from 10:05 to 10:27. Initial findings show the Redis connection pool was exhausted, the application kept retrying, and database QPS rose at the same time. Please write an internal engineering incident retrospective, including timeline, root cause, impact, fix, and follow-up actions.

Without Caveman:

With Caveman:

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

The regular version has more on placeholder prompts, data consistency verification, and the single-flight mechanism; Caveman places more emphasis on retry budget, jitter, circuit breaking, and protecting the DB.

case 10 Code Explanation

Prompt: Please explain to a backend newcomer who just joined what a database connection pool is, why a new connection cannot be created for every request, and give an example from an actual service.

Without Caveman:

With Caveman:

Without Caveman, about 700 to 850 tokens; with Caveman, about 300 to 400 tokens, a reduction of about 50% to 60%.

Both versions hit on connection reuse, connection establishment cost, connection count limits, and the fact that pool size cannot be configured arbitrarily. The regular version has more complete code examples and the intuitive explanation of "the 21st request waits".

After running these 10 cases, Caveman did not show obvious technical errors, and all the core judgments were retained, but Caveman sacrifices some details; in scenarios with clear questions and experienced users, the payoff is very high.

Finally, I still need to tell everyone a few points to note:

  • Caveman only reduces output tokens; input tokens are not automatically reduced
  • The skill itself adds about 1k to 1.5k input tokens per round
  • If a regular answer originally has only 150 output tokens, enabling Caveman may actually be more expensive
  • If the platform charges per request rather than per token, short answers will not reduce the number of requests

 

03. Dig a Little Deeper

 

Tools like Caveman are not a small need to save a few tokens, but rather a response to the higher demands on output efficiency, reading cost, and collaboration quality after AI Agents entered our daily development.

After testing these 10 cases, the value of Caveman is also fairly clear. For tasks that easily expand, such as architecture trade-offs, database optimization, incident retrospectives, and concept explanations, output can mostly be reduced by 35% to 60%; for tasks with a high proportion of code blocks, the compression rate drops to 10% to 30%. It is very suitable for scenarios where the model tends to be verbose but engineers only want to see conclusions.

For us, Caveman can reduce the time spent reading AI replies every day; it makes review, debug, and solution discussions more like engineering communication, helps unify output style, and lowers the cost of back-and-forth confirmation.

Caveman should not be understood only as a money-saving magic tool. It mainly compresses output tokens; input tokens and inference costs do not automatically disappear.

After AI Agents truly enter production processes, the gap is not only in whether they can generate answers, but also in whether the generated answers can be quickly used by people.

Original link:GitHub rakes in 85K Stars, AI Agent no longer talks nonsense