Skip to content

Metrics and usage

The commands that tell you how your tasks are doing and what they cost, with every flag, period and output field.

7 min read8 pages in CLI reference

These commands answer two questions: how well is the work going, and what is it costing you? metrics gives the numbers behind the dashboard, video-caught marks the times the proof video found a bug nothing else did, limits shows how much of your plan you have used, and usage adds up tokens and cost.

All four run locally and need --workspace. limits and usage read files shared by the whole machine, so for them the workspace only has to be a valid name. The output format and exit codes are on the CLI reference page.

Command What it is for
metrics The dashboard numbers, plus signals that tell you when a feature would pay off.
video-caught Mark that the proof video caught a miss the other checks let through.
limits How much of each provider’s plan limit you have used.
usage Tokens and cost by provider, step and workspace.

metrics prints the numbers the app’s dashboard shows for a workspace: what was delivered, how much of it needed you, how long it took and what it cost. Its two actions, signals and baseline, look at the same runs from another angle and are covered below.

Terminal window
astranize metrics --workspace notes
{"type":"metrics","query":{"period":"30d","repo":null},"generatedAt":"2026-11-20T02:18:21.119Z","range":{"from":"2026-10-21T03:00:00.000Z","to":"2026-11-20T02:18:21.119Z"},"repos":["api"],"headline":{"kind":"empty"},"now":{"orbiting":0,"waiting":1,"oldestWaitingSince":"2026-11-20T02:17:58.173Z"},"streakDays":0,"kpis":{"delivered":{"value":0,"previous":0,"series":[0,0,…]},"autonomy":{"pct":null,"previousPct":null,"autonomous":0,"delivered":0},"leadTime":{"medianMs":null,"previousMedianMs":null,"series":[null,…]},"cost":{"usd":null,"previousUsd":null,"perTaskUsd":null,"tokens":null,"series":[null,…]}},"bucketUnit":"day","buckets":["2026-10-21",…],"deliveries":[{"bucket":"2026-10-21","clean":0,"withReturns":0},…],…}

This line was captured with --period 30d. Without --period, you get the last 7 days.

Terminal window
astranize metrics --workspace notes --period 30d --repo api
Flag Type Default Values
--period string 7d today, 7d, 30d, all. Anything else fails with Unknown period "year".
--repo repo name all repos Only tasks that touch this repo.

The line has these fields:

Field Meaning
query, generatedAt, range What you asked for, when, and the time window. from is null for all.
repos The repos seen in the workspace’s tasks.
headline The one-line story the dashboard leads with. kind is waiting_long, best_period, clean_streak, cost_drop, delivered_delta, delivered or empty.
now Tasks in flight (orbiting), tasks waiting for you, and the oldest wait.
streakDays Days in a row with at least one delivery.
kpis delivered, autonomy (the share delivered without your help), leadTime (median) and cost. Each has the previous period and a per-bucket series.
bucketUnit, buckets, deliveries Day or week buckets, and per bucket the clean deliveries against the deliveries with returns.
funnel How many tasks reached created, specApproved, passedGates, reviewerApproved, videoProved and validated, and the step that loses the most tasks.
calendar Deliveries per day with a heat level from 0 to 4, and the best day.
timeByStage Average time per stage: waiting, ideator, developer, gates, reviewer, video.
costByAgent Cost per agent role, per bucket.
returns Returns by kind (gate, reviewer, video, you), and how many the video caught.
byRepo Per repo: delivered, autonomy, returns, average lead time, the last 7 buckets and cost.

Any action other than signals and baseline fails with Unknown metrics action "nope": use signals or baseline.

metrics signals looks at your recent runs and tells you whether some features would pay off for you: indexing, co-change hints, handoff, learning and model ranking. Each one is a trigger that lights up when the numbers cross its threshold.

Terminal window
astranize metrics signals --workspace notes
{"type":"signals","since":"14d","generatedAt":"2026-11-22T04:39:57.444Z","aggregate":{"tasks":0,"doneTasks":0,"cyclesAvg":null,"tokensPerDone":null,"reads":0,"greps":0,"globs":0,"unknownReads":0,"returnsByReason":{}},"triggers":[{"id":"indexing","state":"insufficient","value":null,"threshold":25,"sample":0,"minSample":15,"detail":{"explorationShare":null}},{"id":"co-change","state":"insufficient","value":null,"threshold":3,"sample":0,"minSample":20},{"id":"handoff","state":"insufficient","value":null,"threshold":0.5,"sample":0,"minSample":15},{"id":"learning","state":"insufficient","value":null,"threshold":3,"sample":0,"minSample":3},{"id":"model-ranking","state":"insufficient","value":null,"threshold":20,"sample":0,"minSample":20}]}

Each trigger’s state is lit, off or insufficient, which means there are fewer samples than minSample. In a fresh workspace, every trigger is insufficient. The indexing trigger also carries detail.explorationShare, because it can light by exploration alone.

The same numbers are the Telemetry section of the app’s Observatory, and you change thresholds and minimum samples in Settings, Telemetry, or with telemetry.triggers in settings.yaml. Telemetry explains each trigger.

Flag Type Default Effect
--since <N>d 14d The window, in days. Anything else fails with Unknown --since "2w": use Nd.
--against baseline name none Add the changes since a saved baseline. An unknown name fails with Baseline "x" not found.

With --against, the line gains against: { name, savedAt, since, deltas, aggregateDeltas }.

A baseline is a saved copy of today’s signals, so you can measure later what a change did. For example, save one before you change something, such as regenerating the repo maps, then compare with metrics signals --against before-maps a week later.

Terminal window
astranize metrics baseline save before-maps --workspace notes --since 7d
astranize metrics baseline list --workspace notes
{"type":"baseline_saved","name":"before-maps","path":"~/.astranize/workspaces/notes/metrics/baselines/before-maps.json"}
{"type":"baselines","items":[{"name":"before-maps","savedAt":"2026-11-22T04:39:58.296Z","tasks":0,"since":"7d"}]}

baseline save takes --since like signals. The file goes to metrics/baselines/<name>.json in the workspace. Saving the same name again from the CLI replaces it without asking; the app’s Save baseline… asks first and offers Replace.

Error Cause
Usage: metrics baseline save <name> [--since Nd] No name.
Invalid baseline name "Before" Names use lowercase letters, digits and dashes.
Unknown baseline action "x": use save or list Any other action.

video-caught marks that the proof video caught a problem the gates and the reviewer missed. The dashboard counts these marks under returns.videoCaught, so you can see how often the video earns its keep.

Terminal window
astranize video-caught t-0002 --workspace notes
{"type":"task_updated","task":{"id":"t-0002","status":"waiting_you","videoCaughtMiss":true,…}}

The task’s videoCaughtMiss is now true. To clear the mark, run it again with --off.

Flag Type Default Effect
--off switch off Set videoCaughtMiss back to false.

limits shows how much of each provider’s plan you have used, in the 5-hour window and in the week. Astranize records a reading every time an agent run reports one, and this command prints the latest.

Terminal window
astranize limits --workspace notes
{"type":"limits","providers":{"claude":{"provider":"claude","readAt":"2026-11-20T02:45:17.733Z","fiveHour":{"usedPct":32,"resetsAt":"2026-11-20T06:00:00.000Z"},"weekly":{"usedPct":41,"resetsAt":"2026-11-24T00:00:00.000Z"}}}}

Here Claude has used 32% of its 5-hour window and 41% of the week. Each window is { usedPct, resetsAt }, or null when there is no reading for it. A window whose resetsAt has already passed shows as {"usedPct":0,"resetsAt":null}.

Before any agent has run, you get {"type":"limits","providers":{}}. The readings are kept in limits.json.

usage adds up the tokens and cost of every agent run on this machine, across all workspaces, for a period.

Terminal window
astranize usage --workspace notes
{"type":"usage","period":"7d","generatedAt":"2026-11-22T04:53:37.984Z","totals":{"costUsd":0.042,"tokens":7540,"cacheRead":1800,"cacheWrite":200,"cacheTokens":2000,"runs":1},"byProvider":[{"provider":"claude","costUsd":0.042,"tokens":7540,"cacheRead":1800,"cacheWrite":200,"cacheTokens":2000,"runs":1}],"byStep":[{"step":"developer","costUsd":0.042,"tokens":7540,"cacheRead":1800,"cacheWrite":200,"cacheTokens":2000,"runs":1}],"byWorkspace":[{"workspace":"notes","costUsd":0.042,"tokens":7540,"cacheRead":1800,"cacheWrite":200,"cacheTokens":2000,"runs":1,"estimatedWeekPct":{"claude":41}}],"weeks":[]}

One developer run cost $0.042 in the last 7 days. It used 7,540 fresh tokens, plus 2,000 tokens of cache read and written.

Flag Type Default Values
--period string 7d today, 7d, 30d, all.
Field Meaning
totals { costUsd, tokens, cacheRead, cacheWrite, cacheTokens, runs }. costUsd is null when no run reported a cost. tokens counts fresh tokens, input and output; the cache is apart, with cacheTokens as the sum of cacheRead and cacheWrite.
byProvider, byStep, byWorkspace The same totals, grouped. byWorkspace[].estimatedWeekPct splits each provider’s weekly usage percentage by the workspace’s share of the tokens.
weeks Per week, starting Monday in your time zone: tasks done, fresh tokens, tokens per task done (fresh, cache read, cache write), runs and average cycles.

The numbers come from each task’s usage.jsonl. Economy and limits explains how limits and budgets use them.