跳到正文
cccskills
免费在 GitHub 公开中文介绍

context-budget

检查Claude Code加载的智能体、技能、规则和MCP配置所占的信息量,估算词元数,找出过长或重复的定义,并按预计可削减的量为改进建议排序。

原文查看原文说明

Routes live context checks to the native Codex or Claude Code meter without scanning files, and performs a bounded static component audit only when explicitly requested. Use for context-budget requests about remaining capacity or installed context overhead.

AI 评分100分/ 100查看安装方法

适用场景

  • 排查上下文迅速占满的原因
  • 添加技能或MCP后检查配置
  • 查找过长文件和重复指令
  • 添加组件前估算剩余空间

中文介绍

功能

检查Claude Code加载的各类配置包含多少信息,整理占用上下文的主要因素;上下文是模型可参考的信息范围。针对智能体、技能、规则、MCP工具定义和CLAUDE.md估算词元数,查找过长文件及重复内容。按必要程度对组件分类,再根据预计可削减的量为改进建议排序。

适用场景

适合上下文很快占满,或添加大量技能、MCP服务器后检查配置。继续添加组件前,也可评估现有负担和新增部分的预计负担。详细输出可查看各文件的占用明细及重复位置。

使用示例

  • “用/context-budget检查配置的信息量。”
  • “用/context-budget --verbose显示大文件的占用明细。”
  • “估算添加一个MCP服务器会增加多少负担。”

注意事项

词元数和工具定义的开销均为估算值。可选的JSONL诊断使用Python 3,需要明确选择一个状态稳定的普通文件。已保存文件的字节数不代表当前上下文用量或费用。查看当前值时,请使用适合所用版本的/context或/usage。

本介绍由 AI(OpenAI Codex)根据公开的 SKILL.md 撰写。准确的规格请查看下方原文。

客观评估

AI 仅根据 SKILL.md 的内容,从 4 个方面进行了评估。星标数和热度不计入评估。

指令清晰度能否看出何时使用、做什么
A良好区分实时用量查询与明确请求的审计,并列出各支持环境对应的原生命令。
步骤具体性步骤、输入输出和示例是否具体
A良好明确审计范围、清单数量上限和报告字段,并提供所选JSONL文件的诊断代码。
安全性发送数据、删除文件、执行命令等是否有说明
A良好审计须明确请求且限于指定范围的只读访问;JSONL诊断也须明确选择文件。
安装难易度所需工具和 API 密钥是否少且有说明
A良好默认流程仅指向环境原生命令,可选诊断提供python3执行示例。

总分按每项 A=25 分、B=15 分、C=5 分相加。 由 AI(OpenAI Codex)于 2026年10月19日 评估。仅供参考,安装前请同时查看原文。

如果您认为评估有误,请申请复核

请写明哪一项有误以及原因。无需登录。我们会对照 SKILL.md 重新评估,并在此处更新结果。

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

包含的文件(1)

  • SKILL.md6.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Context Budget

Use the provider's native meter for live session usage. Keep the separate, estimated installation audit behind an explicit opt-in.

Default: Live Context

Treat an invocation with no audit request as a live-context request. This includes requests for the current window, remaining capacity, headroom, token usage, or a context breakdown.

For this default path:

  • Do not call or use tools.
  • Do not scan or read files.
  • Do not run shell commands, provider CLIs, debug logging, or MCP discovery.
  • Reply with only the native command and one short explanation.

Route by the active harness:

HarnessNative commandGuidance
Codex CLI/statusShows current token usage and remaining context capacity. Use /statusline and enable Context stats plus Token counters for a persistent footer meter.
Codex app/statusShows current thread context usage and rate limits.
Claude Code/contextShows the live context breakdown. Use /context all for expanded items.
Other or unknownNone verifiedState that ECC cannot read live provider state and ask which harness is active.

These commands are documented in the Codex command reference and Claude Code command reference.

A skill cannot invoke a TUI slash command on the user's behalf. Never replace the native command with an estimated scan and never infer an audit request from phrases such as “context is heavy” or “how much is left.”

Explicit Static Audit

Run an installation/configuration audit only when the user explicitly says --audit, “audit installed components,” or equivalent unambiguous wording. --verbose changes report detail; it does not opt into an audit by itself.

If the audit scope is ambiguous, ask for the harness and installation root before reading anything. Keep every audit bounded and read-only:

  1. Inspect only the named plugin/install root and the named harness's known configuration files.
  2. Never recursively enumerate the workspace root, home directory, provider cache, transcripts, debug logs, or unrelated worktrees.
  3. Never launch a provider CLI, MCP server, or debug session to count tools.
  4. Cap inventory output at 50 entries per component class. Summarize the rest.
  5. Do not write temporary logs or copy configuration content into the report.

Audit only the component metadata relevant to eager discovery:

  • agent and skill descriptions;
  • command descriptions when the harness discovers them eagerly;
  • always-loaded instruction files in the explicitly named scope;
  • configured MCP tool schemas when an existing bounded manifest exposes them.

Full skill, agent, command, and rule bodies are generally on-demand content. Report their disk size separately from estimated eager overhead instead of adding every body to the session baseline.

Audit Output

Return a compact report containing:

  • harness and exact paths inspected;
  • estimated eager/discovery overhead by component class;
  • installed counts and the heaviest metadata entries;
  • assumptions, unavailable measurements, and up to three optimizations.

Every calculated token number is an estimate of static configuration overhead, not live session context. Do not claim that an estimate is provider-reported, current, exact, or evidence of realized savings. Direct the user back to the native live-context command for current usage.

Optional Selected-Record Diagnostic

Inspect a persisted record only when the user explicitly selects that file for this diagnostic. This is separate from the default live-context request and the installation audit.

For a local file diagnostic, explicitly select a stable, regular JSONL file or a snapshot you intend to inspect. Replace the example path below; this does not find or reconnect a session. The snippet prints aggregate byte counts only. It reads one line at a time, so memory use depends on the largest record; avoid very large records and actively growing files.

python3 - "/path/to/selected-session.jsonl" <<'EOF'
import json
import sys

total = attachment = other = unclassified = 0
try:
    with open(sys.argv[1], "rb") as source:
        for raw in source:
            size = len(raw)
            total += size
            try:
                record = json.loads(raw.decode("utf-8"))
            except (UnicodeDecodeError, json.JSONDecodeError):
                unclassified += size
                continue
            record_type = record.get("type") if isinstance(record, dict) else None
            if not isinstance(record_type, str):
                unclassified += size
            elif record_type == "attachment":
                attachment += size
            else:
                other += size
except OSError:
    print("Cannot read selected JSONL file.", file=sys.stderr)
    raise SystemExit(1)

pct = attachment * 100.0 / total if total else 0.0
print(f"persisted {total}B | attachment records {attachment}B ({pct:.1f}%) | "
      f"other records {other}B | unclassified {unclassified}B")
EOF

The three categories add up to the original file bytes, including line endings and blank lines. attachment is an exact record-type filter, not a guarantee about a harness's current internal schema. Other records have a different string type; malformed JSON, invalid UTF-8, nonobject values, missing or non-string types, and blank lines are unclassified. Neither category means "conversation," and the percentage is only a share of persisted bytes.

These counts do not establish active context, remaining room, token usage, billing, or what a reconnect loads. For current harness-reported context and usage, use the version-appropriate /context and /usage commands (/cost is an alias).

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

accessibility

免费有简介AI 评分 100分

依据WCAG 2.2设计和检查Web、iOS及Android界面,核查读屏标签、键盘操作、配色对比度和操作目标尺寸,使界面支持辅助技术。

  • 为纯图标按钮添加说明
  • 检查键盘操作与模态框焦点
  • 检查对比度与操作目标尺寸
affaan-m/ECC28.4万2026年10月16日 更新

agent-architecture-audit

免费有简介AI 评分 80分

从指令、记忆、工具执行和界面显示等十二个层面排查人工智能代理故障,依据代码和日志梳理原因,按严重程度列出问题并提出修复方案。

  • 排查仅在应用内出现的故障
  • 调查旧对话混入回答的原因
  • 核对工具漏执行或虚报执行
affaan-m/ECC28.4万2026年10月16日 更新

agent-eval

免费有简介AI 评分 80分

用实际开发任务比较多个编程智能体,记录成功率、可获取的API费用、耗时和重复运行的稳定性,为工具选型及更新后的性能评估提供数据。

  • 用实际开发任务比较智能体
  • 采用新工具或模型前进行评估
  • 检查智能体更新后的性能
affaan-m/ECC28.4万2026年10月16日 更新

agent-harness-construction

免费有简介AI 评分 100分

设计和调整AI智能体使用的工具、输入与返回格式,明确出错后的恢复、重试和停止条件,管理上下文信息量,并以完成率、重试次数和成功任务成本评估改进。

  • 设计智能体工具及输入格式
  • 明确工具结果与下一步行动
  • 制定安全重试与停止条件
affaan-m/ECC28.4万2026年10月16日 更新

agent-introspection-debugging

免费有简介AI 评分 100分

在AI代理反复失败或重复操作时,记录错误与环境前提、排查原因,采取影响有限的恢复操作,并汇总结果和证据,为有依据的重试与交接提供支持。

  • 排查重复调用工具的原因
  • 调查对话膨胀导致的质量下降
  • 核对文件路径与环境差异
affaan-m/ECC28.4万2026年10月16日 更新

agent-introspection-debugging

免费有简介AI 评分 100分

根据错误信息和执行环境,分析AI代理反复失败或重复操作的原因。通过小范围、可撤销的恢复操作检验假设,并将结果与依据整理成可供交接的报告。

  • 诊断代理连续失败
  • 调查重复调用工具的循环
  • 检查上下文积累导致的输出退化
affaan-m/ECC28.4万2026年10月5日 更新

查看 affaan-m 的全部技能

报告此技能的问题