plugins/cc-usage/skills/cc-usage/SKILL.md
Analyze Claude Code token usage, costs, billing blocks, and tool activity from local session data. TRIGGER WHEN: the user asks about their usage, costs, burn rate, or wants a usage dashboard/report. DO NOT TRIGGER WHEN: the task is outside the specific scope of this component.
npx skillsauth add acaprino/anvil-toolset cc-usageInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Analyze Claude Code session data to generate usage reports with token counts, cost estimates, billing block tracking, tool usage stats, and per-project breakdowns.
Inspired by paulrobello/par_cc_usage.
Claude Code stores session data as JSONL files in:
~/.config/claude/projects/ (Linux/macOS primary)~/.claude/projects/ (legacy Unix)%USERPROFILE%\.claude\projects\ (Windows, default)CLAUDE_CONFIG_DIR env var (all platforms)The script parses these files, extracts assistant message token usage, deduplicates by request ID, and computes:
Run the analysis script:
python plugins/cc-usage/skills/cc-usage/scripts/cc_usage.py
| Flag | Description |
|------|-------------|
| -d, --days N | Number of days to analyze (default: 7) |
| -p, --project NAME | Filter by project name (substring match) |
| --no-block | Hide current billing block section |
| --no-projects | Hide project breakdown |
| --no-tools | Hide tool usage stats |
| --no-sessions | Hide recent sessions list |
| -n, --top N | Number of top items per section (default: 10) |
| --json | Output raw JSON instead of formatted markdown |
# Last 7 days, full report
python cc_usage.py
# Last 30 days, filter to one project
python cc_usage.py -d 30 -p "my-project"
# Quick overview, no details
python cc_usage.py --no-tools --no-sessions -n 5
# Machine-readable JSON output
python cc_usage.py --json
Run this script for the user when they ask about:
Execute via Bash:
python <path-to-script>/cc_usage.py [options]
Then present the markdown output directly to the user -- it renders as formatted tables.
The script reads Claude Code's native JSONL format. Key fields extracted:
message.usage - token counts (input, output, cache_creation, cache_read)message.model - model identifier for pricing tiermessage.content[].type == "tool_use" - tool call trackingcostUSD - native cost field (used when available, falls back to calculated)requestId - deduplication keytimestamp - for time-based analysisPricing is defined in a single source of truth: scripts/cc_usage.py (see the MODEL_PRICING table near the top). To update prices, edit that table -- this document intentionally does not duplicate the numbers to avoid drift.
When costUSD is present in the JSONL data, that value takes priority over calculated estimates.
development
Quality gates for multi-reviewer code review pipelines: adversarial verification panel, completeness critic, reviewer pipeline conventions, and the context sharing pattern for parallel reviewers. TRIGGER WHEN: running /senior-review:team-review quality gates; running /senior-review:code-review Steps 4b/4c (adversarial verification and completeness check); consolidating or deduplicating findings from multiple parallel reviewers. DO NOT TRIGGER WHEN: single-reviewer style review without a consolidation phase, or generic team coordination (the upstream agent-teams skills cover that).
development
Knowledge base for pure-architecture decisions on when to unify duplicated logic into a shared abstraction versus leave it duplicated. Covers the canonical theory (Rule of Three, DRY/WET/AHA, Wrong Abstraction, Locality of Behaviour, Bounded Contexts, Tidy First options framing, CUPID vs SOLID), 12 essential-duplication patterns that justify unification, 12 wrong-abstraction patterns that justify inlining or decomposition, an operational decision frame, and a verified reading list. TRIGGER WHEN: the user is making an architectural decision about whether to centralize, extract, or remove a layer; reviewing an abstraction for premature generality; auditing scattered cross-cutting concerns; spawned by the abstraction-architect agent during /abstraction-architect:audit or as the Abstraction dimension of /senior-review:team-review or /senior-review:code-review; the user asks "should I extract this into a service" / "is this DRY enough" / "is this wrong abstraction". DO NOT TRIGGER WHEN: the task is code formatting and readability cleanup (use clean-code:clean-code), Python-specific refactoring with metrics (use python-development:python-refactor), generic dead-code removal (use senior-review:cleanup-dead-code), security review (use senior-review:security-auditor), or pure pattern-consistency review without an architecture lens (use senior-review:code-auditor).
development
Unified web frontend knowledge base covering CSS architecture, UX psychology, UI components, distinctive aesthetics, and interface design generation. TRIGGER WHEN: working on web styling, design systems, component decisions, responsive strategy, distinctive frontend aesthetics, or exploring multiple interface designs. DO NOT TRIGGER WHEN: the task is purely backend or unrelated to web frontend.
development
Stripe payments knowledge base - API patterns, checkout optimization, subscription lifecycle, pricing strategies, webhook reliability, Firebase integration, cost analysis, and revenue modeling. Loaded by stripe-integrator and revenue-optimizer agents; also consumable directly when the user asks for Stripe-specific patterns without needing an agent. TRIGGER WHEN: working with Stripe API (Payment Intents, Customers, Subscriptions, Checkout Sessions, Connect, webhooks, tax, usage-based billing), pricing strategy, or revenue modeling. DO NOT TRIGGER WHEN: payment work is non-Stripe (PayPal, Square, crypto) or the task is generic e-commerce unrelated to payments.