Purpose
Check-only setup under the Check-only carve-out (docs/PLUGIN-PHILOSOPHY.md "Setup is explicit
and repeatable" in the marketplace repository): this plugin's configuration surface contains no
writable artifact, so check inspects, reports, and points at each remediation, and no apply is
offered because there is nothing it could conformingly write. The warrant is the carve-out's
external-prerequisites class: node, the Claude Code CLI the engine pins and measures against,
and the optional @anthropic-ai/claude-agent-sdk that enables exact mode, none of which a native
configuration prompt can see, and each of which setup can only verify. The
settings_write_ask_enabled option is a native userConfig toggle whose only stored home is the
pluginConfigs this contract forbids setup to write.
Action routing: no argument or check runs the check. Non-interactive, never prompts.
check (read-only)
The audit skill and its engine are the single source of truth for what this plugin requires:
${CLAUDE_PLUGIN_ROOT}/skills/audit/SKILL.md § Prerequisites and the header of
${CLAUDE_PLUGIN_ROOT}/skills/audit/scripts/measure.mjs.
Read it first. Probe what it actually does, don't recite this file. Then run each probe via
Bash and report a PASS/FAIL/INFO table with one remediation line per FAIL. Do not modify anything.
Install nothing.
node on PATH. command -v node, and report the resolved path and version. This is the
plugin's one hard prerequisite, and it carries two dependents. Report both:
- The measurement engine is a Node script, so without
node /context-budget:audit cannot
produce a number and correctly stops rather than estimating.
- The PreToolUse checkpoint in
${CLAUDE_PLUGIN_ROOT}/hooks/hooks.json registers in exec
form, "command": "node" with the script in args, so Claude Code resolves the bare name
node on PATH in the hook's own environment. A hook that fails to launch is non-blocking,
so an unresolvable node means the checkpoint produces no ask and says nothing about it.
That silent gap is exactly what a native configuration prompt cannot tell you: the option can
read true while the hook it gates never runs.
FAIL when absent. The checkpoint is a checkpoint either way, never a guarantee. A
PermissionRequest hook can allow the call and disableAllHooks removes non-managed hooks.
The Claude Code CLI. command -v claude and its --version. The engine measures a pinned
binary. PASS when one resolves; report the absolute path and version, because that stamp is what
makes a report a claim. INFO when two installs are present. The audit asks which to pin. FAIL
when none resolves and the operator has no --binary path to name, since the engine then has
nothing to measure.
@anthropic-ai/claude-agent-sdk (optional). Probe whether it resolves under
${CLAUDE_PLUGIN_DATA}/sdk. Present: INFO, exact mode is available. Absent: INFO, not a
defect. The engine degrades to parsing headless /context output (display-rounded, resting on
an undocumented surface, and the record carries both caveats), and to a structured error rather
than a wrong number when neither mode works.
Settings-write-ask toggle. Report the effective ${user_config.settings_write_ask_enabled}
(an unexpanded token or an empty value means the manifest default true). INFO. The rendered
value is injected when this skill loads, so a change made now is observed only in a fresh
session; say so rather than re-reading it mid-session. When it reads false, note that the
checkpoint is deliberately off and step 1's node finding downgrades to INFO for the hook (it
stays FAIL for the engine).
Remediation guidance (printed by check; the operator applies it)
Every prerequisite here is a system tool or an operator install, and the one option lives in
Claude Code's native configuration surface (Check-only carve-out, external-prerequisites and
native-userConfig classes), so check closes by pointing at each resolution rather than
writing. Re-running it after everything passes changes nothing and reports "already configured":
Missing node: the platform's own install channel (https://nodejs.org/en/download). This
plugin never downloads a runtime. On Windows, confirm the hook's environment resolves the same
node this check did.
Missing CLI: install the Claude Code CLI, or run the audit with an explicit --binary path.
Exact mode wanted: print this one-time install, marked as the operator's. It needs network
access, so this skill offers it and never runs it:
mkdir -p "${CLAUDE_PLUGIN_DATA}/sdk" && npm install --prefix "${CLAUDE_PLUGIN_DATA}/sdk" @anthropic-ai/claude-agent-sdk
Toggle off (or on): reconfigure through Claude Code's native flow, per the marketplace's
plugin-reconfiguration convention
(https://github.com/melodic-software/claude-code-plugins/blob/main/docs/conventions/plugin-reconfiguration/README.md,
which owns the verified-version record): interactive
/plugin configure context-budget@<marketplace> any time, or headless
claude plugin install context-budget@<marketplace> -s <scope> --config settings_write_ask_enabled=true
(repeatable per key) — against an already-installed plugin it prints already installed and
still writes the value. Do not uninstall to reconfigure: that drops this plugin's entire
stored pluginConfigs entry, resetting every option in the README's Options reference to its
manifest default. -s defaults to user; pass the scope claude plugin list reports for this
plugin, and run from that project's directory for a project/local scope, or the write lands at
a scope that does not load. This skill never writes user settings or pluginConfigs. Afterwards
rerun check in a fresh session — the rendered token is injected at skill load, so a
same-session check still reports the OLD value; report the observed effective value, never an
unobserved change.
What this skill does NOT do
- Run a measurement, attribution, or ledger operation. That is
/context-budget:audit.
- Install
node, the CLI, or the Agent SDK. Guidance only.
- Write the plugin cache, Claude Code user settings, or
pluginConfigs. Nor any other Claude Code
settings surface.
1---2name: setup-423description: Verify context-budget's external prerequisites on this machine: `node`, which both the always-on settings-write checkpoint hook and the measurement engine depend on; the Claude Code CLI the engine measures against; and the optional Agent SDK that enables exact mode. Then report the effective settings-write-ask toggle. Use when: 'set up context-budget', 'configure context-budget', 'is context-budget working', 'why did the settings-write ask not prompt', 'why is the audit not exact', or an audit run reported a missing prerequisite. Check-only: verifies, reports, and points at each remediation; installs nothing and there is nothing setup may write here. Re-runnable and safe.4---56## Purpose78Check-only setup under the Check-only carve-out (`docs/PLUGIN-PHILOSOPHY.md` "Setup is explicit9and repeatable" in the marketplace repository): this plugin's configuration surface contains no10writable artifact, so `check` inspects, reports, and points at each remediation, and no `apply` is11offered because there is nothing it could conformingly write. The warrant is the carve-out's12external-prerequisites class: `node`, the Claude Code CLI the engine pins and measures against,13and the optional `@anthropic-ai/claude-agent-sdk` that enables exact mode, none of which a native14configuration prompt can see, and each of which setup can only verify. The15`settings_write_ask_enabled` option is a native `userConfig` toggle whose only stored home is the16`pluginConfigs` this contract forbids setup to write.1718Action routing: no argument or `check` runs the check. Non-interactive, never prompts.1920## `check` (read-only)2122The audit skill and its engine are the single source of truth for what this plugin requires:23[`${CLAUDE_PLUGIN_ROOT}/skills/audit/SKILL.md`](../audit/SKILL.md) § Prerequisites and the header of24`${CLAUDE_PLUGIN_ROOT}/skills/audit/scripts/measure.mjs`.2526**Read it first.** Probe what it actually does, don't recite this file. Then run each probe via27Bash and report a PASS/FAIL/INFO table with one remediation line per FAIL. Do not modify anything.2829Install nothing.30311. **`node` on `PATH`**. `command -v node`, and report the resolved path and version. This is the32 plugin's one hard prerequisite, and it carries *two* dependents. Report both:33 - The measurement engine is a Node script, so without `node` `/context-budget:audit` cannot34 produce a number and correctly stops rather than estimating.35 - The PreToolUse checkpoint in `${CLAUDE_PLUGIN_ROOT}/hooks/hooks.json` registers in **exec36 form**, `"command": "node"` with the script in `args`, so Claude Code resolves the bare name37 `node` on `PATH` in the hook's own environment. A hook that fails to launch is non-blocking,38 so an unresolvable `node` means the checkpoint produces no `ask` and says nothing about it.39 That silent gap is exactly what a native configuration prompt cannot tell you: the option can40 read `true` while the hook it gates never runs.4142 FAIL when absent. The checkpoint is a checkpoint either way, never a guarantee. A43 `PermissionRequest` hook can allow the call and `disableAllHooks` removes non-managed hooks.442. **The Claude Code CLI**. `command -v claude` and its `--version`. The engine measures a pinned45 binary. PASS when one resolves; report the absolute path and version, because that stamp is what46 makes a report a claim. INFO when two installs are present. The audit asks which to pin. FAIL47 when none resolves *and* the operator has no `--binary` path to name, since the engine then has48 nothing to measure.493. **`@anthropic-ai/claude-agent-sdk`** (optional). Probe whether it resolves under50 `${CLAUDE_PLUGIN_DATA}/sdk`. Present: INFO, exact mode is available. Absent: INFO, not a51 defect. The engine degrades to parsing headless `/context` output (display-rounded, resting on52 an undocumented surface, and the record carries both caveats), and to a structured error rather53 than a wrong number when neither mode works.544. **Settings-write-ask toggle**. Report the effective `${user_config.settings_write_ask_enabled}`55 (an unexpanded token or an empty value means the manifest default `true`). INFO. The rendered56 value is injected when this skill loads, so a change made now is observed only in a **fresh57 session**; say so rather than re-reading it mid-session. When it reads `false`, note that the58 checkpoint is deliberately off and step 1's `node` finding downgrades to INFO for the hook (it59 stays FAIL for the engine).6061## Remediation guidance (printed by `check`; the operator applies it)6263Every prerequisite here is a system tool or an operator install, and the one option lives in64Claude Code's native configuration surface (Check-only carve-out, external-prerequisites and65native-`userConfig` classes), so `check` closes by pointing at each resolution rather than66writing. Re-running it after everything passes changes nothing and reports "already configured":6768- **Missing `node`:** the platform's own install channel (<https://nodejs.org/en/download>). This69 plugin never downloads a runtime. On Windows, confirm the hook's environment resolves the same70 `node` this check did.71- **Missing CLI:** install the Claude Code CLI, or run the audit with an explicit `--binary` path.72- **Exact mode wanted:** print this one-time install, marked as the operator's. It needs network73 access, so this skill offers it and never runs it:7475 ```shell76 mkdir -p "${CLAUDE_PLUGIN_DATA}/sdk" && npm install --prefix "${CLAUDE_PLUGIN_DATA}/sdk" @anthropic-ai/claude-agent-sdk77 ```7879- **Toggle off (or on):** reconfigure through Claude Code's native flow, per the marketplace's80 plugin-reconfiguration convention81 (<https://github.com/melodic-software/claude-code-plugins/blob/main/docs/conventions/plugin-reconfiguration/README.md>,82 which owns the verified-version record): interactive83 `/plugin configure context-budget@<marketplace>` any time, or headless84 `claude plugin install context-budget@<marketplace> -s <scope> --config settings_write_ask_enabled=true`85 (repeatable per key) — against an already-installed plugin it prints `already installed` **and86 still writes the value**. Do **not** uninstall to reconfigure: that drops this plugin's entire87 stored `pluginConfigs` entry, resetting every option in the README's Options reference to its88 manifest default. `-s` defaults to `user`; pass the scope `claude plugin list` reports for this89 plugin, and run from that project's directory for a `project`/`local` scope, or the write lands at90 a scope that does not load. This skill never writes user settings or `pluginConfigs`. Afterwards91 rerun `check` in a **fresh session** — the rendered token is injected at skill load, so a92 same-session `check` still reports the OLD value; report the observed effective value, never an93 unobserved change.9495## What this skill does NOT do9697- Run a measurement, attribution, or ledger operation. That is `/context-budget:audit`.98- Install `node`, the CLI, or the Agent SDK. Guidance only.99- Write the plugin cache, Claude Code user settings, or `pluginConfigs`. Nor any other Claude Code100 settings surface.