Chuyển đến nội dung
Skillpedia
Tự động hóa280k · #285

context-budget

Skill này làm gì

Công cụ này giúp bạn biết còn bao nhiêu “ngân sách” (dung lượng) để dùng AI. Nó kiểm tra mức sử dụng hiện tại hoặc phân tích chi tiết cấu hình, nhưng chỉ khi bạn yêu cầu.

Khi nào nên dùng

  • ✓Khi bạn muốn biết còn bao nhiêu “dung lượng” để dùng AI.
  • ✓Khi muốn xem tóm tắt những gì đã cài đặt và chúng chiếm bao nhiêu dung lượng.
  • ✓Khi cần phân tích sâu hơn về cấu hình của AI.

Liên kết skill

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

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/affaan-m/ECC/blob/main/skills/context-budget/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Ngân sách ngữ cảnh hiện tại của tôi là bao nhiêu?”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng các lệnh cụ thể của chương trình AI để kiểm tra mức sử dụng theo thời gian thực. Nếu bạn yêu cầu phân tích chi tiết hơn, nó sẽ kiểm tra các tệp cấu hình mà không cần đọc toàn bộ.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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):

…
Câu hỏi thường gặp

Làm sao biết tôi đang dùng AI quá nhiều?

Bạn có thể hỏi “mức sử dụng token của tôi là bao nhiêu?” hoặc “còn bao nhiêu dung lượng?” để xem trạng thái hiện tại.

“Installation audit” là gì?

Đó là kiểm tra chi tiết các thành phần đã cài đặt và thiết lập của chúng. Việc này tốn nhiều tài nguyên hơn nên chỉ thực hiện khi bạn yêu cầu rõ ràng.

Tôi có thể yêu cầu AI kiểm tra tệp cụ thể không?

Không, công cụ này tập trung vào mức sử dụng tổng thể và cấu hình của AI, không xem xét từng tệp riêng lẻ.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
280k
Vị trí xếp hạng
#285
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự