coffer-cost-review
v0.1.2
Published
Claude Code / Codex skill that audits AI codebases for LLM cost-waste. Reads your code with semantic understanding (not regex) — knows when cache_control is applied at runtime, when agent loops are bounded externally, and when an f-string is actually stat
Downloads
127
Maintainers
Readme
coffer-cost-review
A Claude Code / Codex skill that audits AI codebases for LLM cost waste — with semantic understanding, not regex.
npm install -g coffer-cost-reviewThen in Claude Code or Codex ask:
review my LLM costs
That's it. The skill is installed to:
~/.claude/skills/coffer-cost-review/${CODEX_HOME:-$HOME/.codex}/skills/coffer-cost-review/
Why semantic > regex
The first version of this tool was a Python static scanner. We dogfooded it on five well-known agent projects (Aider, smolagents, crewAI, OpenInterpreter, MetaGPT). It produced ~64 "findings" of which most were false positives:
- Aider applies
cache_controlin a separate file at runtime — a single-file regex can't see that. Findings about Aider's "uncached" system prompts were wrong. - smolagents caps memory growth via
max_steps=20in the agent loop, not in theappendcall. Findings about "unbounded history" were wrong. - crewAI's
instructions = f"{instructions}\n\n{output_schema}"looks like a cache-breaking interpolation butoutput_schemais a fixed Pydantic-model description — static at init. Findings were wrong. - stagehand_tool's
instruction = f"Navigate to {url}"matched the same regex but isn't an LLM system prompt at all — it's a browser navigation command.
Static regex inherently can't see:
cache_controlapplied at runtime in a different file- Caps enforced one level up in an agent loop
- Init-time concatenation that resolves to a static string
- Variable names that suggest "system prompt" but go elsewhere
These all require reading the code with full repo context. That's what Claude does well; that's what this skill leans into.
What it catches
By cost lever (every detector answers "yes" to: does fixing this reduce the bill the provider sends?):
| Lever | Pattern |
|-------|---------|
| Input tokens | uncached large system prompts (Anthropic / OpenAI aware); dynamic-before-static cache breaks; unbounded conversation history (after checking external caps) |
| Output tokens | reasoning_effort="high" default; missing max_tokens on streaming |
| Number of calls | unbounded agent loops; temperature > 0 next to a cache layer; LLM doing regex's job |
| Provider tier | frontier model for trivial tasks; reasoning model for non-reasoning tasks |
| Architecture | retry loops without backoff; public endpoints without rate limit; streaming without abort |
What it deliberately doesn't flag
Reliability, observability, and metering issues are real production problems but they don't change the LLM bill:
- SDK init without
timeout=→ worker exhaustion, not over-payment - Missing
response.usagecapture → metering, not over-payment - Logging full prompts → Datadog bill, not OpenAI bill
- Missing
idempotency_key→ correctness, not over-payment
A separate "production-readiness review" skill is the right home for those.
Install paths
npm (recommended, also runs on macOS / Linux / Windows)
npm install -g coffer-cost-reviewOr one-shot without global install:
npx coffer-cost-reviewInstall only one agent target:
npx coffer-cost-review --only=codex
npx coffer-cost-review --only=claudecurl (no Node / npm needed)
curl -fsSL https://cofferwise.com/install-skill.sh | shManual
Clone this repo, copy skill/ to ~/.claude/skills/coffer-cost-review/
or ${CODEX_HOME:-$HOME/.codex}/skills/coffer-cost-review/.
Uninstall
npm uninstall -g coffer-cost-review # also removes the skill files
# or manually:
rm -rf ~/.claude/skills/coffer-cost-review
rm -rf "${CODEX_HOME:-$HOME/.codex}/skills/coffer-cost-review"Live runtime tracking
Static review tells you which patterns might be wasting money. It can't tell you which feature, which user, or which prompt is actually burning your bill right now.
For runtime cost attribution per feature / user / prompt: Cofferwise — built by the same team.
Contributing
PRs welcome. New patterns must answer "yes" to "fixing this reduces the bill from OpenAI / Anthropic / a paid LLM provider." Reliability / metering / observability improvements belong in a separate skill.
License
Apache 2.0.
