From product
Estimates token usage and USD cost of running the architect pipeline on a codebase. Combines a-priori model from lines-of-code with measured actuals. Invoke with /architect:estimate-token-cost [target_path].
How this skill is triggered — by the user, by Claude, or both
Slash command
/product:estimate-token-costsonnetThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Produce a defensible estimate of the **LLM token cost** of running the architect
Produce a defensible estimate of the LLM token cost of running the architect pipeline (investigation → analysis → evaluation → design → review → report, plus any manual-extension-tier skills) against a target codebase and/or design documents.
This is distinct from /architect:estimate-cost, which estimates cloud infrastructure,
ScalarDB licensing, and operational costs. This skill estimates the cost of running the
agent itself.
@skills/common/references/model-pricing.json — per-model prices (per 1M
tokens), cache multipliers, and the a-priori estimation heuristics. Never hardcode
prices in the report; read them from this file so estimates track pricing updates.work/token-usage.json, maintained by
the record_token_usage.py hook during real runs (per-phase, per-model billed tokens
and USD). Use it to calibrate or replace a-priori numbers.Gather (via AskUserQuestion, or infer from the target when possible):
cloc/tokei if available, else
find . -name '*.<ext>' | xargs wc -l), and the size of any design documents.work/token-usage.json exists — calibrate from actualsby_model billed tokens and cost_usd.skill-dependencies.yaml phase list and the code-heaviness of each phase).Using estimation_heuristics from the pricing file:
raw_code_tokens = LOC × tokens_per_loc (+ design-doc tokens).unique_ingested = raw_code_tokens × code_ingestion_ratio (structural tools/sampling
cover the rest — the agent does not read every line).effective_input = unique_ingested × effective_input_multiplier (cache-adjusted billed
input across the multi-turn pipeline; prompt-cache reads bill at 0.1×).output_tokens ≈ output_per_phase_tokens × phase_count.phase_model_tier and sum. Report typical, low, and
high bands by sweeping the low/typical/high heuristic values.The heuristics are uncalibrated defaults — until real runs populate
work/token-usage.json, present the estimate as a wide band (the high/low spread can be
3×) and say so explicitly in the report. After a few recorded runs, recommend updating
the heuristic values in model-pricing.json from observed ratios.
Always include: model mix, cache effectiveness, code-ingestion ratio, and scope (core vs
full). Give concrete reduction levers (staged execution, tier down simple phases to
haiku, narrow target_path, keep the prompt prefix stable for cache hits).
Write the report in the language configured in work/pipeline-progress.json
(options.output_language), defaulting to en.
| File | Content |
|---|---|
reports/05_estimate/token-cost-estimate.md | Assumptions, per-phase token & cost table (typical/low/high bands), calibration source (a-priori vs measured), cost drivers, and reduction levers |
Frontmatter per @rules/output-conventions.md. Show tokens and cost; if the billing
model is a subscription, lead with token consumption and mark USD as reference-only.
| Skill | Relationship |
|---|---|
| /architect:estimate-cost | Sibling — infrastructure/license/operational cost (not token cost) |
| /architect:init-output | Creates work/, which enables the token-usage recorder |
| /architect:pipeline | The run whose token cost this skill estimates and whose actuals it calibrates against |
npx claudepluginhub wfukatsu/nexus-architect --plugin scalardbEstimates token usage, costs across Haiku/Sonnet/Opus, complexity levels, and time for features by analyzing codebase files/lines via Glob/Read/Grep. Use for pre-implementation planning.
Estimates token counts and costs for LLM content using local heuristics, with before/after comparisons to quantify optimization savings and decide if an optimization is worthwhile.
Predicts the dollar cost of a coding task across Opus, Sonnet, and Haiku models using heuristic math with no LLM calls. Shows per-model estimates with confidence bands and model recommendations.