Skip to content
Back to skills

Cocometer

ASecurity

Enable CocoMeter token and credit tracking for this session. Creates tracking state in .cocoplus/meter/ and activates per-tool token capture via post-tool-use hook.

  • 724 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 5, 2026
ai-agentsshell

Security analysis

A100/100

Pro scans all 20 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add Snowflake-Labs/cocoplus --skill cocometer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cocometer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cocometer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/snowflake-labs-cocometer-1dc5b452/badge)](https://www.skillsdirectory.com/skills/snowflake-labs-cocometer-1dc5b452)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "meter-on"
description: "Enable CocoMeter token and credit tracking for this session. Creates tracking state in .cocoplus/meter/ and activates per-tool token capture via post-tool-use hook."
version: "1.0.0"
author: "CocoPlus"
tags:
  - cocoplus
  - cocometer
  - tracking
---

Your objective is to enable CocoMeter token tracking.

## Pre-flight Check

Check that `.cocoplus/` directory exists. If not, output:
"CocoPlus not initialized in this directory. Run `$pod init` to begin."
Then stop.

## Check Current State

Check if `.cocoplus/meter/current-session.json` exists and has `"metering_active": true`.

If metering is already active, output:
"CocoMeter is already active for this session. Use `$meter` to see current usage."
Then stop.

## Enable Metering

1. Create or update `.cocoplus/meter/current-session.json`:
```json
{
  "session_id": "<sess-YYYYMMDD-HHMMSS>",
  "started_at": "<ISO 8601 timestamp>",
  "metering_active": true,
  "input_tokens": 0,
  "output_tokens": 0,
  "tool_calls": 0,
  "model_breakdown": {},
  "actions": []
}
```

2. Ensure `.cocoplus/meter/` directory exists (create if not).

3. Ensure `.cocoplus/meter/history.jsonl` exists (create empty if not).

## Confirm Activation

Output:
```
CocoMeter enabled.

Token tracking is now active for this session.
- Input and output tokens will be captured per tool call
- Use `$meter` to see current usage
- Use `$meter estimate <action>` to get a pre-flight estimate
- Use `$meter history` to see past sessions

Note: Token counts are estimates based on hook-captured data.
Actual Snowflake Cortex billing may differ.
```

## Anti-Rationalization

| Shortcut / Temptation | Why It Fails |
|-----------------------|--------------|
| Skip checking if metering is already active before enabling | Starting a second session while one is active would reset the current session ID, losing in-progress tracking data |
| Create session JSON without creating the `meter/` directory first | Writing to a non-existent directory fails silently in some shells; always ensure the directory exists |

## Exit Criteria

- [ ] `.cocoplus/meter/current-session.json` exists with `"metering_active": true` and a valid `session_id` in `sess-YYYYMMDD-HHMMSS` format
- [ ] `.cocoplus/meter/history.jsonl` exists (created if absent)
- [ ] Output confirms metering is enabled with usage commands listed

Files in this skill

  • archetype-classifier.skill.md1.5 KB
  • chargeback-refresh.skill.md1.5 KB
  • cost-center-resolver.skill.md1.5 KB
  • invoice-generator.skill.md1.5 KB
  • meter-accuracy.skill.md2.3 KB
  • meter-benchmark.skill.md1.3 KB
  • meter-chargeback.skill.md3.2 KB
  • meter-compare.skill.md4.1 KB
  • meter-estimate.skill.md3.4 KB
  • meter-history.skill.md1.9 KB
  • meter-invoice.skill.md1.5 KB
  • meter-off.skill.md2.3 KB
  • meter-on.skill.md2.3 KB
  • meter-reconcile.skill.md4.1 KB
  • meter-refresh.skill.md1.5 KB
  • meter-report.skill.md3.5 KB
  • meter-status.skill.md1.5 KB
  • meter-sync.skill.md2 KB
  • meter-verify.skill.md1.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…