💼 ビジネス コミュニティ
autonomous-cost-optimizer
Token and cost optimization for autonomous coding. Use when tracking token usage, optimizing API costs, managing budgets, or improving efficiency.
⚡ おすすめ: コマンド1行でインストール(60秒)
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o autonomous-cost-optimizer.zip https://jpskill.com/download/9366.zip && unzip -o autonomous-cost-optimizer.zip && rm autonomous-cost-optimizer.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9366.zip -OutFile "$d\autonomous-cost-optimizer.zip"; Expand-Archive "$d\autonomous-cost-optimizer.zip" -DestinationPath $d -Force; ri "$d\autonomous-cost-optimizer.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
autonomous-cost-optimizer.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
autonomous-cost-optimizerフォルダができる - 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)が読むための原文(英語または中国語)です。日本語訳は順次追加中。
Autonomous Cost Optimizer
Tracks and optimizes token usage and API costs during autonomous coding.
Quick Start
Track Usage
from scripts.cost_optimizer import CostOptimizer
optimizer = CostOptimizer(project_dir)
optimizer.track_usage(input_tokens=1500, output_tokens=500)
report = optimizer.get_usage_report()
print(f"Total cost: ${report.total_cost:.4f}")
Check Budget
if optimizer.is_within_budget(budget=10.00):
# Continue working
pass
else:
# Trigger cost-saving measures
await optimizer.enter_efficiency_mode()
Cost Optimization Workflow
┌─────────────────────────────────────────────────────────────┐
│ COST OPTIMIZATION │
├─────────────────────────────────────────────────────────────┤
│ │
│ TRACK │
│ ├─ Monitor token usage per request │
│ ├─ Calculate cost per feature │
│ ├─ Track cumulative session cost │
│ └─ Log usage to history │
│ │
│ ANALYZE │
│ ├─ Identify high-cost operations │
│ ├─ Compare efficiency across features │
│ ├─ Detect wasteful patterns │
│ └─ Calculate ROI per feature │
│ │
│ OPTIMIZE │
│ ├─ Compact context when approaching limits │
│ ├─ Cache repeated queries │
│ ├─ Batch similar operations │
│ └─ Prioritize high-ROI features │
│ │
│ REPORT │
│ ├─ Generate cost breakdown │
│ ├─ Show efficiency metrics │
│ └─ Recommend optimizations │
│ │
└─────────────────────────────────────────────────────────────┘
Pricing Reference
| Model | Input (per 1M) | Output (per 1M) |
|---|---|---|
| Claude 3.5 Sonnet | $3.00 | $15.00 |
| Claude 3 Opus | $15.00 | $75.00 |
| Claude 3 Haiku | $0.25 | $1.25 |
Efficiency Metrics
@dataclass
class EfficiencyMetrics:
tokens_per_feature: float
cost_per_feature: float
features_per_dollar: float
context_utilization: float
cache_hit_rate: float
Optimization Strategies
| Strategy | Savings | Trade-off |
|---|---|---|
| Context compaction | 20-40% | Slight context loss |
| Response caching | 30-50% | Storage needed |
| Batch operations | 15-25% | Higher latency |
| Model selection | 50-90% | Capability reduction |
Integration Points
- context-compactor: Reduce context size
- memory-manager: Cache common queries
- autonomous-loop: Budget enforcement
- progress-tracker: Efficiency metrics
References
references/PRICING-GUIDE.md- Cost calculationsreferences/OPTIMIZATION-STRATEGIES.md- Strategies
Scripts
scripts/cost_optimizer.py- Core optimizerscripts/usage_tracker.py- Track token usagescripts/budget_manager.py- Budget enforcementscripts/efficiency_analyzer.py- Analyze efficiency