token-budget-tracking
Track, optimize, and control token consumption across multi-agent systems. Covers budget allocation, real-time monitoring, cost attribution, per-agent limits, and proactive cost optimization for production LLM deployments.
npx skills add cosmicstack-labs/mercury-agent-skills --skill token-budget-tracking --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Token Budget Tracking & Optimization ## Overview In production multi-agent systems, token costs are the new infrastructure bill — and they can spiral fast. An agent in a loop can burn through hundreds of dollars in minutes. This skill covers how to set budgets, track consumption in real time, attribute costs to specific agents and tasks, and optimize token usage without sacrificing quality. --- ## Core Concepts ### Token Cost Economics | Model | Input ($/1M tokens) | Output ($/1M tokens) | Cost per 100K tasks (4K avg) | |-------|--------------------|---------------------|------------------------------| | GPT-4o | $2.50 | $10.00 | ~$1,250 | | Claude 3.5 Sonnet | $3.00 | $15.00 | ~$1,800 | | GPT-4o-mini | $0.15 | $0.60 | ~$75 | | Claude 3 Haiku | $0.25 | $1.25 | ~$150 | **A single runaway agent** consuming 50K tokens per loop for 100 iterations = **$50-$150** in minutes. ### Budget Dimensions | Dimension | What It Tracks | Why It Matters | |-----------|---------------|----------------| | **Per Agent** | Tokens consumed by each agent | Identify expensive agents | | **Per Task** | Cost per completed task | Measure ROI per task type | | **Per User** | Cost attributed to a user/session
- Overview
- Core Concepts
- Token Cost Economics
- Budget Dimensions
- Step-by-Step Implementation
- Step 1: Build a Token Counter
- Step 2: Implement Budget Enforcements
- Step 3: Token Optimization Strategies
- Step 4: Real-Time Budget Dashboard
- Step 5: Proactive Cost Controls
- Step 6: Budget Alerting Rules
- Token Budget Planning
- Setting Budgets
- Optimization Impact
What does the token-budget-tracking skill do?
Track, optimize, and control token consumption across multi-agent systems. Covers budget allocation, real-time monitoring, cost attribution, per-agent limits, and proactive cost optimization for production LLM deployments.
How do I install it?
Run `npx skills add cosmicstack-labs/mercury-agent-skills --skill token-budget-tracking --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From cosmicstack-labs/mercury-agent-skills, a repository with 364 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.