agentleFS
m2ai-mcp-serversm2ai-mcp-servers/claude-skills/skills/agent-cost-model/SKILL.md

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.

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
  1. Distinctive:

    Use when the user says "cost model", "how much will this cost", "token economics", "estimate the cost", "optimize model costs", or …

    line 12
  2. Distinctive:

    If the user can't estimate tokens, help them:

    line 27
  3. Distinctive:

    Use current Anthropic pricing (per million tokens):

    line 37
  4. Distinctive:

    All estimates are approximations.

    line 121

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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):

  1. Pipeline steps -- what does the agent do, in order?
  2. Model per step -- which model handles each step? (e.g., Haiku for routing, Sonnet for coding, Opus for review)
  3. Token estimates per step:
    • Input tokens (prompt + context)
    • Output tokens (response)
    • Cache-eligible tokens (system prompt, static context)
  4. Volume -- tasks per day / per week / per month
  5. 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):

ModelInputOutputCache WriteCache 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:

StepModelInput TokensOutput TokensCost/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:

OptimizationMonthly SavingsEffort
[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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.