naman10parikh/agentmoney/cost-investigation
Claude Code and agent skill by naman10parikh/agentmoney
- community
Checking that the SKILL.md file is still in the repository.
Use when someone asks "why was my API bill so high?", "which session burned the budget?", "did prompt caching help?", or "where did the money go?" — agentmoney's core promise. Walks the proxy logs, the Anthropic usage API, and the repo's own memory to attribute spend to a model/session and quantify cache savings.
Install
npx vskill@latest install naman10parikh/agentmoney/cost-investigationSKILL.md
The same SKILL.md was published earlier as naman10parikh/agentmoney/cost-investigation.
Trigger
An unexpected or unexplained LLM bill. The user ran agents overnight, woke up to a charge, and needs the dollars attributed — model, session, and whether caching paid off.
Why this is a skill
This is literally the README's opening pitch ("Your API bill is $247. You have no idea which session burned it..."). The investigation has a fixed, repeatable order; encoding it stops every cost post-mortem from being improvised.
Steps
- Get ground truth from the provider. With an Admin API key in
ANTHROPIC_ADMIN_KEY,
run node dist/index.js usage --days 30 --json to read the tokens the Anthropic Usage API recorded, priced with agentmoney's rates. Start from these numbers, not from estimates; without an admin key, say so and work from the proxy logs.
- Attribute via the proxy logs. Read
.agentmoney/calls.jsonland the daily
report-YYYY-MM-DD.{json,md} files. Group spend by model and by session to find the single biggest contributor. If no proxy data exists, tell the user to route traffic through agentmoney proxy --port 8999 going forward so the next bill is attributable.
- Quantify cache savings. For the top sessions, compare
cacheReadTokensvs raw
input tokens. Use node dist/index.js calc -m <model> -i <in> -o <out> --cache-read <cr> to compute the with-cache cost, then again with --cache-read 0, and report the delta as the realized (or missed) savings. From another agent, the MCP tool cost_query (server agentmoney-mcp) does the same math: pass model, input_tokens, output_tokens and cache_read_tokens.
- Recall prior incidents. Run
node dist/index.js memory-search "cost spike caching session"
to surface any past LEARNINGS about the same failure mode before re-deriving it.
- Recommend a guardrail. If the spike is repeatable, recommend a budget alert:
agentmoney proxy --alert <usd> so the proxy warns at a configurable cap.
Verify
- The attributed per-model total reconciles with the
usagetotal within rounding. - The cache-savings figure is shown both as a dollar amount and a percentage.
- A concrete next-step guardrail (proxy alert threshold) is named.
Output
A short attribution report: total spend, the #1 model/session that drove it, the realized vs missed cache savings in dollars, and one guardrail to set. No new files — read the logs, run the CLI, summarize.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/cost-investigation/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/naman10parikh/agentmoney/cost-investigation)