token-guard
Monitor and control OpenClaw token usage and costs. Set daily budgets, track spending, auto-downgrade models when limits hit. Stop burning money while you sleep.
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o token-guard.zip https://jpskill.com/download/8258.zip && unzip -o token-guard.zip && rm token-guard.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/8258.zip -OutFile "$d\token-guard.zip"; Expand-Archive "$d\token-guard.zip" -DestinationPath $d -Force; ri "$d\token-guard.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
token-guard.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
token-guardフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-18
- 取得日時
- 2026-05-18
- 同梱ファイル
- 1
📖 Claude が読む原文 SKILL.md(中身を展開)
この本文は AI(Claude)が読むための原文(英語または中国語)です。日本語訳は順次追加中。
Token Guard 💰
Stop burning money while you sleep.
Your AI agent runs 24/7. Opus costs $75/M output tokens. One overnight coding session can burn $50+ before you wake up. Token Guard watches your spend and acts before your wallet notices.
The Problem
Real costs from real users:
| Scenario | Model | Cost |
|---|---|---|
| "Let the agent run overnight" | Opus | $50-100 |
| "Register an email + X account" | Opus | $55 (one task!) |
| First week exploring | Opus | $100+ |
| Daily heartbeat checks | Opus | $2-5/day for nothing |
Most users don't realize they're burning Opus-level tokens on tasks that Haiku could handle.
What Token Guard Does
Monitor
- Track token usage per day/model
- Estimate costs from model pricing
- Show usage history and trends
Budget
- Set daily spending limits
- Warning alerts at configurable threshold (default 80%)
- Hard limits with auto-model-downgrade
Optimize
- Model cost comparison at a glance
- Routing recommendations (Opus for reasoning, Haiku for background)
- Per-task cost estimation before running
Quick Start
# See current usage and model costs
bash scripts/token-guard.sh status
# Set a $10/day budget with warnings
bash scripts/token-guard.sh set-budget 10
# Set a hard limit: auto-downgrade to Haiku when exceeded
bash scripts/token-guard.sh set-budget 10 80 true claude-haiku-3-5
# Estimate cost before running a task
bash scripts/token-guard.sh estimate claude-opus-4 50000 10000 10
# Check usage history
bash scripts/token-guard.sh history 7
Model Cost Comparison
| Model | Input $/1M | Output $/1M | Relative |
|---|---|---|---|
| Claude Opus 4 | $15.00 | $75.00 | 100x |
| Claude Sonnet 4 | $3.00 | $15.00 | 20x |
| Claude Haiku 3.5 | $0.80 | $4.00 | 5x |
| GPT-4o | $2.50 | $10.00 | 13x |
| Gemini Flash | $0.075 | $0.30 | 1x |
| DeepSeek | $0.27 | $1.10 | 1.5x |
Recommended Routing
Tier 1 (Reasoning/Creative): claude-opus-4 → Use sparingly
Tier 2 (Daily work): claude-sonnet-4 → Primary model
Tier 3 (Background/Subagent): claude-haiku-3-5 → Subagent model
Tier 4 (Bulk/Heartbeat): gemini-2.0-flash → Heartbeat/cron
Savings: Routing background tasks to Haiku instead of Opus = 95% cost reduction on those tasks.
For AI Agents
Add to your heartbeat or cron:
bash /path/to/token-guard/scripts/token-guard.sh monitor
When budget is exceeded with hard limit enabled, the script automatically downgrades the primary model.
Install
clawdhub install token-guard
# or: git clone https://github.com/jzOcb/token-guard
Requirements
bash4+python3curl
Related
- config-guard — Config validation and auto-rollback
- upgrade-guard — Safe upgrades with snapshot and auto-rollback
- agent-guardrails — Code-level enforcement for AI agents