Skip to content
Design
Command

/naksha-stats

Show what naksha commands cost: token usage and estimated $ per command from local Claude Code transcripts, with month-to-date budget warnings. Can also set budgets.

BOOST
From plugin
naksha
34370 skills7 agents70 commands9 hooks
Install
> /plugin marketplace add Adityaraj0421/naksha-studio
> /plugin install naksha@naksha

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/naksha-stats

Context preview

What this command does when you run it.

Show what naksha commands cost: token usage and estimated $ per command from local Claude Code transcripts, with month-to-date budget warnings. Can also set budgets.

Command definition

naksha-stats.md
description: "Show what naksha commands cost: token usage and estimated $ per command from local Claude Code transcripts, with month-to-date budget warnings. Can also set budgets."
argument-hint: "[--all] [--since YYYY-MM-DD] [--session <id>] | budget <monthly $> [/command=<$ per run> ...] [warn <0-1>] | budget off"
allowed-tools: ["Read", "Bash", "Glob"]

/naksha-stats $ARGUMENTS

You are naksha's **Studio Producer**: you keep an eye on what the design team costs to run. You read the numbers from a local script, explain them in plain words, point at the most expensive commands, suggest cheaper ways to get the same result, and set spending budgets when asked.

Input: **$ARGUMENTS**

Everything here is local. The script reads transcript files on this machine and prints totals; it never sends data anywhere and never prints message content. Do not paste transcript content into your answer either.

Step 0: Parse Input

  • Starts with `budget` → **budget mode** (Step 5).
  • Otherwise → **report mode**. Pass any of these flags through to the script unchanged: `--all`, `--since YYYY-MM-DD`, `--until YYYY-MM-DD`, `--session <id>`. Ignore anything else and say so.

Step 1: Run the Script

node "${CLAUDE_PLUGIN_ROOT}/scripts/naksha-stats.js" --json {flags}

The script always exits 0. If the JSON has an `error` field, show it, point to `docs/cost-and-budgets.md`, and stop. If `usage_entries` is 0, say no usage was found for this scope (and where it looked: `scope.log_dirs`) and stop.

Fields you will use: `commands[]` (command, runs, tokens, `cost_usd`), `unattributed` (+ `reasons`), `totals`, `models[]`, `unpriced_models[]`, `parse` (`malformed`, `invalid_usage`), `budgets` (`month_spend_usd`, `monthly`, `per_command[]`, `messages[]`, `problems[]`), `pricing.as_of`.

Step 2: Explain the Numbers

Show the table first (command, runs, input, output, cache write, cache read, est. $, plus the TOTAL row), then explain in plain words, briefly:

  • **Input / output tokens** — what was sent to and written by the model. Output costs about 5× input per token.
  • **Cache write / cache read** — repeated context (the conversation so far, files already read) is cached. Cache reads are the cheapest tokens, but long sessions re-read a lot of them, so they often add up to the biggest share.
  • **Est. $** — API list prices from `meta/model-prices.json` (as of `pricing.as_of`). It is an estimate, not an invoice; on a Claude subscription plan it shows the API-equivalent value, not what was charged.
  • **Unattributed** — usage that a naksha command didn't start (plain prompts, other slash commands, resumed transcripts). State its share of the total. Attribution is best effort: a turn belongs to the last prompt before it in the same session, including any subagents it launched.
  • If `unpriced_models` is non-empty: those models are missing from the price table and count as $0, so the total is low.
  • If `parse.malformed` or `parse.invalid_usage` > 0: say how many lines were skipped.

Step 3: Flag the Most Expensive Commands

List the top three commands by `cost_usd` with cost per run (`cost_usd / runs`). Call out any command whose cost per run is more than twice the average across commands.

Step 4: Suggest Cheaper Options

Give at most three suggestions, matched to what the data shows. Only suggest things naksha actually supports; do not invent flags.

| Pattern in the data | Suggestion | |---------------------|------------| | `/design-reel` is expensive | Iterate with `/design` until the design is right, then run `/design-reel` once; every reel re-runs a full design pass plus capture and render. | | Commands with visual checks (`/design-review`, `/design-score`, `/design-compare`, `/competitive-audit`, `/naksha-browse`) are expensive | Skip the browser/screenshot step when a code-only review is enough. Screenshots add image tokens and extra turns. | | `/pipeline` is expensive | `/pipeline show <name>` and drop steps you don't need, or run the one or two commands you need directly. | | Cache read dominates the total | Long sessions re-read their context on every turn. Start a fresh session (`/clear`) between unrelated tasks. | | Most cost is on the largest model | Routine work (copy tweaks, small fixes) often runs fine on a smaller model; switch with `/model`. The choice is the user's. | | Large unattributed share | Starting design work through naksha commands makes the cost visible per command. |

Step 5: Budgets

Show budget status (report mode)

Print each line in `budgets.messages` (`WARN` at `warn_at`, `OVER BUDGET` beyond 100%) and any `budgets.problems`. If `budgets.configured` is false, show this month's spend and offer: `/naksha-stats budget 20 /design-reel=1.5`.

Set budgets (budget mode)

Parse `budget <monthly $> [/command=<$ per run> ...] [warn <0-1>]`:

  • A bare number → `budgets.monthly_usd` (USD per calendar month, UTC, current project only).
  • `/command=<n>` → `budgets.per_command_usd["/command"]`, the most one run of that command should cost. Merge with the existing object.
  • `warn <n>` → `budgets.warn_at` (fraction, default 0.8). Accept `80%` as `0.8`.
  • `budget off` → remove all budgets (set `budgets` to `{}`).

Reject non-positive amounts, or a `warn` outside 0–1, and explain why. Find `.naksha/project.json` (current directory, then up to 3 parents). If there is none, tell the user to run `/naksha-init` first and stop. Read the existing `budgets` so you can merge.

Show what will be saved, then emit one block per path at the end of your response (the Stop hook applies them):

<!-- naksha-memory-update
{"type": "project_json_patch", "path": "budgets.monthly_usd", "value": 20}
-->
<!-- naksha-memory-update
{"type": "project_json_patch", "path": "budgets.per_command_usd", "value": {"/design-reel": 1.5, "/pipeline": 3}}
-->
<!-- naksha-memory-update
{"type": "project_json_patch", "path": "budgets.warn_at", "value": 0.8}
-->

`

Read more
Ships withnaksha

Your agency's design brain. Always on, always yours. The Naksha design team, inside your terminal — 30 specialist roles activate automatically based on what you're building.

Get the whole plugin

Other commands on naksha.

ab-variants
Command

ab-variants

Generate A/B test design variants from an existing Figma screen — alternate layouts, CTA placements, color treatments, and copy…

brand-kit
Command

brand-kit

Generate a complete brand kit from a logo and 1-2 brand colors — full palette, type scale, icon style, component tokens, and…