Skip to content

Instantly share code, notes, and snippets.

@gsannikov
Created March 17, 2026 14:21
Show Gist options
  • Select an option

  • Save gsannikov/9f89f3bcc72aff05140b37fda4b595bb to your computer and use it in GitHub Desktop.

Select an option

Save gsannikov/9f89f3bcc72aff05140b37fda4b595bb to your computer and use it in GitHub Desktop.
Claude Code Cost Calculator — estimate workload cost across Raw API, Max Peak, and Max Off-Peak pricing tiers

Claude Code Cost Calculator

Paste this entire prompt into Claude Code to estimate your workload cost across pricing tiers.


Prompt

I need you to estimate the cost of a task I'm about to run, comparing three pricing scenarios.

Step 1: Estimate tokens

Ask me to describe my task, OR let me provide token estimates directly.

If I describe the task, estimate based on:

  • Number of files to read (avg 200 lines = ~4K input tokens per file)
  • Number of edits to make (avg ~2K output tokens per edit)
  • Number of agent turns (5-12 per agent depending on complexity)
  • Thinking tokens per turn: low effort ~5K, default ~15K, high ~50K
  • Number of parallel agents (if using teams)

Step 2: Calculate costs

Use these rates (Opus 4.6):

  • Input: $15 per million tokens
  • Output (including thinking): $75 per million tokens
  • Prompt caching: reduces repeated input by ~30%

Step 3: Output comparison table

╔══════════════════════════╦═══════════╦══════════╗
║ Scenario                 ║ Cost      ║ Savings  ║
╠══════════════════════════╬═══════════╬══════════╣
║ Raw API (pay-as-you-go)  ║ $X.XX     ║ baseline ║
║ Max $200 plan (peak)     ║ $Y.YY     ║ ZZ%      ║
║ Max $200 plan (off-peak) ║ $W.WW     ║ VV%      ║
╚══════════════════════════╩═══════════╩══════════╝

Max plan effective cost = (task capacity % × $200 subscription)

  • Monthly API value ≈ $3,600 (20x Pro)
  • Off-peak doubles effective capacity → $7,200

Step 4: Scheduling recommendation

If the task does NOT require human input mid-run, suggest:

# Schedule for off-peak (adjust time to your timezone)
# This is a one-shot job — fires once then auto-deletes
claude cron create --once "0 20 * * *" "your prompt here"

If the task DOES require interaction, flag it: "This task needs human input — not suitable for off-peak scheduling. Consider breaking it into autonomous sub-tasks first."

Key formulas

raw_api_cost = (input_tokens × $15/M) + (output_tokens × $75/M)
max_peak_effective = (raw_api_cost / $3,600) × $200
max_offpeak_effective = (raw_api_cost / $7,200) × $200
savings_peak = 1 - (max_peak_effective / raw_api_cost)
savings_offpeak = 1 - (max_offpeak_effective / raw_api_cost)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment