← ClaudeAtlas

finops-usage-extractorlisted

Extracts per-session and subagent token-spend from local Claude Code sessions into the operator- local, git-ignored FinOps usage store, rolls it up to its work item, reports windowed spend and trends by work item, worktree, skill, MCP and model, and ESTIMATES a planned item's token cost from historical comparables — with a stated basis and confidence, declining below three comparables rather than implying false precision. Read-only; every figure carries its provenance and prints to stdout. Distinct from context-budget-auditor, which measures STATIC corpus footprint; this measures RUNTIME session spend. Triggers: "extract token usage", "refresh the finops store", "how much token spend", "run the finops extractor", "roll up token usage", "attribute token spend", "report token spend", "finops report", "spend by work item", "token spend trend", "where did the tokens go", "estimate token cost", "how many tokens will this take", "finops estimate", "token budget for this work item", "estimate vs actual token spend".
cody-hutson/pmo-platform · ★ 0 · AI & Automation · score 62
Install: claude install-skill cody-hutson/pmo-platform
<!-- reference-durability: allow-link --> <!-- repo-integrity: allow-issue-ref --> # finops-usage-extractor ## Purpose Read-only extraction of runtime token spend from local Claude Code session transcripts into the operator-local usage store defined by `core/schemas/finops-usage-store-schema.md`. It sums each session's exact `message.usage` token dimensions (input / output / cache-write with tier split / cache-read) plus tool-use request counts and the cost-determining `service_tier`, and normalizes them into a versioned JSONL derived cache. Exact source counts are authoritative; the context-budget-auditor skill's `ceil(words/0.75)` heuristic is the fallback for records that lack `message.usage`. This skill measures **runtime session spend** — distinct from context-budget-auditor, which measures **static corpus footprint**. It reuses that skill's estimation *method* (the word→token fallback), not its scanner. ## Scope Four phases over one source (the local session store), one skill: - **Extraction + normalization (C1).** `extract-usage.sh` parses local Claude Code session transcripts into the **v1.2.0** store (`meta` / `session` / `subagent` record kinds; `provider` reserved-optional). Per the data-minimization control at v1.2.0, the `session` record persists `worktree` — the working-directory **basename** — and never the full absolute path. Exact `message.usage` counts are primary; the word→token heuristic is the usage-less fallback. v1.2.0 also adds five **session-gr