How this command is triggered — by the user, by Claude, or both
Slash command
/affaan-m:context-statusThe summary Claude sees in its command listing — used to decide when to auto-load this command
# コンテキスト監視コマンド ## コマンド名 `/context-status` ## 説明 Claude Codeのコンテキスト使用状況を監視し、最適化の提案を行います。 ## 使用方法 ## 実行内容 このコマンドは以下の情報を表示します: ### 1. コンテキスト使用率 - 現在のコンテキスト使用率(%) - 使用可能なトークン数 - 消費済みトークン数 ### 2. MCP設定状況 - アクティブなMCPサーバー数 - 有効化されているツール数 - 推奨設定との比較 ### 3. 最適化推奨事項 - 60%を超える場合: `/compact`実行を推奨 - MCP数が10個を超える場合: 未使用MCPの無効化を推奨 - ツール数が80個を超える場合: MCP設定の見直しを推奨 ## 出力例 ## 警告レベル ### 注意(60%以上) ### 警告(80%以上) ### MCP過剰 ### ツール数過剰 ## 自動監視機能 affaan-mプラグインでは、ツール実行時に自動的にコンテキスト使用率を監視します。 **自動アクション**: - 60%超過時: 警告を表示 - 80%超過時: `/compact`の実行を強く推奨 - 設定ファイルで`autoCompact: true`の場合、自動的にコンパクト化を提案 ...
/context-status
Claude Codeのコンテキスト使用状況を監視し、最適化の提案を行います。
/context-status
このコマンドは以下の情報を表示します:
/compact実行を推奨📊 コンテキスト監視レポート
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
【コンテキスト使用率】
使用率: 45% (90,000 / 200,000 トークン)
ステータス: 正常 ✅
【MCP設定状況】
アクティブMCPサーバー: 8個
有効化ツール数: 65個
ステータス: 推奨範囲内 ✅
【推奨事項】
✅ コンテキスト使用率は正常範囲です
✅ MCP設定は最適化されています
✅ 問題は検出されませんでした
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ コンテキスト使用率: 65%
推奨: `/compact`コマンドでコンテキストを圧縮してください
🚨 コンテキスト使用率: 85%
緊急: 即座に`/compact`を実行してください
⚠️ アクティブMCPサーバー: 12個(推奨: 10個以下)
推奨: 未使用のMCPサーバーを無効化してください
⚠️ 有効化ツール数: 95個(推奨: 80個以下)
推奨: MCP設定を見直してください
affaan-mプラグインでは、ツール実行時に自動的にコンテキスト使用率を監視します。
自動アクション:
/compactの実行を強く推奨autoCompact: trueの場合、自動的にコンパクト化を提案/compact - コンテキストを圧縮/status - Claude Codeの全体ステータス確認/compactは別途実行する必要があります未使用MCPを無効化
# グローバル設定を確認
cat ~/.config/claude-code/mcp.json
プロジェクト固有のMCPのみ有効化
# プロジェクト設定を確認
cat .claude-code/mcp.json
定期的にコンパクト化
/compact
推奨MCP設定数:
監視頻度:
最適化タイミング:
npx claudepluginhub takemi-ohama/ai-plugins --plugin affaan-m/context-optimizerDiagnoses context window usage issues, audits MCPs and CLAUDE.md, applies fixes like compaction and disabling unused tools, sets auto-compaction, and reports optimized state.
/contexteRuns built-in /context command to fetch real token metrics, analyzes usage patterns for inefficiencies, and provides tailored optimization recommendations.
/context-budgetAnalyzes context window usage across agents, skills, MCP servers, and rules to find optimization opportunities, producing a Context Budget Report with recommendations.
/cc-budgetCalculates remaining context window after fixed overhead from CLAUDE.md, rules, skills, and MCP schemas. Shows budget summary table and top consumers. Also supports audit, optimize, anchor-plan, simulate.
/optimize-contextAnalyzes context window usage against MECW principles, providing token breakdowns, utilization status, and optimization recommendations. Accepts optional path and --detailed flag.
/context-budgetAudits fixed and dynamic context overhead in the current session — scans CLAUDE.md, agents, MCP servers, rules, skills, and history — estimates tokens per component, reports budget usage and headroom, and issues alerts for oversized components or overflow risk.