Audit
When explain-usage resolves in this session, prefer it for where session tokens went; use this for startup cost before work, per-tool attribution, whether…
от melodic-software★ 34 звезды на GitHub
Установить Audit в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Audit
Arguments. [--full-sweep|--tools T1,T2|--ledger|--measure-only|fix] [--unattended]. Full form: [--full-sweep] every live tool, engine flag --tools from-baseline | [--tools T1,T2] | [--ledger] history | [--measure-only] read-only startup figures, see below | [fix] guided trim (explicit override) | [--unattended] nobody is present, see the Boundary sections
Measure-only mode (--measure-only)
For a read-only caller, such as a sweep that must write nothing outside its own data folder. Run this and stop; skip the Prerequisites install offer and every Workflow step below:
node "${CLAUDE_PLUGIN_ROOT}/skills/audit/scripts/measure.mjs" snapshot --measure-only \
--sdk-dir "${CLAUDE_PLUGIN_DATA}/sdk"
- Output. One measurement session; the snapshot record on stdout, stamped as every report is.
Report
categories(tokens per category) with the stamp. - Writes nothing of its own. No ledger row, snapshot, report or other file, under the plugin
data directory or anywhere else. The engine refuses
--out,--denyand--labelhere (exit 2). Any file the spawned headless session keeps for itself is not this skill's output and is not covered by this claim. - Installs nothing. It never runs or offers the SDK install.
- Exit codes.
0measured;2usage error;3measurement failed (no binary, or the SDK session failed);4the Agent SDK is absent, with acontext-budget.error/1record (error: "sdk-absent") on stdout. It does not fall back tocli-parse, so exit 4 is not exit 3. The engine also prints a one-line message on stderr; relay it and stop; the caller reports the area as not checked. - Each measurement still spawns a short-lived headless session, as the full audit does.
Purpose
Per-skill, per-agent, and per-MCP-tool attribution stays with /context, which the person runs
(the Boundary section below). This skill covers what our measurements see /context report only
as totals: the built-in tool pools, System tools and System tools (deferred). This skill measures
that attribution on the consumer's own machine by A/B differencing: a baseline session versus one
session per candidate tool with that tool denied by bare name. The two attributed buckets compose differently, so price a basket
per bucket rather than as one number: deferred-side deltas add, and a basket's deferred saving is
the sum of its members; prefix-side deltas double-count, and their sum is only an upper bound on
what the basket saves on the prefix side. Confirm both on this binary with
attribute --verify-additivity, which reports its verdict per bucket.
Bundled files. Every reference file this skill links is in
${CLAUDE_PLUGIN_ROOT}/skills/audit/reference/. Read each one with the Read tool, never through
Bash (cat, sed, grep), Glob or Grep.
Two rules govern everything this skill says, per the plugin's
${CLAUDE_PLUGIN_ROOT}/skills/audit/reference/engine.md:
- Only measured numbers are reported. No token figure, tool inventory, or threshold ships in this skill; values drift with every CLI release. If a number was not produced by a run on this machine in this audit, it is not stated.
- Every report is stamped with the measured binary path and version, the measurement mode
(
sdkexact vscli-parsedisplay-rounded), and the session kind (headless). Machines with two CLI installs produce different answers per binary; the stamp is what makes the answer a claim instead of a guess.
Scope boundary (route out)
- Which skills to turn off → the built-in
/skill-doctor; unused MCP servers and plugins → the bundled/doctor. Never reimplement their checks, and never decide here what to turn off. Pointers: for/skill-doctor, see https://code.claude.com/docs/en/skills#find-unused-skills; for/doctor, see https://code.claude.com/docs/en/skills#check-your-setup-with-/doctor. - Per-skill / per-agent / per-MCP-tool attribution →
/contextnatively, which the person runs. - Live in-session occupancy over time → the
context-usageplugin, if enabled. - Settings correctness, permission-rule state → the
harness-configplugin, if enabled.
/skill-doctor, /doctor and /context are user-only, so naming one to the person is a native
suggestion: name them only under the native_suggestions rule of the Boundary sections below. When
it resolves off, name none of them and write nothing in their place, --unattended included:
say only that the request is outside this audit. When it is on and the caller passes
--unattended, write Withheld suggestion (unattended): <command> for each one instead.
Boundary, the bundled explain-usage skill
One native surface also answers "what is using my tokens", and the two get conflated when a session feels crowded:
explain-usage(bundled skill): what it does, who can invoke it, and the fact that no upstream page documents it are recorded in
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- reference/engine.md
- reference/interactive-only-tools.json
- reference/levers.json
- reference/native-context.md
- reference/native-explain-usage.md
- reference/native-skill-doctor.md
- reference/report.md
- scripts/levers.test.sh
- scripts/measure.mjs
- scripts/measure.test.sh
FAQ
Что делает скилл Audit?
When explain-usage resolves in this session, prefer it for where session tokens went; use this for startup cost before work, per-tool attribution, whether settings saved tokens (read-only; fix applies a trim with approval). Use when: 'what is eating my context window at startup', 'measure my startup payload', 'which built-in tools cost the most'.
Как установить скилл Audit?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Audit запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
patterns
AnthropicFind patterns worth sharing from recent PRs and repo history, both repeats to fix and good practices worth spreading. Use when a champion wants to know what…
copilot-cli-quickstart
GitHubUse this skill when someone wants to learn GitHub Copilot CLI from scratch. Offers interactive step-by-step tutorials with separate Developer and…
vardoger-analyze
GitHubUse when the user asks to personalize the GitHub Copilot CLI assistant, adapt Copilot to their style, use vardoger, or analyze their Copilot CLI conversation…
policy-lookup
AnthropicFind and explain company policies in plain language. Trigger with "what's our PTO policy", "can I work remotely from another country", "how do expenses work"…