Caveman Learn Token Fixes
JuliusBrussee/caveman
Acts on a Caveman learn report: reviews ranked token sinks, applies cost-lowering edits one at a time with your consent, and reports what each fix returned.
Audits a project's Claude Code setup for common token-cost leaks and returns a prioritized fix list, using only static inspection of files and settings.
$ npx skills add mergisi/awesome-openclaw-agents --skill cost-optimizer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install mergisi/awesome-openclaw-agents cost-optimizer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/mergisi/awesome-openclaw-agents.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/claude/cost-optimizer .claude/skills/cost-optimizer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "cost-optimizer" agent skill from https://github.com/mergisi/awesome-openclaw-agents/tree/main/skills/claude/cost-optimizer into .claude/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/mergisi/awesome-openclaw-agents/tree/main/skills/claude/cost-optimizerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add mergisi/awesome-openclaw-agents --skill cost-optimizer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install mergisi/awesome-openclaw-agents cost-optimizer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mergisi/awesome-openclaw-agents.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/claude/cost-optimizer .agents/skills/cost-optimizer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "cost-optimizer" agent skill from https://github.com/mergisi/awesome-openclaw-agents/tree/main/skills/claude/cost-optimizer into .agents/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mergisi/awesome-openclaw-agents --skill cost-optimizer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install mergisi/awesome-openclaw-agents cost-optimizer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mergisi/awesome-openclaw-agents.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/claude/cost-optimizer .cursor/skills/cost-optimizer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "cost-optimizer" agent skill from https://github.com/mergisi/awesome-openclaw-agents/tree/main/skills/claude/cost-optimizer into .cursor/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/mergisi/awesome-openclaw-agents.git --path skills/claude/cost-optimizer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add mergisi/awesome-openclaw-agents --skill cost-optimizer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install mergisi/awesome-openclaw-agents cost-optimizer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mergisi/awesome-openclaw-agents.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/claude/cost-optimizer .gemini/skills/cost-optimizer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "cost-optimizer" agent skill from https://github.com/mergisi/awesome-openclaw-agents/tree/main/skills/claude/cost-optimizer into .gemini/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install mergisi/awesome-openclaw-agents cost-optimizerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add mergisi/awesome-openclaw-agents --skill cost-optimizer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/mergisi/awesome-openclaw-agents.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/claude/cost-optimizer .github/skills/cost-optimizer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "cost-optimizer" agent skill from https://github.com/mergisi/awesome-openclaw-agents/tree/main/skills/claude/cost-optimizer into .github/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add mergisi/awesome-openclaw-agents --skill cost-optimizer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install mergisi/awesome-openclaw-agents cost-optimizer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/mergisi/awesome-openclaw-agents.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/claude/cost-optimizer .opencode/skills/cost-optimizer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "cost-optimizer" agent skill from https://github.com/mergisi/awesome-openclaw-agents/tree/main/skills/claude/cost-optimizer into .opencode/skills/cost-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cost-optimizer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
cost-optimizerAudits a project's Claude Code setup for common token-cost leaks and returns a prioritized fix list, using only static inspection of files and settings.
The agent inspects a project without calling any pricing API or guessing at past spend, and records PASS, WARN or FAIL with a short note for each check. The checks cover the size of `CLAUDE.md` (under 100 lines passes, over 300 fails because it is prepended to every message), bloated memory files (a warning above 500 lines, a failure above 1500), and skills that have large bodies but are never invoked.
It also looks at subagent fan-out, warning when a repo spawns more than 5 parallel subagents per run without aggregation or when subagents re-read the whole repo instead of getting a scoped prompt, and at prompt-cache hygiene, failing any hook that injects a date or random value into every turn. Each finding comes with a suggested fix, such as moving reference material out of `CLAUDE.md` into skill files or docs. The excerpt is truncated, so any further checks are not described.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 05820c5. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are bash).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Claude Code Cost Optimizer loads about 1.1k tokens when it runs. Until then it costs about 75 tokens; SKILL.md has 443 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from mergisi/awesome-openclaw-agents at commit 05820c5, republished under its MIT licence (© mergisi). 443 words, ~1,089 tokens.
.claude/skills/cost-optimizer/SKILL.md (or your agent's skills folder).Audit a project's Claude Code setup for the handful of well-known cost leaks and output a prioritized remediation list. This is a static inspection — no pricing API calls, no guesswork about past spend.
Run each check and record PASS / WARN / FAIL with a short note.
wc -l CLAUDE.md .claude/CLAUDE.md 2>/dev/nullFix: move reference material (API keys, runbooks, verbose examples) into skill files or docs/, and leave CLAUDE.md as a thin pointer.
find ~/.claude/projects -name 'MEMORY.md' -exec wc -l {} \;
find .claude/memory -type f -exec wc -l {} \; 2>/dev/nullFix: extract old sections into memory/<topic>.md detail files and link from the index.
ls ~/.claude/skills/ .claude/skills/ 2>/dev/nullSKILL.md bodies (>300 lines) are loaded into the skill index every turn — prune them.Grep the project for Task/agent launch patterns:
grep -rn 'TaskCreate\|subagent\|parallel.*agent' --include='*.md' --include='*.js' --include='*.ts' .Fix: pass a short brief + a handful of file paths to each subagent, not the entire CLAUDE.md context.
Look for .claude/settings.json and check if the project sets an unusually short cache TTL, or if hooks invalidate the cache every message (e.g. a hook that echoes a timestamp into the system prompt).
date / uuidgen / random content into every turn — it kills the cache, 10x cost.Grep for explicit model pins:
grep -rn 'opus\|sonnet\|haiku\|claude-3\|claude-4' .claude/ CLAUDE.md 2>/dev/null/model-cost-compare skill for a per-task estimate.du -sh ~/.claude/projects/*/sessions 2>/dev/null | sort -h | tail -5Huge session dirs suggest you never /compact long-running threads. Suggest periodic compaction.
Print a ranked list. Top of the list = biggest win per effort.
Cost Optimizer — <project>
Priority 1 (FAIL)
[CLAUDE.md] 412 lines — prepended every turn. Extract sections into skills/.
[cache hygiene] .claude/settings.json hook injects `date +%s` on SessionStart. Remove it.
Priority 2 (WARN)
[memory] MEMORY.md is 820 lines. Index top, details linked.
[model pinning] Opus 4.6 pinned in 4 skill files — 2 could drop to Sonnet 4.6.
Priority 3 (nice-to-have)
[skills] 3 skills (haiku-card, foo, bar) never invoked in last 30 days.
Estimated impact: roughly halving per-turn overhead — validate with a before/after /cost check.Do not invent dollar savings. You can estimate relative impact ("~30% smaller context") but not absolute currency unless the user provides their current bill.
/cost-optimizer© mergisi, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/claude/cost-optimizer of mergisi/awesome-openclaw-agents.
Open the folder on GitHubat commit 05820c5
Claude Code Cost Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Claude Code Cost Optimizer this skillmergisi/awesome-openclaw-agents | 4k | — | ~1.1k | Automated safety check: Pass | MIT | |
| Caveman Learn Token FixesJuliusBrussee/caveman | 111k | — | ~2.8k | Automated safety check: Pass | Apache-2.0 | |
| Context Budget Checkposhan0126/dotclaude | 871 | — | ~1.4k | Automated safety check: Pass | MIT | |
| Caveman Memory File CompressorJuliusBrussee/caveman-code | 942 | — | ~1.2k | Automated safety check: Pass | MIT | |
| Claude Code Masteryborghei/Claude-Skills | 886 | — | ~1.9k | Automated safety check: Pass | MIT | |
| Code Context Slicingtrailofbits/skills | 7.4k | — | ~2.1k | Automated safety check: Pass | CC-BY-SA-4.0 |
JuliusBrussee/caveman
Acts on a Caveman learn report: reviews ranked token sinks, applies cost-lowering edits one at a time with your consent, and reports what each fix returned.
poshan0126/dotclaude
Estimates the per-turn token cost of a project's .claude folder and CLAUDE.md, split into always-loaded, path-scoped and invoked-only files, and flags what runs over budget.
JuliusBrussee/caveman-code
Rewrites a memory file such as CLAUDE.md or a todo list in terse caveman-style text to cut input tokens, saving a readable backup outside the project tree.
borghei/Claude-Skills
A skill your agent uses when the user asks to "optimize CLAUDE.md", "create a new skill", "write a custom agent", "configure hooks", "manage context window", "set up MCP servers", "scaffold a skill…
trailofbits/skills
Picks a small, graph-based slice of source with Trailmark and hands a focused code task to a smaller or local model without exposing the whole repository.
withkynam/vibecode-pro-max-kit
Audits a project's context routing, skill discoverability and skill wiring by running a chain of validator scripts and fixing whatever they report.
mergisi/awesome-openclaw-agents
Generates or updates a whiteboard-style architecture diagram of the current codebase as an Excalidraw JSON file, showing services and data flow.
mergisi/awesome-openclaw-agents
Drafts a commit message from your staged diff, matching the repo's own style and explaining why the change happened, not just what changed.
mergisi/awesome-openclaw-agents
Trigger when the user asks which model to use, wants to compare model costs, says "what's cheapest for this task", "should I use Opus or Sonnet", "can a smaller model handle this", or…
mergisi/awesome-openclaw-agents
Trigger when an OpenClaw agent is broken, silent, crashing, stuck, not responding, returning empty output, or the user says "my agent is down", "agent not working", "/openclaw-debugger".
mergisi/awesome-openclaw-agents
Explains a pasted code snippet in plain English, returning the detected language, a one-sentence summary, how it works and one practical tip.
mergisi/awesome-openclaw-agents
Generate a clean, conventional commit message from a description of your changes.
Categories
Audits a project's Claude Code setup for common token-cost leaks and returns a prioritized fix list, using only static inspection of files and settings. The agent inspects a project without calling any pricing API or guessing at past spend, and records PASS, WARN or FAIL with a short note for each check.md` (under 100 lines passes, over 300 fails because it is prepended to every message), bloated memory files (a warning above 500 lines, a failure above 1500), and skills that have large bodies but are never invoked.
Claude Code Cost Optimizer fits situations like: the Claude Code bill has jumped and you want to know why; session context is always huge and you suspect a bloated CLAUDE.md; reviewing a project after a runaway agent run; trimming memory files and unused skills.
Run `npx skills add mergisi/awesome-openclaw-agents --skill cost-optimizer -a claude-code`. Or copy the skill folder (skills/claude/cost-optimizer in mergisi/awesome-openclaw-agents) into .claude/skills/cost-optimizer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add mergisi/awesome-openclaw-agents --skill cost-optimizer -a codex`. Or copy the skill folder (skills/claude/cost-optimizer in mergisi/awesome-openclaw-agents) into .agents/skills/cost-optimizer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mergisi/awesome-openclaw-agents --skill cost-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cost-optimizer, .gemini/skills/cost-optimizer, .github/skills/cost-optimizer and .opencode/skills/cost-optimizer in your project.
SKILL.md names no scripts, command-line tools or credentials: Claude Code Cost Optimizer is instructions for the agent only. Our summary lists: A shell that can run `wc`, `find` and `grep` in the project.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Claude Code Cost Optimizer is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Claude Code Cost Optimizer: Caveman Learn Token Fixes (JuliusBrussee/caveman, 111k stars), Context Budget Check (poshan0126/dotclaude, 871 stars), Caveman Memory File Compressor (JuliusBrussee/caveman-code, 942 stars) and Claude Code Mastery (borghei/Claude-Skills, 886 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
mergisi (a GitHub user) maintains it in mergisi/awesome-openclaw-agents, which has 3,999 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on September 26, 2026.
Source: mergisi/awesome-openclaw-agents on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.