Meter Chargeback
CocoMeter chargeback and FinOps governance.
Install
npx skills add Snowflake-Labs/cocoplus --skill meter-chargeback -g -a claude-code -y- Repository
- Snowflake-Labs/cocoplus727
- Category
- Business
- Updated
- 1mo ago
- License
- MIT
- Context cost
- Lightabout 751 tokens
- Runs scripts
- No, instructions only
What it does
CocoMeter chargeback and FinOps governance. Usage: $meter chargeback refresh | $meter chargeback invoice | $meter chargeback onboarding
CocoMeter Chargeback
Use this skill for $meter chargeback refresh, $meter chargeback invoice, and $meter chargeback onboarding.
Before proceeding, verify that .cocoplus/ exists. If not, output: "CocoPlus not initialized. Run $pod init first." Then stop.
Source Rules
CocoMeter chargeback reads token/inference usage from Snowflake's Cortex Code usage history surfaces and, when enabled, warehouse compute from query attribution history. Treat the chargeback fact table as governance evidence, not a cosmetic dashboard:
- Token credits come from the Cortex Code CLI, Desktop, and Snowsight usage history surfaces.
- Warehouse credits join through
query_tag.appandQUERY_ATTRIBUTION_HISTORY.CREDITS_ATTRIBUTED_COMPUTE. includeWarehouseincocoplus.tomlcontrols whether warehouse credits are included.SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTSCodingAgent.Step-0spans are used for near-real-time observability when present.- Exclude
SYSTEM, sandbox runs, and background metadata-query traffic.
$meter chargeback refresh
Run a 35-day trailing delete/insert refresh. On first setup, load 60 days. Schedule the Snowflake task for 06:00 UTC daily.
For local validation or dry-run fixtures, use:
invoke cocometer/chargeback-refresh --input <fixture.json>
The applies the same deterministic rules used by the warehouse implementation:
- Strip
<system-reminder>...</system-reminder>blocks before prompt persistence. - Extract SQL from tool argument arrays.
- Resolve cost centers in this order: explicit user map, user object tag, role map,
UNMAPPED. - Produce invoice-ready per-user totals.
$meter chargeback invoice
Generate one HTML and one CSV invoice package per user from the refreshed chargeback facts. Each invoice must include token credits, warehouse credits when included, total credits, credit-rate amount, cost center, and unmapped status.
$meter chargeback onboarding
Report setup readiness:


