affaan-m/ECC

context-budget

エージェント、スキル、MCPサーバー、ルールにわたってClaude Codeのコンテキストウィンドウ消費を監査します。肥大化、冗長なコンポーネントを特定し、優先順位付けされたトークン節約の推奨事項を生成します。

67CollectingClaude Code
See how to use itView GitHub source
npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/context-budget"
Automated source guide

Source checked Jul 28, 2026·Refresh due Oct 26, 2026

Reorganized from the pinned upstream SKILL.md

Turn context-budget's source instructions into a guide you can follow

According to the pinned SKILL.md from affaan-m/ECC: Claude Codeセッションで読み込まれたすべてのコンポーネントのトークンオーバーヘッドを分析し、コンテキストスペースを取り戻すための実用的な最適化を表示します。

npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/context-budget"
Check the pinned source

Best fit

  • エージェント、スキル、MCPサーバー、ルールにわたってClaude Codeのコンテキストウィンドウ消費を監査します。肥大化、冗長なコンポーネントを特定し、優先順位付けされたトークン節約の推奨事項を生成します。

Bring this context

  • A concrete task that matches the documented purpose of context-budget.
  • The files, examples, or context the task depends on.
  • Your constraints, target environment, and definition of done.

Expected outputs

  • A result that follows the pinned context-budget instructions.
  • A concise record of assumptions, inputs used, and unresolved questions.
  • A final check against the source workflow and relevant permission signals.

Key source sections

Read context-budget through these 5 source sections

Sections are extracted automatically from the pinned SKILL.md and link back to the source.

01

使用時期

セッションのパフォーマンスが低下しているか、出力品質が低下している場合

SKILL.md · 使用時期
セッションのパフォーマンスが低下しているか、出力品質が低下している場合多くのスキル、エージェント、またはMCPサーバーを追加した後実際に持っているコンテキストのヘッドルームを確認したい場合
02

動作方法

すべてのコンポーネントディレクトリをスキャンしてトークン消費を推定します:

SKILL.md · 動作方法
ファイルごとの行数とトークンをカウント(単語数 × 1.3)descriptionフロントマターの長さを抽出フラグ: 200行超のファイル(重い)、30単語超のdescription(肥大化したフロントマター)
03

フェーズ1: インベントリ

すべてのコンポーネントディレクトリをスキャンしてトークン消費を推定します:

SKILL.md · フェーズ1: インベントリ
ファイルごとの行数とトークンをカウント(単語数 × 1.3)descriptionフロントマターの長さを抽出フラグ: 200行超のファイル(重い)、30単語超のdescription(肥大化したフロントマター)
04

フェーズ2: 分類

Review the “フェーズ2: 分類” section in the pinned source before continuing.

SKILL.md · フェーズ2: 分類
Review and apply the “フェーズ2: 分類” source section.
05

フェーズ3: 問題の検出

肥大化したエージェントdescription — フロントマターに30単語超のdescriptionはすべてのTaskツール呼び出しで読み込まれる

SKILL.md · フェーズ3: 問題の検出
肥大化したエージェントdescription — フロントマターに30単語超のdescriptionはすべてのTaskツール呼び出しで読み込まれる重いエージェント — 200行超のファイルはすべてのスポーン時にTaskツールのコンテキストを膨らませる冗長なコンポーネント — エージェントロジックを複製するスキル、CLAUDE.mdを複製するルール

SkillSignal prompt templates

Provide the task, context, and acceptance criteria

These prompts were written by SkillSignal from the source structure; they are not upstream text.

Task-start prompt

Confirm source fit, inputs, and outputs before acting.

Use context-budget to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.

Source-guided execution

Make the Agent explicitly follow the key extracted sections.

Apply the pinned context-budget source to [task]. Pay particular attention to these source sections: “使用時期”, “動作方法”, “フェーズ1: インベントリ”, “フェーズ2: 分類”, “フェーズ3: 問題の検出”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].

Result-review prompt

Check omissions, permissions, and source drift before delivery.

Review the current context-budget result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.

Output checklist

Verify each item before delivery

The task matches the purpose documented in the SKILL.md.

The source section “使用時期” has been checked.

The source section “動作方法” has been checked.

The source section “フェーズ1: インベントリ” has been checked.

The source section “フェーズ2: 分類” has been checked.

Inputs, constraints, and acceptance criteria are explicit.

Unverified facts, compatibility, and outcome claims are clearly marked.

Any file, command, network, or data action has been reviewed.

Choose a different workflow

When another Skill is the better fit

FAQ

What does context-budget do?

Claude Codeセッションで読み込まれたすべてのコンポーネントのトークンオーバーヘッドを分析し、コンテキストスペースを取り戻すための実用的な最適化を表示します。

How do I start using context-budget?

The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/ja-JP/skills/context-budget". Inspect the command and pinned source before running it.

Which Agent platforms does it declare?

claude code

Repository stars
234,327
Repository forks
35,711
Quality
67/100
Source repository last pushed

Quality breakdown

Based on traceable docs and repository signals; stars are not treated as quality.

67/100
Documentation21/30
Specificity14/25
Maintenance20/20
Trust signals12/25

Compare before choosing

Related Agent Skills and source variants

These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.

View original Skill.mdThis page is parsed directly from the repository SKILL.md without editorial rewriting. Collected: Jul 28, 2026 · about 1 min

コンテキストバジェット

Claude Codeセッションで読み込まれたすべてのコンポーネントのトークンオーバーヘッドを分析し、コンテキストスペースを取り戻すための実用的な最適化を表示します。

使用時期

  • セッションのパフォーマンスが低下しているか、出力品質が低下している場合
  • 多くのスキル、エージェント、またはMCPサーバーを追加した後
  • 実際に持っているコンテキストのヘッドルームを確認したい場合
  • コンポーネントを追加する計画があり、スペースがあるか確認したい場合
  • /context-budgetコマンドを実行する場合(このスキルがそれをサポートします)

動作方法

フェーズ1: インベントリ

すべてのコンポーネントディレクトリをスキャンしてトークン消費を推定します:

エージェント (agents/*.md)

  • ファイルごとの行数とトークンをカウント(単語数 × 1.3)
  • descriptionフロントマターの長さを抽出
  • フラグ: 200行超のファイル(重い)、30単語超のdescription(肥大化したフロントマター)

スキル (skills/*/SKILL.md)

  • SKILL.mdごとのトークンをカウント
  • フラグ: 400行超のファイル
  • .agents/skills/の重複コピーを確認 — 二重カウントを避けるために同一コピーをスキップ

ルール (rules/**/*.md)

  • ファイルごとのトークンをカウント
  • フラグ: 100行超のファイル
  • 同一言語モジュール内のルールファイル間のコンテンツの重複を検出

MCPサーバー (.mcp.jsonまたはアクティブなMCP設定)

  • 設定されたサーバー数と合計ツール数をカウント
  • スキーマオーバーヘッドをツールあたり約500トークンと推定
  • フラグ: 20以上のツールを持つサーバー、シンプルなCLIコマンド(ghgitnpmsupabasevercel)をラップするサーバー

CLAUDE.md (プロジェクト + ユーザーレベル)

  • CLAUDE.mdチェーンのファイルごとのトークンをカウント
  • フラグ: 合計300行超

フェーズ2: 分類

すべてのコンポーネントをバケットに分類します:

バケット基準アクション
常に必要CLAUDE.mdで参照されている、アクティブなコマンドをサポート、または現在のプロジェクトタイプに一致保持
時々必要ドメイン固有(例:言語パターン)、CLAUDE.mdで未参照オンデマンドアクティベーションを検討
めったに必要でないコマンド参照なし、コンテンツ重複、または明らかなプロジェクト一致なし削除または遅延ロード

フェーズ3: 問題の検出

以下の問題パターンを特定します:

  • 肥大化したエージェントdescription — フロントマターに30単語超のdescriptionはすべてのTaskツール呼び出しで読み込まれる
  • 重いエージェント — 200行超のファイルはすべてのスポーン時にTaskツールのコンテキストを膨らませる
  • 冗長なコンポーネント — エージェントロジックを複製するスキル、CLAUDE.mdを複製するルール
  • MCPの過剰サブスクリプション — 10以上のサーバー、または無料で利用できるCLIツールをラップするサーバー
  • CLAUDE.mdの肥大化 — 冗長な説明、古いセクション、ルールであるべき指示

フェーズ4: レポート

コンテキストバジェットレポートを生成します:

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を使用
  • MCPが最大のレバー: 各ツールスキーマはおよそ500トークンかかります。30ツールのサーバーはスキル全部よりも多くかかります
  • エージェントdescriptionは常に読み込まれる: エージェントが呼び出されなくても、そのdescriptionフィールドはすべてのTaskツールのコンテキストに存在します
  • デバッグには詳細モード: 特定のファイルがオーバーヘッドを駆動していることを正確に特定する必要がある場合に使用し、通常の監査には使用しない
  • 変更後に監査: エージェント、スキル、またはMCPサーバーを追加した後に実行して、クリープを早期にキャッチ
Source repo
affaan-m/ECC
Skill path
docs/ja-JP/skills/context-budget/SKILL.md
Commit SHA
4e973d3eaf92
Repository license
MIT
Data collected