cost-ledger
What it does
This skill reads the usage logs that AI coding tools already keep on your computer and shows spending, tokens and cache use for each provider. It is for people who use more than one AI tool and want one view.
When to use it
- ✓When you ask how much you have spent on AI tools this week.
- ✓When you want to compare the cost of Codex and Claude Code.
- ✓When you want to see which models do not have a price yet.
Skill link
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-ledger/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“What did I spend on AI coding tools this week across all providers?”
5 new skills a week. 1 minute to read.
How it works
The skill reads the local logs, prices the usage from a dated price list and shows the totals. Models without a price are listed separately instead of being counted as free.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Cost Ledger
Reads the logs the agents already wrote (~/.claude/projects, $CODEX_HOME or ~/.codex) and prices them from data/prices.json (dated, editable).
Run
node ${CLAUDE_PLUGIN_ROOT}/scripts/ledger.mjs --since 7d
node ${CLAUDE_PLUGIN_ROOT}/scripts/ledger.mjs --provider codex --format json
One mission, or one project
--from and --to (ISO times) cut the window and --project <absolute path> keeps one project's rows; the console's mission page uses them for a mission's spend. An explicit --from/--to replaces the default 7-day look-back.
Read the result correctly
- USD and Codex credits are never added. GPT-6 Codex models are priced in credits; their cached-input rate is unpublished, so the figure is an upper bound.
- Estimates at list price, not bills. Subscriptions bill by window, not by token.
/usageis authoritative for the live Claude session; the Console or provider dashboard is authoritative for invoices. - Unpriced models are listed, never counted as $0. Say so, and offer to add them to
data/prices.json. - Counting rules (why numbers differ from naive sums): Claude messages are de-duplicated by
message.id + requestId; Codex uses deltas of the runningtotal_token_usage(never alsolast_token_usage), cached input is a subset of input, and forked rollouts are de-duplicated. - Claude transcript output tokens can under-count streamed output.
If the log directory is missing, say so; do not invent numbers.
FAQ
Is my data sent anywhere?
The skill uses local logs only, and nothing is sent. The costs are estimates at list price, not bills.
Why do the dollar and credit totals not add up?
Codex credits and US dollars are never added together, because they are different units.
Can I look at one project only?
Yes. A project setting limits the figures to one project folder, and a time range can be set too.
Details
Original description by the author
One cost view across Claude Code, Codex and Grok on this machine — spend, tokens, cache hit ratio per provider and model, with unpriced models flagged. Use when asked "what did I spend", "how much did Codex cost", or to compare providers. Local logs only, nothing is sent.
repo: ruvnet/ruflo
Popularity
- GitHub stars
- 81k
- Ranking position
- #1603
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
agent-adaptive-coordinator
81kHelps your agent split and rebalance a group of AI agents as the workload changes, choosing a layout that fits the task.
agent-agent
81kTeaches your agent to turn a big goal into an ordered plan of actions, and to replan when conditions change.
agent-agentic-payments
81kHelps your agent manage spending mandates for AI shopping, with spend caps, time windows, merchant rules and signed approvals.
agent-analyze-code-quality
81kHelps your agent review code for quality, finding code smells, technical debt and refactoring ideas without changing the files.
Similar skills
blucli
394kHelps your agent find, play, pause, group, and adjust the volume of Bluesound and NAD speakers through the blu command.
camsnap
394kHelps your agent grab snapshots, short clips, or motion events from network cameras and local webcams that you have set up.
eightctl
394kHelps your agent check and control an Eight Sleep pod, including its temperature, alarms, and sleep schedules.