cost-measurement

cost-measurement is a skill for Claude Code, Codex from gaia-research/gaia-skill-heaven. It costs 62 tokens per session (1,171 once invoked), scanned A, original, MIT.

A tool for measuring how many language-model tokens and how much money a coding-agent session, worker, or benchmark uses.

In plain words
What is it for?
Use it to measure session spend, report token usage, compare benchmark approaches, or record the cost of dispatched workers.
Why use it?
It provides a consistent basis for reporting spending and comparing the cost of different ways of doing work.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: reads .claude/ paths; mentions subagents; mentions Claude Code.

Good fit Use it to measure session spend, report token usage, compare benchmark approaches, or record the cost of dispatched workers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gaia-research/gaia-skill-heaven/cost-measurement
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add gaia-research/gaia-skill-heaven --skill cost-measurement
Clone the repo
git clone --depth 1 https://github.com/gaia-research/gaia-skill-heaven

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for cost-measurement

README.md
[![agentmods](https://agentmods.dev/badge/skills/gaia-research/gaia-skill-heaven/cost-measurement/github.svg)](https://agentmods.dev/skills/gaia-research/gaia-skill-heaven/cost-measurement)
Your own site
<a href="https://agentmods.dev/skills/gaia-research/gaia-skill-heaven/cost-measurement"><img src="https://agentmods.dev/badge/skills/gaia-research/gaia-skill-heaven/cost-measurement/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for cost-measurement

Your own site · 80×15
<a href="https://agentmods.dev/skills/gaia-research/gaia-skill-heaven/cost-measurement"><img src="https://agentmods.dev/badge/skills/gaia-research/gaia-skill-heaven/cost-measurement.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,171 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00062 $0.01171
Opus 5.5 $0.00025 $0.00468
Sonnet 5.5 $0.00012 $0.00234
Haiku 4.5 $0.00006 $0.00117

Measured 1mo ago against content hash 9beb1f360772, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cost-measurement scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/core/skills/cost-measurement/SKILL.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cost Measurement

gaia-research/skill-cost is the canonical basis for every cost measure in the Gaia ecosystem. Do not hand-roll token accounting, do not read harness JSONL yourself, and do not quote a price from memory. If a number is going into a report, it comes from here.

Repo: https://github.com/gaia-research/skill-cost · registry id gaia-research/skill-cost


Why this and not self-reported numbers

skill-cost reads the session logs the harness actually wrote and prices every turn against BerriAI/litellm's canonical model_prices_and_context_window.json, refreshed weekly. That means:

  • Numbers are persisted usage, not a model's guess about its own consumption.
  • Cache reads and cache writes are counted separately — which matters enormously, since cache reads routinely dominate total tokens and are priced very differently.
  • Every harness is priced the same way, so cross-harness arms are comparable.

Asking a model how many tokens it used produces confabulation. Reading the log does not.


Supported harnesses

Harness Session storage
pi ~/.pi/agent/sessions/**/*.jsonl
Claude Code ~/.claude/projects/**/*.jsonl
OpenAI Codex ~/.codex/sessions/**/*.jsonl
opencode ~/.local/share/opencode/**/*.jsonl
Hermes Agent $HERMES_HOME/state.db (SQLite, read-only; usage tables only, never transcripts)

Known gap: Grok is not supported. If a Grok arm needs pricing, that is a parse_grok function in cost.py — adding a line-oriented harness is one small parser. The repo is part of our ecosystem and may be extended when a gap blocks a measurement.


Run

cd ~/skill-cost

python3 cost.py                          # newest logical session across all harnesses
python3 cost.py --latest                 # latest session per harness in cwd
python3 cost.py --today --by-model       # today, per-model breakdown
python3 cost.py --all --list             # one line per session, everything
python3 cost.py --since 2026-08-01 --harness claude-code
python3 cost.py --cwd "$PWD"             # only sessions rooted at this directory
python3 cost.py --session 019f4e66       # substring match on session id
python3 cost.py --json                   # machine-readable
python3 cost.py --offline                # no network; use bundled prices.json

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 121 lines · 62 tokens per session scan A 9beb1f360772

Subscribe to this mod's changes

cost-measurement is a skill published in the GitHub repository gaia-research/gaia-skill-heaven (4 stars, last pushed today), licensed MIT. It adds 62 tokens to every session and 1,171 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

architecture-compass

Architectural thinking partner for an existing repository — scans the codebase, conducts a structured interview, agrees on current architectural state and recommended direction, and produces a shareable insights document. Scoped to one repository, module, or folder. Does not execute transformation — it orients. Use…

techygarg/lattice · 114 tokens

skill-review

Deep behavioral audit of a Lattice skill — proposes 3 review personas relevant to the skill, runs independent scenario analysis from each persona's perspective, then merges only the high-confidence, practical findings into a severity-ordered gap report with proposed fixes. Structural validation (conventions…

techygarg/lattice · 180 tokens

architecture-refiner

Facilitate a structured conversation to define architecture principles for a repository. Supports multiple architecture styles: clean architecture (default), hexagonal / ports & adapters, modular monolith, or custom. Produces a formal architecture document that the corresponding atom will use. Use when setting up a…

techygarg/lattice · 114 tokens

clean-code-refiner

Facilitate a structured conversation to define clean code principles for a repository. Produces a formal clean-code.md document that the clean-code atom will use as its override. Use when setting up coding standards, defining code quality rules, or when the user says 'setup clean code', 'define coding standards'…

techygarg/lattice · 84 tokens

review-refiner

Facilitate a structured conversation to customize how the review molecule works -- atom loading rules, severity classification, report format, scope rules, insight capture, and health logging. Produces a formal review-standards.md document that the review molecule will use as its process configuration. Use when the…

techygarg/lattice · 92 tokens

review

Perform a structured code review by composing validation checklists from relevant atoms based on what code changed. Loads atoms conditionally -- clean-code always, architecture/DDD/security/tests only when the delta touches their domain. Produces a severity-ordered report with specific locations and fixes. Use when…

techygarg/lattice · 95 tokens