跳到正文
Skillpedia
自动化280k · #285

context-budget

它能做什么

这个工具可以帮你了解你还剩多少“空间”(或称“预算”)可以用于 AI。它会检查当前用量,或在你要求时进行详细的配置分析,只有在你提出要求时才会执行。

适用场景

  • ✓想知道你还有多少“空间”可以使用 AI 时。
  • ✓想了解已安装了哪些内容以及它们占用多少空间时。
  • ✓需要深入分析 AI 配置时。

技能链接

https://github.com/affaan-m/ECC/blob/main/skills/context-budget/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/affaan-m/ECC/blob/main/skills/context-budget/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我当前的上下文预算是多少?”

每周 5 个新技能,1 分钟读完。

工作原理

它会使用你的 AI 程序中的特定命令来检查实时用量。如果你要求更详细的分析,它会检查配置文件,但不会通读所有内容。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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:

Harness Native command Guidance
Codex CLI /status Shows current token usage and remaining context capacity. Use /statusline and enable Context stats plus Token counters for a persistent footer meter.
Codex app /status Shows current thread context usage and rate limits.
Claude Code /context Shows the live context breakdown. Use /context all for expanded items.
Other or unknown None verified State 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):

…
常见问题

我怎么知道自己用 AI 用得太多了?

你可以问“我的 token 用量是多少?”或“还剩多少空间?”来查看当前状态。

什么是“安装审计”?

这是对已安装组件及其设置的详细检查,会占用更多资源,只有在你明确要求时才会执行。

我能让 AI 检查特定文件吗?

不能。这个工具主要关注 AI 的整体用量和配置,而不是单个文件。

详情

作者的原始描述

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.

repo: affaan-m/ECC

热度

GitHub 星标
280k
排名
#285
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能