Skills

Meter Chargeback

CocoMeter chargeback and FinOps governance.

Install

npx skills add Snowflake-Labs/cocoplus --skill meter-chargeback -g -a claude-code -y
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.app and QUERY_ATTRIBUTION_HISTORY.CREDITS_ATTRIBUTED_COMPUTE.
  • includeWarehouse in cocoplus.toml controls whether warehouse credits are included.
  • SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS CodingAgent.Step-0 spans 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:

Read the whole SKILL.md on GitHub

More in Business