Works with the AI Agents you already use
Token Budget Estimator
by Alexand_ary
Know what a feature will cost in tokens and dollars before you build it with Claude Code, Cursor or Codex. P10, P50 and P90 per model from a Monte Carlo simulation, calibrated on your own session logs.
$4.99
Token Budget Estimator
Example session with this skill installed
I need to add a Stripe checkout flow to this Next.js app. Calibrate on my recent Claude Code logs for this repo, then estimate the cost for Claude Sonnet 5.5 and Haiku 5.5. I'll work in a fresh session.
- Read your context and instructions
- Compiled the token budget estimator
Estimate: Stripe checkout flow in a Next.js app, fresh session. Calibrated on 3 sessions of this repo. API billing, USD, prices as of 2026-11-17.
| Model | P10 | P50 | P90 | Tokens P50 |
|---|---|---|---|---|
| claude-sonnet-5.5 | $1.08 | $1.58 | $2.33 | 1.7M |
| claude-haiku-5.5 | $0.06 | $0.09 | $0.13 | 1.7M |
| claude-opus-5.5 (for comparison) | $2.16 | $3.17 | $4.67 | 1.7M |
Turns: 54 / 66 / 81. One run in ten lands outside P10-P90. Same turn plan for every model: Haiku may need more debug turns on webhook and auth logic, which is not modelled; expect its real figure nearer the P90.
Where the P50 goes (Sonnet): cached input 1.47M tokens ($0.15), cache writes 165k ($0.66), output 38k ($0.38), thinking 37k ($0.37), uncached input <1k. On a fresh session the cache writes are the largest line, not the context.
What drives it
- Retry factor at worst case: +33%. Unattended runs retry more; stay in the loop for the webhook and test-card checks.
- Debug turns at their high bound: +19%. Webhook signature verification, test-mode keys and redirect URLs are where Stripe integrations stall. Put the Stripe CLI and test keys in .env before starting, and give the agent the webhook docs.
- Implementation turns at their high bound: +12% / +10%. Decide Checkout vs Elements before coding; a settled design cuts the implement range.
Simulated plan (correct it and I will re-run):
| Activity | Turns [low, mode, high] |
|---|---|
| Explore routes, auth, env setup | 3, 6, 10 |
| Design: Checkout vs Elements, webhook events, data model | 1, 3, 5 |
| Implement server route, webhook, Stripe client | 5, 9, 15 |
| Implement checkout, success and cancel pages | 4, 7, 12 |
| Tests: webhook signature, routes, pages | 3, 6, 12 |
| Debug: signature, keys, redirects, env | 3, 7, 18 |
| Verify with Stripe test cards in the browser | 2, 4, 8 |
| Review and cleanup | 1, 2, 3 |
Calibration note: 3 sessions, 258 calls in this repo. Measured cache hit 99.97%, 1.3k cache-write tokens per turn, 660 output tokens per turn, 327k context per turn (mode). Fresh session assumed, so the "medium" repo profile (10-30k per turn) is used instead of the measured long-session context; if you continue in an open session instead, tell me its current context and the estimate rises.
What this cannot know: retries beyond the retry factor, scope growth (subscriptions, refunds, taxes would be a second feature), Stripe account setup time, CI and hosting. Prices verified at 2026-11-17.
Next steps
- Settle Checkout vs Elements and the webhook event list before the first prompt.
- Have test keys and the Stripe CLI in place so debug stays near its mode.
- After the work, ask me to compare the estimate with the real session: calibrate.py will re-read the logs and show where it was off.
Connects securely to your tools. The creator never sees your data.
About this skill
Every developer who works with a coding agent asks the same question after the fact, from the invoice: how much did that feature cost? This skill answers it before you start, as a range you can defend, and tells you which choices move it.
Back-tested on real sessions: a small UI feature (a custom cell editor in a third-party data grid), calibrated on 3 sessions of the same repo, was estimated at $15 / $20 / $27 (P10 / P50 / P90) and cost $19.5; 61-78-100 turns against 73, 36-48-63M tokens against 35.5M. A 165-call session was estimated at $39-77 and cost $76.79.
The plans and commands are in examples/, so you can reproduce the numbers before trusting them.
It decomposes the work into activities (explore, design, implement, test, debug, verify, docs), gives each a range of agent turns, and runs a 10,000-draw Monte Carlo over context size, cache hits, cache writes, output and reasoning tokens. The result is a P10/P50/P90 in tokens and money for every model you want to compare, plus a sensitivity ranking: which input moves the cost most, and what to do about it.
The part that makes it accurate is calibration. calibrate.py reads your Claude Code session logs (token counts and timestamps only, never the text) and measures how you work: cache hit ratio, context per turn, output and reasoning per turn, cache writes, turns per session. Generic estimates land within a factor of 3-5 of reality; calibrated ones within 1.5-2.
What it does
- Range, not a number: P10/P50/P90 for turns, tokens by kind (cached input, uncached input, cache writes, output, thinking) and cost per model.
- Model comparison on the same plan (Claude Opus/Sonnet/Haiku, GPT-5 family, codex models), with an honest note that a cheaper model may need more turns.
- Sensitivity: the three inputs that move the cost most, each with its lever (fresh session, CLAUDE.md, shorter test output, cheaper model for exploration, a spec before coding).
- Calibration on your Claude Code logs, per project; the estimate improves with every feature.
- Close the loop: after the work, compares the estimate with the real consumption and says where it was off and why.
- Session-aware: if you continue in an already long session, it floors the context at what the session carries now and shows how much a fresh session would save.
What it found on real logs
99.97% of input tokens in a typical Claude Code session are cache reads at 1/20 of the input price. A long session costs 8x the tokens of a fresh one for the same feature, but almost the same money on the API. On a flat subscription, where limits count tokens, the same long session burns the limit 8x faster. The estimator makes both visible.
How it works
- Loads the activity catalog, the parameters and a dated price list.
- Calibrates on your logs if they exist (
~/.claude/projects), per project. - Decomposes the feature into activities with turn ranges and shows you the plan to correct.
- Simulates 10,000 runs (about a second) for every model you chose.
- Reports ranges, cost split, drivers, plan, calibration note and what it cannot know.
- After the work, re-reads the session and compares.
Frameworks & tools
Python 3, no dependencies. Needs file access to run the two scripts; log calibration needs Claude Code logs (Cursor and Codex logs are not read yet: estimates still work for them with generic parameters). Replies in your language.
Use cases
- Budget a feature or a sprint of features before starting, per model.
- Decide whether Opus is worth it for this task, or whether Haiku for exploration and tests pays off.
- Understand why last week's session cost what it did.
- Estimate how much of a subscription's usage limit a task will burn.
Known limitations
Estimates are ranges, and one run in ten falls outside P10-P90. Uncalibrated, expect a factor of 3-5; calibrated on a few sessions, 1.5-2. Prices live in a dated file (as of 2026-11-17) and the skill warns when it is older than 60 days; verify official prices before quoting a client. Agent retries and dead ends beyond the retry factor, scope that grows while you work, CI and hosting costs are not modelled. Calibration currently reads Claude Code logs only.
On flat subscriptions the dollar figure is what the same work would cost on the API; the token figure is what counts against your limit. The back-tests are a-posteriori (plans written after the fact); treat your first a-priori estimates as the real test, and the skill will compare them for you.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 16 days ago
Permissions
What's inside
Frequently Asked Questions
New in LLM Ops
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.