بنقرة واحدة
rounds-budget
Show current LLM usage budget and spending across all diagnosis runs
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Show current LLM usage budget and spending across all diagnosis runs
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Assess telemetry data — identifies distinct transaction types from an explore query and launches sub-agents to analyze each for instrumentation quality, code efficiency, usage correctness, and skill improvement opportunities
Print available rounds skills, project directory layout, and a brief overview of what rounds does
Exploratory querying of telemetry data — search logs by keyword/metadata, search spans by metadata, and build full transaction trees from trace IDs using the rounds adapter interfaces
Get full details for a single rounds error signature including diagnosis, recent events, and related signatures
Investigate a distributed trace by ID — fetches the full trace, reads source files, and explains the end-to-end code flow
List error signatures in the rounds database, optionally filtered by status
| name | rounds-budget |
| description | Show current LLM usage budget and spending across all diagnosis runs |
| user_invocable | true |
| args | null |
| generated | true |
| generation_timestamp | "2026-02-13T22:12:19.643Z" |
| generation_version | 2.0 |
| source_project | rounds |
| source_codebase_hash | a44338f108beaf54 |
Quick-reference skill for viewing LLM diagnosis spending in the rounds error diagnosis system.
/rounds-budget
Display current budget consumption and spending statistics for LLM-powered error diagnosis across the rounds system. This skill helps monitor:
DAILY_BUDGET_LIMIT (default: $100.00 USD)signatures.dbrounds/config.py:
claude_code_budget_usd (default: $2.00 per diagnosis)openai_budget_usd (default: $2.00 per diagnosis)daily_budget_limit (default: $100.00)The daemon scheduler (rounds/adapters/scheduler/daemon.py:209-231) tracks daily spending in-memory and enforces limits during poll cycles.
Read budget settings from environment or defaults:
# View current budget configuration
grep -E "budget|BUDGET" .env 2>/dev/null || echo "Using defaults from config.py"
# View configuration schema
grep -A 5 "Budget controls" rounds/config.py
The SQLite database stores all diagnosis costs in the diagnosis_json field of the signatures table. Extract and sum costs:
# Connect to SQLite and query diagnosis costs
sqlite3 ./data/signatures.db "
SELECT
COUNT(*) as total_diagnoses,
SUM(json_extract(diagnosis_json, '$.cost_usd')) as total_spent_usd,
AVG(json_extract(diagnosis_json, '$.cost_usd')) as avg_cost_per_diagnosis,
MAX(json_extract(diagnosis_json, '$.cost_usd')) as max_single_diagnosis,
MIN(json_extract(diagnosis_json, '$.cost_usd')) as min_single_diagnosis
FROM signatures
WHERE diagnosis_json IS NOT NULL;
"
Break down diagnosis costs by service to identify high-cost areas:
sqlite3 ./data/signatures.db "
SELECT
service,
COUNT(*) as diagnoses_count,
SUM(json_extract(diagnosis_json, '$.cost_usd')) as service_total_usd,
AVG(json_extract(diagnosis_json, '$.cost_usd')) as avg_cost_usd
FROM signatures
WHERE diagnosis_json IS NOT NULL
GROUP BY service
ORDER BY service_total_usd DESC;
"
Show the most recent diagnosed errors and their costs:
sqlite3 ./data/signatures.db "
SELECT
substr(id, 1, 8) as sig_id,
service,
error_type,
json_extract(diagnosis_json, '$.model') as model,
json_extract(diagnosis_json, '$.cost_usd') as cost_usd,
json_extract(diagnosis_json, '$.confidence') as confidence,
datetime(json_extract(diagnosis_json, '$.diagnosed_at')) as diagnosed_at
FROM signatures
WHERE diagnosis_json IS NOT NULL
ORDER BY json_extract(diagnosis_json, '$.diagnosed_at') DESC
LIMIT 10;
"
The daemon scheduler tracks daily spending in-memory (_daily_cost_usd in rounds/adapters/scheduler/daemon.py:38-40). This resets at midnight UTC. To view current daily spending while daemon is running, you would need to:
_daily_cost_usd valuesqlite3 ./data/signatures.db "
SELECT
COUNT(*) as today_diagnoses,
SUM(json_extract(diagnosis_json, '$.cost_usd')) as today_spending_usd
FROM signatures
WHERE diagnosis_json IS NOT NULL
AND date(json_extract(diagnosis_json, '$.diagnosed_at')) = date('now');
"
The daemon (rounds/adapters/scheduler/daemon.py:187-207) checks budget limits before each investigation cycle:
daily_budget_limit is set (e.g., DAILY_BUDGET_LIMIT=100.0), spending is tracked_daily_cost_usd >= budget_limit, investigation cycles are skippedTo verify budget enforcement:
# Check if daemon would skip investigations
# (requires reading daemon logs or adding status endpoint)
grep -E "budget.*exceeded|Daily budget limit" logs/rounds-daemon.log 2>/dev/null || echo "No budget warnings found"
/rounds-budget
# Output shows:
# - Total diagnoses: 42
# - Total spent: $84.50 USD
# - Avg cost: $2.01 USD
# - Budget limit: $100.00 USD
# - Remaining today: $15.50 USD
After running the skill, you'll see:
Service Spending Report:
------------------------
payment-api: $32.40 (16 diagnoses, avg $2.03)
user-service: $28.14 (14 diagnoses, avg $2.01)
notification-svc: $24.00 (12 diagnoses, avg $2.00)
Total: $84.54 across 42 diagnoses
Daily Limit: $100.00 (15.46% remaining)
/rounds-budget
# If daily spending exceeds limit:
# ⚠️ BUDGET EXCEEDED: $103.50 / $100.00 (103.5%)
# Investigation cycles are currently paused.
# After running /rounds-budget, follow up with date-based query:
sqlite3 ./data/signatures.db "
SELECT
date(json_extract(diagnosis_json, '$.diagnosed_at')) as diagnosis_date,
COUNT(*) as count,
SUM(json_extract(diagnosis_json, '$.cost_usd')) as daily_total_usd
FROM signatures
WHERE diagnosis_json IS NOT NULL
GROUP BY diagnosis_date
ORDER BY diagnosis_date DESC
LIMIT 7;
"
# Shows spending trends over the last 7 days
rounds/config.py:82-101 - Budget configuration (per-diagnosis and daily limits)rounds/adapters/scheduler/daemon.py:209-231 - Daily budget tracking and enforcementrounds/core/investigator.py:18-22 - BudgetTracker protocol interfacerounds/adapters/store/sqlite.py:97,425,440 - Diagnosis cost storage in diagnosis_jsonrounds/core/models.py:107 - Diagnosis.cost_usd field./data/signatures.db - SQLite database storing all diagnosis costsBudget tracking in rounds follows the hexagonal architecture pattern:
rounds/core/investigator.py:18-22) defines the BudgetTracker protocolrounds/adapters/scheduler/daemon.py) implements budget enforcementrounds/adapters/store/sqlite.py) stores historical costs in JSONrounds/config.py) provides budget limits from environmentThe daemon scheduler serves dual purposes:
BudgetTracker protocol)This skill was automatically generated from the rounds codebase architecture.