From pratyaksha-context-eng-harness
Show local token budget gauge plus recent cost ledger entries (per-model totals, last N calls). Optionally reset the gauge.
How this command is triggered — by the user, by Claude, or both
Slash command
/pratyaksha-context-eng-harness:budget [last <n> | reset]The summary Claude sees in its command listing — used to decide when to auto-load this command
# /budget
Show the local token budget gauge and recent cost ledger entries for the
current Claude Code session.
## Usage
## Instructions
When this command is invoked:
1. Parse `last <n>` if present (default 20).
2. If the user passed `reset`, ask for explicit confirmation before
calling the underlying tool — the gauge is informational only, but
resetting it mid-session loses the running total.
3. Call `budget_status({last_n: n})` and format with the template below.
## Output Template
## Notes
- The plugin does NOT auto-track tokens. Each agent call is responsible
for cal...Show the local token budget gauge and recent cost ledger entries for the current Claude Code session.
/budget # show recent 20 ledger entries
/budget last 50 # show recent 50 ledger entries
/budget reset # zero the local gauge (does not clear the ledger)
When this command is invoked:
last <n> if present (default 20).reset, ask for explicit confirmation before
calling the underlying tool — the gauge is informational only, but
resetting it mid-session loses the running total.budget_status({last_n: n}) and format with the template below.## Local token budget
**Gauge:** {budget_used} / {budget_total} ({pct_used:.1f}% used, {remaining} remaining)
**Status:** {exhausted ? "⛔ EXHAUSTED" : remaining < budget_total * 0.1 ? "⚠️ near limit" : "✅ healthy"}
### Cost ledger
- Total recorded calls: {ledger_n_calls}
- Total recorded tokens: {ledger_total_tokens}
#### By model
| Model | Tokens |
|---|---|
| {model} | {tokens} |
| ... | ... |
#### Recent (last {n})
| ts (UTC) | tokens | model | note |
|---|---|---|---|
| {iso(r.ts)} | {r.tokens} | {r.model} | {r.note} |
| ... | ... | ... | ... |
---
**Tip:** the gauge is a local mirror — Claude Code's own usage telemetry
is authoritative. Budget figures here exist so the agent can self-throttle
without round-tripping the runtime.
budget_record with the spend it just incurred. The
manas and buddhi agents do this automatically; user-level
/sublate, /compact-now, and /context-status are read-only and
cost approximately one MCP call each.~/.cache/pratyaksha/cost_ledger.jsonl
— you can tail -f it during long sessions to watch spend in real time./budget after a reset will still show the historical entries.npx claudepluginhub sharathsphd/pratyaksha-context-eng-harness --plugin pratyaksha-context-eng-harness/budgetSets a hard token ceiling per response (e.g. 100) or clears it (off). Runs budget hook, enforces limit on future responses, and confirms.
/budgetDisplays real-time token usage vs predicted usage for active workflow, with remaining budget, phase breakdown, projections, recommendations, and checkpoints.