sw-analytics

star 147

Analytics and metrics for SpecWeave usage — token consumption, cache efficiency, agent spawn counts.

anton-abyzov By anton-abyzov schedule Updated 4/27/2026

name: sw/analytics description: "Analytics and metrics for SpecWeave usage — token consumption, cache efficiency, agent spawn counts." version: 1.0.0 allowed-tools: Read, Bash

Tool-Use Rationale

  • Read: Load metrics snapshots, increment history, and config to compute analytics.
  • Bash: Run specweave metrics CLI commands to gather live telemetry data.

Usage

sw:analytics [--cache-stats] [--spawn-count] [--token-usage]

--cache-stats

Displays prompt cache hit rates per skill for the current session.

Output format:

Cache Statistics (current session)
───────────────────────────────────
sw/grill         hit rate: 78% (1,240 tokens from cache)
sw/judge-llm     hit rate: 65% (980 tokens from cache)
sw/code-reviewer hit rate: 82% (1,560 tokens from cache)
───────────────────────────────────
Overall:         hit rate: 75%

Requirements:

  • Cache must be enabled (cache.staticContextFiles non-empty in config)
  • Minimum 2 invocations per skill for meaningful hit rate

Enable persistent metrics: Set analytics.cacheMetrics.enabled: true in .specweave/config.json.

--spawn-count

Reports agent spawn counts per team session. Use to verify that Opus 4.7 fan-out reduction is working (target: ≤ 50% of pre-1.1.0 baseline).

--token-usage

Reports total token consumption per skill across the session.

Install via CLI
npx skills add https://github.com/anton-abyzov/specweave --skill sw-analytics
Repository Details
star Stars 147
call_split Forks 18
navigation Branch main
article Path SKILL.md
More from Creator
anton-abyzov
anton-abyzov Explore all skills →