Command Palette

Search for a command to run...

Back to skills
skill № 18339

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…

FreeRuns bundled scripts
melodic-softwareby melodic-software★ 34 GitHub stars

Install Audit in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

About this skill

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, --deny and --label here (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. 0 measured; 2 usage error; 3 measurement failed (no binary, or the SDK session failed); 4 the Agent SDK is absent, with a context-budget.error/1 record (error: "sdk-absent") on stdout. It does not fall back to cli-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:

  1. 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.
  2. Every report is stamped with the measured binary path and version, the measurement mode (sdk exact vs cli-parse display-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 → /context natively, which the person runs.
  • Live in-session occupancy over time → the context-usage plugin, if enabled.
  • Settings correctness, permission-rule state → the harness-config plugin, 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
Full SKILL.md on GitHub

Allowed tools

Tools this skill is permitted to call.

No restriction — this skill can use any tool.

Bundled files

  • 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

What does the Audit skill do?

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'.

How do I install the Audit skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the Audit skill run scripts?

Yes, this skill bundles executable scripts. Review the source before installing.

Related skills

Compare Audit with