docs/ja-JP/skills/context-budget/SKILL.md
エージェント、スキル、MCPサーバー、ルールにわたってClaude Codeのコンテキストウィンドウ消費を監査します。肥大化、冗長なコンポーネントを特定し、優先順位付けされたトークン節約の推奨事項を生成します。
npx skillsauth add affaan-m/everything-claude-code context-budgetInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Claude Codeセッションで読み込まれたすべてのコンポーネントのトークンオーバーヘッドを分析し、コンテキストスペースを取り戻すための実用的な最適化を表示します。
/context-budgetコマンドを実行する場合(このスキルがそれをサポートします)すべてのコンポーネントディレクトリをスキャンしてトークン消費を推定します:
エージェント (agents/*.md)
descriptionフロントマターの長さを抽出スキル (skills/*/SKILL.md)
.agents/skills/の重複コピーを確認 — 二重カウントを避けるために同一コピーをスキップルール (rules/**/*.md)
MCPサーバー (.mcp.jsonまたはアクティブなMCP設定)
gh、git、npm、supabase、vercel)をラップするサーバーCLAUDE.md (プロジェクト + ユーザーレベル)
すべてのコンポーネントをバケットに分類します:
| バケット | 基準 | アクション | |--------|----------|--------| | 常に必要 | CLAUDE.mdで参照されている、アクティブなコマンドをサポート、または現在のプロジェクトタイプに一致 | 保持 | | 時々必要 | ドメイン固有(例:言語パターン)、CLAUDE.mdで未参照 | オンデマンドアクティベーションを検討 | | めったに必要でない | コマンド参照なし、コンテンツ重複、または明らかなプロジェクト一致なし | 削除または遅延ロード |
以下の問題パターンを特定します:
コンテキストバジェットレポートを生成します:
Context Budget Report
═══════════════════════════════════════
Total estimated overhead: ~XX,XXX tokens
Context model: Claude Sonnet (200K window)
Effective available context: ~XXX,XXX tokens (XX%)
Component Breakdown:
┌─────────────────┬────────┬───────────┐
│ Component │ Count │ Tokens │
├─────────────────┼────────┼───────────┤
│ Agents │ N │ ~X,XXX │
│ Skills │ N │ ~X,XXX │
│ Rules │ N │ ~X,XXX │
│ MCP tools │ N │ ~XX,XXX │
│ CLAUDE.md │ N │ ~X,XXX │
└─────────────────┴────────┴───────────┘
WARNING: Issues Found (N):
[ranked by token savings]
Top 3 Optimizations:
1. [action] → save ~X,XXX tokens
2. [action] → save ~X,XXX tokens
3. [action] → save ~X,XXX tokens
Potential savings: ~XX,XXX tokens (XX% of current overhead)
詳細モードでは、ファイルごとのトークン数、最も重いファイルの行ごとの内訳、重複するコンポーネント間の特定の冗長行、ツールごとのスキーマサイズ推定を含むMCPツールリストも出力します。
基本監査
User: /context-budget
Skill: Scans setup → 16 agents (12,400 tokens), 28 skills (6,200), 87 MCP tools (43,500), 2 CLAUDE.md (1,200)
Flags: 3 heavy agents, 14 MCP servers (3 CLI-replaceable)
Top saving: remove 3 MCP servers → -27,500 tokens (47% overhead reduction)
詳細モード
User: /context-budget --verbose
Skill: Full report + per-file breakdown showing planner.md (213 lines, 1,840 tokens),
MCP tool list with per-tool sizes, duplicated rule lines side by side
拡張前の確認
User: I want to add 5 more MCP servers, do I have room?
Skill: Current overhead 33% → adding 5 servers (~50 tools) would add ~25,000 tokens → pushes to 45% overhead
Recommendation: remove 2 CLI-replaceable servers first to stay under 40%
単語数 × 1.3を、コードが多いファイルには文字数 / 4を使用development
Share durable, inspectable context and handoffs between Claude, Codex, Hermes, Cursor, OpenCode, and other agents through the local ECC Memory Vault. Use when an agent must save work state, transfer context, resume another agent's task, or search shared project knowledge.
development
Use when multiple consumers and providers must evolve an API or event schema without field drift, integration surprises, or one side silently redefining the interface.
tools
Query live GPU inventory, submit an authenticated Itô fixed-rate RFQ, inspect RFQ or procurement status, and run explicitly gated node qualification through the separately installed canonical CLI. Use when a user asks to find H100/H200 capacity, request a fixed compute rate, check Itô compute status, or validate GPU nodes.
data-ai
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents. v2.1 adds project-scoped instincts to prevent cross-project contamination.