Best fit
- 审核Claude Code上下文窗口在代理、技能、MCP服务器和规则中的消耗情况。识别膨胀、冗余组件,并提供优先的令牌节省建议。
affaan-m/ECC
审核Claude Code上下文窗口在代理、技能、MCP服务器和规则中的消耗情况。识别膨胀、冗余组件,并提供优先的令牌节省建议。
npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-CN/skills/context-budget"Source checked Jul 28, 2026·Refresh due Oct 26, 2026
Reorganized from the pinned upstream SKILL.md
According to the pinned SKILL.md from affaan-m/ECC: 分析 Claude Code 会话中每个已加载组件的令牌开销,并提供可操作的优化建议以回收上下文空间。
npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-CN/skills/context-budget"Best fit
Bring this context
Expected outputs
Key source sections
Sections are extracted automatically from the pinned SKILL.md and link back to the source.
会话性能感觉迟缓或输出质量下降 你最近添加了许多技能、代理或 MCP 服务器 你想知道实际有多少上下文余量 计划添加更多组件,需要知道是否有空间 运行 /context-budget 命令(本技能为其提供支持)
统计每个文件的行数和令牌数(单词数 × 1.3) 提取 description 前言长度 标记:文件 200 行(繁重),描述 30 词(臃肿的前言)
统计每个文件的行数和令牌数(单词数 × 1.3) 提取 description 前言长度 标记:文件 200 行(繁重),描述 30 词(臃肿的前言)
Review the “阶段 2:分类” section in the pinned source before continuing.
臃肿的代理描述 — 前言中描述 30 词,会在每次任务工具调用时加载 繁重的代理 — 文件 200 行,每次生成时都会增加任务工具的上下文 冗余组件 — 重复代理逻辑的技能,重复 CLAUDE.md 的规则 MCP 超额订阅 — 10 个服务器,或包装了可免费使用的 CLI 工具的服务器 CLAUDE.md 臃肿 — 冗长的解释、过时的部分、本应成为规则的指令
SkillSignal prompt templates
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
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
Audits Claude Code context window consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailエージェント、スキル、MCPサーバー、ルールにわたってClaude Codeのコンテキストウィンドウ消費を監査します。肥大化、冗長なコンポーネントを特定し、優先順位付けされたトークン節約の推奨事項を生成します。
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailAudit skill SKILL.md files for compliance with the agentskills.io specification and house conventions. Checks frontmatter fields (name, description, compatibility, metadata, argument-hint), metadata sub-fields (author, scope, layer, confirms), and layer/suffix consistency. Use when adding new skills, reviewing skill quality, or ensuring all skills follow the spec. Triggers: "audit skills", "check skill spec", "skill compliance", "are my skills up to spec", "/claude-skill-spec-audit".
A separate implementation from jackchuka/skills; compare its source, maintenance signals, and permission requirements.
Open source detailFAQ
分析 Claude Code 会话中每个已加载组件的令牌开销,并提供可操作的优化建议以回收上下文空间。
The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/zh-CN/skills/context-budget". Inspect the command and pinned source before running it.
claude code
Quality breakdown
Based on traceable docs and repository signals; stars are not treated as quality.
Compare before choosing
These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.
Audits Claude Code context window consumption across agents, skills, MCP servers, and rules. Identifies bloat, redundant components, and produces prioritized token-savings recommendations.
エージェント、スキル、MCPサーバー、ルールにわたってClaude Codeのコンテキストウィンドウ消費を監査します。肥大化、冗長なコンポーネントを特定し、優先順位付けされたトークン節約の推奨事項を生成します。
Audit skill SKILL.md files for compliance with the agentskills.io specification and house conventions. Checks frontmatter fields (name, description, compatibility, metadata, argument-hint), metadata sub-fields (author, scope, layer, confirms), and layer/suffix consistency. Use when adding new skills, reviewing skill quality, or ensuring all skills follow the spec. Triggers: "audit skills", "check skill spec", "skill compliance", "are my skills up to spec", "/claude-skill-spec-audit".
Patterns and architectures for autonomous Claude Code loops — from simple sequential pipelines to RFC-driven multi-agent DAG systems.
GAN-inspired Generator-Evaluator agent harness for building high-quality applications autonomously. Based on Anthropic's March 2026 harness design paper.
分析 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 中引用 | 考虑按需激活 |
| 很少需要 | 无命令引用,内容重叠,或无明显的项目匹配 | 移除或延迟加载 |
识别以下问题模式:
生成上下文预算报告:
上下文预算报告
═══════════════════════════════════════
总预估开销:约 XX,XXX 个词元
上下文模型:Claude Sonnet (200K 窗口)
有效可用上下文:约 XXX,XXX 个词元 (XX%)
组件细分:
┌─────────────────┬────────┬───────────┐
│ 组件 │ 数量 │ 词元数 │
├─────────────────┼────────┼───────────┤
│ Agents │ N │ ~X,XXX │
│ Skills │ N │ ~X,XXX │
│ Rules │ N │ ~X,XXX │
│ MCP tools │ N │ ~XX,XXX │
│ CLAUDE.md │ N │ ~X,XXX │
└─────────────────┴────────┴───────────┘
WARNING: 发现的问题 (N):
[按可节省词元数排序]
前 3 项优化建议:
1. [action] → 节省约 X,XXX 个词元
2. [action] → 节省约 X,XXX 个词元
3. [action] → 节省约 X,XXX 个词元
潜在节省空间:约 XX,XXX 个词元 (占当前开销的 XX%)
在详细模式下,额外输出每个文件的令牌计数、最繁重文件的行级细分、重叠组件之间的具体冗余行,以及 MCP 工具列表和每个工具模式大小的估算。
基本审计
/context-budget
技能:扫描设置 → 16个代理(12,400个令牌),28个技能(6,200),87个MCP工具(43,500),2个CLAUDE.md(1,200)
标记:3个重型代理,14个MCP服务器(3个可替换为CLI)
最高节省:移除3个MCP服务器 → -27,500个令牌(减少47%开销)
详细模式
/context-budget --verbose
技能:完整报告 + 按文件细目显示 planner.md(213 行,1,840 个令牌),
MCP 工具列表及每个工具的大小,重复规则行并排显示
扩容前检查
User: 我想再添加5个MCP服务器,有空间吗?
Skill: 当前开销33% → 添加5个服务器(约50个工具)会增加约25,000个tokens → 开销将升至45%
建议:先移除2个可用CLI替代的服务器以保持在40%以下
words × 1.3,对代码密集型文件使用 chars / 4