cost
Skill40 starsChanged 13 months agoMITView on GitHub
Estimate what Claude Cowork / Claude Code conversations would cost if run on the pay-per-token Claude API instead of the subscription. Reports token counts and cache-aware API cost in USD and EUR, for the current conversation or for the whole history (cost per conversation). Trigger when the user asks things like "how much would this conversation cost on the API", "API cost of my Cowork conversations", "token usage / token count", "cost per conversation", "/cost", or wants to compare subscription vs API pricing.
9 other projects use a version of this.
Adopted by
Most recently taken up by
- SethGammon/Citadeltheir own version, first seen Sep 20, 2026
- NotHarshhaa/devops-skillstheir own version, first seen Sep 19, 2026
- jamillazarev/opsinisttheir own version, first seen Jul 31, 2026
- DaeSeokSong/oh-my-ouroborostheir own version, first seen Jul 23, 2026
- gaia-research/skill-costtheir own version, first seen Jul 11, 2026
- srafis/skillstheir own version, first seen May 13, 2026
Used with
Projects with it also use learn.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
genomewalkerSkilllearn
Learn from web sources, generate SKILL.md, and store key patterns in soul memory. Trigger keywords: learn, skill-gen, web-learn, documentation, tutorial.
Also in 3 projects that use this
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- H-mmer/pentest-agents★ 984same name
- SethGammon/Citadel★ 922same name
- Houseofmvps/ultraship★ 123same name
- NotHarshhaa/devops-skills★ 8same name
- gaia-research/skill-cost★ 2same name
- jamillazarev/opsinist★ 2same name
- srafis/skills★ 2same name
- DaeSeokSong/oh-my-ouroboros★ 1same name
- gioe/tusk★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository6 other files it gives its agents.
- app-analytics-strategistSkill
- business-plan-advisorSkill
- dreamSkill
- mvp-validatorSkill
- python-architectSkill
- reddit-social-media-strategistSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Use it when the user wants the token count or the API-equivalent cost of their Cowork / Claude Code usage — for one conversation or all of …
- Very specific: line 46
Keep the quotes — the path can contain spaces.
- Very specific: line 68
If the script returns {"status": "unavailable", ...}, it found no transcripts — this happens when it's run outside Cowork or Claude Code.
- Very specific: line 81
If the output lists unknown_models, mention those calls were counted as tokens but priced at $0 because their rate isn't in the table yet …
- Very specific: line 83
If the output lists estimated_models, say so explicitly — those models are newer than the price table, so they were priced with their …
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
cost — Cowork → Claude API cost estimator
Overview
Claude Cowork (and Claude Code) already run on the Claude API and write one JSONL
transcript per conversation under ~/.claude/projects/. Every assistant turn records
the actual API call it made, including the prompt-cache breakdown. This skill reads
those transcripts, sums the real token usage, and prices it at Anthropic list rates
(cache-aware) so a business user can judge what their conversations would cost on the
API instead of the subscription.
It answers three things:
- Token count (current conversation and/or per conversation across history).
- Exact tokens needed to replay the same multi-turn, tool-using conversation on the API.
- Cost of those tokens in USD and EUR, accounting for prompt-cache hits.
When to Use This Skill
Use it when the user wants the token count or the API-equivalent cost of their Cowork / Claude Code usage — for one conversation or all of them — or asks to compare subscription vs API pricing.
How to Run
The worker is cost.py, located in this skill's folder. Run it with the system Python.
- Pick the mode from the request:
- current (default) — the active conversation. Use for "this conversation", "current chat".
- history — every conversation with per-conversation + total cost. Use when the user says "all", "history", "per conversation", "each conversation", "everything".
Run the script with
--jsonso you can render the result yourself:python "${CLAUDE_SKILL_DIR}/cost.py" --mode current --jsonpython "${CLAUDE_SKILL_DIR}/cost.py" --mode history --jsonKeep the quotes — the path can contain spaces. If the command above still shows a literal
${CLAUDE_SKILL_DIR}, your surface doesn't substitute it:cost.pysits in the same folder as thisSKILL.md, so locate it with Glob (**/cost/cost.py) and run the path you find.Options:
--rate-eur 0.92— EUR per 1 USD (approximate, editable). Pass a current rate if the user gives one.--include-subagents— also count subagent API calls (more complete cost). Use it when the user wants the full picture or asks about agents/subagents.
Render the JSON as a short English report. Show the token breakdown (uncached input / cache read / cache write / output / total) and the cost in USD and EUR. In history mode, present a ranked table (most expensive first) with a TOTAL row.
Money formatting — always use exactly two decimals. Each cost object carries ready-to-render strings: use
usd_display(e.g.$1.23) andeur_display(e.g.€1,13) verbatim. The euro figure uses a comma as the decimal separator. Do not re-derive the amounts from the numericusd/eurfields.
Graceful Fallback (run outside Cowork / Claude Code)
If the script returns {"status": "unavailable", ...}, it found no transcripts — this
happens when it's run outside Cowork or Claude Code. Do not invent numbers. Relay the
message field kindly and verbatim in tone: explain that transcripts only exist inside a
Cowork / Claude Code session, and invite the user to run it from there. Keep it friendly,
not an error.
Reporting Notes (always include briefly)
- The figures are the actual API calls the conversation made, priced at Anthropic list rates including prompt-cache discounts (cache read ≈ 0.1×, 5-min write 1.25×, 1-hour write 2× of base input) — not an estimate.
- This is the API pay-per-token cost; the Cowork/Claude subscription bills differently, so treat it as a comparison, not your actual invoice.
- If the output lists
unknown_models, mention those calls were counted as tokens but priced at $0 because their rate isn't in the table yet (add them toPRICESincost.py). - If the output lists
estimated_models, say so explicitly — those models are newer than the price table, so they were priced with their series' most recent known rate (e.g. "claude-opus-5-1was priced at theclaude-opus-5rate because it's newer than the table"). Their cost is included in the total, so without this caveat a fallback estimate reads as a confirmed figure. - In Cowork,
--mode historysees only the current conversation — the sandbox exposes just the active session's project folder, not the whole archive. Say so instead of presenting one conversation as the user's full history. Claude Code sees everything. - Current rates are verified in the
claude-apiskill. Before adding a row toPRICES, look the rate up there rather than guessing.
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.

