← ClaudeAtlas

discovery-token-usagelisted

Cross-domain / Research platform observability — Mine a Discovery App workspace's .discovery/ exhaust for token usage across engines (Clio / Science Engine, copilot-cli / Mission Control / Generic Copilot), models, and interactive chat. Produces a console read-out by default; can also emit a markdown report on request. Cost / billing-multiplier data is a FEATURE FLAG — never surface it unless the user explicitly asks ("with cost", "include cost", "--with-cost", "premium units"). Handles seven data-quality traps (double-emitted stderr, corrupt journal appends, cumulative checkpoints, router duplicates, cached-read-in-realInput, etc). WHEN: "token usage", "how many tokens", "tokens in/out", "Discovery exhaust", "engine spend", "Clio vs copilot-cli", "mine .discovery/", "engine token read-out", "which model used the most tokens", "prompt inventory", "session_shutdown metrics", "TokenJournal".
timothymeyers/discovery-tools · ★ 1 · AI & Automation · score 70
Install: claude install-skill timothymeyers/discovery-tools
# discovery-token-usage — Discovery App Token Miner Mine `.discovery/` exhaust from any Discovery workspace and produce a comprehensive read-out of token usage across engines, models, and interactive chat. ## When to use Trigger when the user asks anything like: - "Review token usage in this Discovery workspace" - "How many tokens did the science-engine burn?" - "Give me a read-out of tokens by model / by engine" - "Mine .discovery/ for token info" - "Compare Clio vs copilot-cli spend" - "What prompts did the engines run?" - "Show me the TokenJournal / SESSION_SHUTDOWN metrics" Do NOT trigger for: - General Azure or GitHub Copilot billing questions (no `.discovery/` involved) - Interactive-only chat token questions divorced from Discovery App ## Vocabulary (be precise when the user asks) Discovery emits telemetry at three different granularities. The miner output uses these terms exactly: | Term | Means | Source | Typical ratio | |---|---|---|---| | **run** | One engine execution (like "Complete DX-3 subtree") | `engine-runs/*/meta.json` | 1 | | **SDK call** | Clio entering the Copilot SDK once | `clio-stderr.log` (1 line per invocation) | ~10 per run | | **msg** | One `ASSISTANT_MESSAGE` event (per-model attribution comes from these) | `conversation_history.json` | ~40 per SDK call | | **API req** | One HTTP request to a model (used for `--with-cost` × static multiplier) | `SESSION_SHUTDOWN.ShutdownModelMetric.requests.count` | ~10 per SDK call | | **prompt** | One