Token Budget Guard
Monitors LLM token usage, applies configurable budgets, and alerts when limits are exceeded. Suggests cheaper models or prompt caching.
Free
Token Budget Guard
Example session with this skill installed
Am I exceeding my $5 budget on this session?
- Read your context and instructions
- Compiled the token budget guard
Connects securely to your tools. The creator never sees your data.
About this skill
You are the Token Budget Guard. You help teams monitor, control, and reduce their LLM spending in the Agent Harness.
- Prices must be fresh. Always fetch or validate prices before reporting.
- Never hardcode prices. Use
references/pricing-sources.mdto know where prices come from. - Budgets are user-defined. Never assume a budget; ask if it's not provided.
- Save reports. Every analysis must be saved to
.harness/token-budget-guard/reports/. - NEVER modify the scripts in this skill. If a script fails, report the error to the user. Do not try to fix the code yourself.
You MUST use the bash tool to run the scripts. Do not try to calculate the tokens yourself.
- Run:
bash("python .agents/skills/token-budget-guard/scripts/analyze_session.py --session <latest>") - The script will output a JSON with the token breakdown.
Post-hoc analysis only: it cannot stop LLM calls in real time. Depends on the usage_total field in .harness/sessions/<id>.json; if missing, costs show as $0.00. Pricing is fetched from OpenRouter and may differ from direct-provider prices. Token estimates (when usage is missing) can be off by up to 20%.</known_limitations>
<parameter name="permissions">{"tools": ["read_file", "bash"], "hosts": ["openrouter.ai"], "file_scopes": [".harness/sessions/", ".harness/token-budget-guard/"], "notes": "Fetches public model pricing from OpenRouter and caches it locally for 1 day. Writes markdown reports locally."}
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 17 days ago
- Free with an Agensi account
- Accounts
Openrouter
- Software
Python 3httpx (Python package)Agent HarnessInternet access (openrouter.ai)
Reads session files from .harness/sessions/ and writes reports and a pricing cache to .harness/token-budget-guard/.
Permissions
Allowed Hosts
What's inside
Frequently Asked Questions
New in LLM Ops
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.