agent-cost-model
Skill0 starsChanged 7 months agoMITView on GitHub
Model token costs and optimization opportunities for any agent workflow, producing per-task costs, monthly burn, and model-routing savings.
In this repository24 other files it gives its agents.
- aarSkill
- banana-makerSkill
- bitter-lesson-scorecardSkill
- boot-tax-monitorSkill
- compensating-complexity-auditorSkill
- context-fork-guideSkill
- context-hygieneSkill
- counterargument-stress-testSkill
- dark-code-auditSkill
- executive-briefingSkill
- failure-asymmetrySkill
- failure-postmortemSkill
- file-intelSkill
- geopolitical-signal-enricherSkill
- get-api-docsSkill
- gh-reviewSkill
- model-routerSkill
- optimize-descriptionSkill
- prompt-rewriterSkill
- skill-auditSkill
- skill-maintenanceSkill
- spec-gap-detectorSkill
- token-burn-auditorSkill
- what-am-i-forgettingSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Use when the user says "cost model", "how much will this cost", "token economics", "estimate the cost", "optimize model costs", or …
- Distinctive: line 27
If the user can't estimate tokens, help them:
- Distinctive: line 37
Use current Anthropic pricing (per million tokens):
- Distinctive: line 121
All estimates are approximations.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Cost Modeling Skill
Takes an agent workflow description and produces a full cost model: per-task cost, daily/monthly burn, model-routing optimization, and break-even analysis.
Trigger
Use when the user says "cost model", "how much will this cost", "token economics", "estimate the cost", "optimize model costs", or describes an agent pipeline and asks about pricing.
Phase 1: Workflow Capture
Gather the workflow details. Ask for (accept estimates):
- Pipeline steps -- what does the agent do, in order?
- Model per step -- which model handles each step? (e.g., Haiku for routing, Sonnet for coding, Opus for review)
- Token estimates per step:
- Input tokens (prompt + context)
- Output tokens (response)
- Cache-eligible tokens (system prompt, static context)
- Volume -- tasks per day / per week / per month
- Concurrency -- parallel workers?
If the user can't estimate tokens, help them:
- Short prompt (~500 input tokens)
- Medium prompt with context (~2,000-5,000 input tokens)
- Full codebase context (~50,000-100,000 input tokens)
- Short response (~200 output tokens)
- Code generation response (~1,000-3,000 output tokens)
- Long analysis (~5,000+ output tokens)
Phase 2: Pricing Reference
Use current Anthropic pricing (per million tokens):
| Model | Input | Output | Cache Write | Cache Read |
| Haiku 3.5 | $0.80 | $4.00 | $1.00 | $0.08 |
| Sonnet 4 | $3.00 | $15.00 | $3.75 | $0.30 |
| Opus 4 | $15.00 | $75.00 | $18.75 | $1.50 |
For other providers (OpenAI, Google, OpenRouter), ask the user or check current published rates. Do not guess pricing from training data -- ask or verify.
Phase 3: Cost Calculation
For each pipeline step, calculate:
step_cost = (input_tokens * input_price) + (output_tokens * output_price)
+ (cache_write_tokens * cache_write_price) + (cache_read_tokens * cache_read_price)Then aggregate:
| Step | Model | Input Tokens | Output Tokens | Cost/Task |
| [step name] | [model] | [N] | [N] | $X.XXXX |
| ... | ... | ... | ... | ... |
| Total | $X.XXXX |
Daily burn: cost/task * tasks/day Monthly burn: daily * 30 Annual burn: monthly * 12
Phase 4: Optimization Analysis
Identify savings opportunities:
Model Routing
- Which steps use expensive models but could use cheaper ones?
- Rule of thumb: routing/classification -> Haiku, generation/coding -> Sonnet, complex reasoning/review -> Opus
- Calculate savings if optimized
Caching
- Which steps share static context (system prompts, CLAUDE.md, schemas)?
- Cache hit rate estimate: if volume > 10/day on same prompt prefix, caching saves 90%+ on those tokens
- Calculate savings with caching enabled
Prompt Optimization
- Are any prompts unnecessarily verbose?
- Could few-shot examples be replaced with instructions?
- Could context be trimmed without quality loss?
Volume Thresholds
- At what volume does a Batch API (50% discount, 24h turnaround) make sense?
- Break-even: if latency isn't critical, batch at any volume
Present as:
| Optimization | Monthly Savings | Effort |
| [description] | $X.XX (Y%) | [low/medium/high] |
Phase 5: Summary Report
# Agent Cost Model: [Pipeline Name]
## Per-Task Cost: $X.XXXX
## Monthly Burn (at N tasks/day): $X.XX
## Annual Burn: $X,XXX
## Cost Breakdown
[table from Phase 3]
## Optimization Opportunities
[table from Phase 4]
## Optimized Monthly Burn: $X.XX (savings: Y%)
## Break-Even Analysis
- vs. human labor at $X/hr: breaks even at N tasks/month
- vs. alternative approach: [comparison if relevant]Notes
- All estimates are approximations. Actual costs depend on exact prompt content, model behavior, and caching hit rates.
- Pricing changes frequently. Always verify against current published rates before making business decisions.
- For ClaudeClaw multi-agent costs, remember each agent (main, research, comms, content, ops) has its own token budget per task.
Source
Extracted from Nate Kadlac newsletter (2026-03-26) -- "The K-Shaped AI Labor Market" -- cost/token economics as a core AI-native skill.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

