Caveman / Guides
Spend fewer tokens.
Finish the same work.
Practical guides to AI agent costs, prompt compression, caching, model routing, and evaluations. Commands, checks, and ways to measure the result.
Cost and quality
How to evaluate an AI agent optimization before rollout
Build an acceptance test that a cheaper but subtly wrong answer still fails. Write the rejections first, hold back tuning cases, count retries, read the losing runs.
How to measure AI agent cost per completed task
Count every attempt, including the failed ones, into one number. Set the task boundary, record the right fields per attempt, and divide by the tasks that passed.
Prompt caching and compression: reduce agent cost without losing reuse
Check cache reads before you shorten a prompt. How stable prefixes, cache writes and compression interact, and why cold and warm runs need separate numbers.
How to reduce LLM costs in an agent that already works
Pick the one change worth testing first from your own usage data. A symptom to experiment map for caching, compression, tool output, model choice, and retries.
Coding agents
Set up Caveman with Claude Code, Codex, and Gemini CLI
The skill and the proxy are two separate installs. Put the skill in for shorter replies, the proxy in for smaller input context, then test both on one real coding task.
Cut the MCP token overhead you pay on every request
MCP tool definitions ride along on every turn whether you use them or not. Measure that floor with a one word prompt, then cut it without breaking tool selection.
Context compression
AI gateways
How to choose an AI gateway for agents
A decision path instead of a feature matrix. Name the one problem you have now, key sprawl, model access, spend limits, caching or context size, then buy for that.
AI gateway migration: a reversible test plan for agent traffic
Move agent traffic to a new gateway without betting the product on it. Run both paths, diff the request shapes that break, cut over one caller, keep rollback tested.