← ClaudeAtlas

finops-usage-extractorlisted

Extracts per-session and per-subagent agent token-spend from local Claude Code session data into the operator-local, git-ignored FinOps usage store (schema authority: core/schemas/finops-usage-store-schema.md). Exact message.usage counts are primary; the context-budget-auditor skill's ceil(words/0.75) heuristic is the fallback for usage-less records only. Read-only on the source transcripts — writes only the resolved store. It also attributes and rolls per-session spend up to its owning work item (milestone-grain reliable; unattributed fail-visible) with a coverage metric. Distinct from context-budget-auditor, which measures STATIC corpus footprint; this measures RUNTIME session spend. Use to populate or refresh token-usage data, or to attribute and roll it up, for FinOps reporting. Triggers: "extract token usage", "refresh the finops store", "how much token spend", "run the finops extractor", "roll up token usage", "attribute token spend", "which work item spent the tokens".
cody-hutson/pmo-platform · ★ 0 · Data & Documents · score 62
Install: claude install-skill cody-hutson/pmo-platform
<!-- 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 Two phases over one source (the local session store), one skill: - **Extraction + normalization (C1).** `extract-usage.sh` parses local Claude Code session transcripts into the frozen **v1.0.0** store (`meta` / `session` / `subagent` record kinds; `provider` reserved-optional). Exact `message.usage` counts are primary; the word→token heuristic is the usage-less fallback. - **Attribution + roll-up (C2).** `rollup-attribution.sh` reads that store and writes the additive **v1.1.0** `rollup` + `coverage` records: it resolves each `session` to its owning work item, rolls per-session spend up to that w