/harness-ops:audit-install-state [--unattended] [root]from harness-ops
Read-only audit of ~/.claude and ~/.claude.json: inventories unmanaged files, identifies what the product manages, checks for stale lock files, and reports disk usage. Does not delete anything.
Ships in harness-ops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Arguments. [--unattended] [root]. root is the tree to audit and reaches the engine as --root; it defaults to $CLAUDE_CONFIG_DIR, else ~/.claude. Always pass --csv to the engine. --unattended, anywhere in the arguments, is the caller declaring that nobody is present: the skill takes it out before reading root, never passes it to the engine script (whose parser does not accept it) and never reads it as a root path; under it the suggestion is omitted. The bare word unattended is neither this flag nor a root: stop and name --unattended.
Answers four questions about a Claude Code installation, and refuses to answer a fifth.
$$ returns a clean, confident, wrong "dead."The fifth question, so what should I delete?, is deliberately not answered. This skill is
report-only and never writes to the target tree. Deletion belongs to /disk-hygiene:clean (if enabled), and
shedding project state belongs to claude purge.
| Question | Owner |
|---|---|
| Is this machine's Claude Code install directory healthy? | this skill |
| Are a repo's project-scope config FILES correct? | /harness-config:audit (if enabled) |
| Are permission grants portable and durable? | /harness-config:audit-permission-grants (if enabled) |
| Is the plugin fleet current, and at what scope? | /harness-ops:plugins-audit |
| Delete a genuinely unmanaged leftover | /disk-hygiene:clean (if enabled) |
Rationale and handoffs: reference/scope-and-handoffs.md.
doctor skillOne native Claude Code surface asks a question that sounds like this skill's, and the two are routinely conflated:
doctor (bundled skill): health-checks an installation and offers to fix what it
finds.
doctor checks, its aliases, or what hides or removes it,
fetch the /doctor row of
commands: all commands and
skills: check your setup with /doctor
live.Routing. Person-invoked /doctor is offered at session end (Phase 6); this section records surface facts only. Its sibling /harness-ops:audit-performance owns the timed slowness-capture lane against the same native surface.
Mutation gate. doctor mutates: fixing is its point. This skill's contract is report-only, so
never chain into a doctor fix on this skill's behalf. Surface the finding, and let the user
invoke the fix themselves.
Availability is never assumed. Bundled surfaces are gated on settings and environment, plan,
platform, and host surface, so a session where doctor does not resolve is an ordinary session,
not a broken one. Nothing here depends on it being present: the read-only inventory is complete on
its own.
.credentials.json, daemon/control.key, daemon/pipe.key, ide/*.lock, and the values inside
~/.claude.json. These are inventory line-items: name, size, mtime, and nothing more. What the
product writes to disk unencrypted is read live from
claude directory: plaintext storage.
Every subagent this skill dispatches inherits this rule; say so explicitly in any prompt you fan out. The engine enforces it in its reader, and its whole
content-read allowlist is settings.json, .last-cleanup, plugins/.last_inuse_sweep,
plugins/installed_plugins.json and the plugins/cache/*/*/*/.orphaned_at markers; each entry
it read by content carries content_read: true with the paths opened. Everything else is stat-only.
python3 "${CLAUDE_PLUGIN_ROOT}/skills/audit-install-state/scripts/install_state.py" \
--samples 3 --csv ./claude-install-listing.csv --versions-out ./claude-install-versions.json \
> ./claude-install-report.json
Add --root PATH only when a root argument was given; without it the engine audits
$CLAUDE_CONFIG_DIR, else ~/.claude.
Write both artifacts outside the target root (${CLAUDE_PLUGIN_DATA} resolves inside it and
would be counted by the run that wrote it; in a cloud session use the session scratchpad). If a
destination inside the root is unavoidable, pass it as --csv and the engine excludes it under
self_excluded. Always pass --csv: it is the only artifact carrying per-file rows, and
without it csv.path is null and the run must not be described as covering every file.
--authored-threshold only decides which entries the JSON labels per-file versus rolled-up.
--versions-out <path> writes the complete unreferenced_versions list (Phase 3) and is excluded
the same way. Other flags: --root <path> (else $CLAUDE_CONFIG_DIR, else ~/.claude), --samples N (default
2; use 3+ on a busy machine). Python 3.11+ is the only requirement. The header records
engine_version and the exact invocation, so a report reproduces from itself.
Read environment first. tree_verdict is remote, local, or indeterminate, and it is a
label: no staleness verdict depends on it. A remote tree belongs to a cloud-session container,
not the operator's workstation, so open the report with that sentence; a three-minute-old container
reads as healthy and would otherwise be reported as someone's machine. The verdict rests on tree
signals, each with its own evidence tag; the process-level CLAUDE_CODE_REMOTE variable sits under
session_context and never decides the tree alone, because --root can point anywhere. Report
indeterminate as such, never as remote.
Then read deliberate_state and deny_roots. A non-empty deliberate_state means a revert
ledger (RESTORE.md, PLAYBOOK.md, restore*.py, or a manifest.json / baseline shallow under
plugins/data/) was found; its subtree reports deny-listed instead of a verdict. Treat it as the
possible sole copy of somebody's revert path: propose nothing for it, check age_days, and
diff against the stored baseline rather than believing the ledger's own summary.
Read retention. Report effective_days with its effective_evidence: measured when a file
supplied it, documented-default when upstream's default applies. The highest-severity finding
lives here: if
settings-unparsable-pauses-sweep appears in retention.findings, lead with it and treat every
staleness reading below as suspect. If managed-settings-unparsable-refuses-start appears, report
a refused start naming the managed source; that is not a paused sweep. The pointer records for the
default, the pause causes and the managed-source refusal are in
reference/surfaces.md.
.last-cleanup is read by the engine and its timestamp is observed to advance when the sweep runs,
but no upstream page names the file, so sentinels carries it as observed-undocumented with an
unknown cadence. Report an advance as an observation, not a documented watermark; if it advanced
during your scan, say so, the tree was not quiesced.
Each entry carries surface, a reading with its own evidence, and file_count_sampled as
{min, max, n}.
| Reading | What it means |
|---|---|
product-managed-healthy | Every file is inside the retention window. Do not hand-prune |
age-exceeds-window | evidence: inferred. Some mtimes exceed the window, a measurement, not proof the sweep is failing; the why names the sweep's documented unit |
keep | Documented as retained, authored by you, session-scoped, or secret-bearing |
unclassified-report-only | evidence: no-upstream-row. No documentation covers it either way |
deny-listed | A revert ledger is in this subtree. Nothing here is a candidate |
age-exceeds-window is the reading most likely to be misread; several swept paths retain by a
unit other than the file. Per-path rules: reference/surfaces.md. For "why
is my install so big", read largest_subtrees (top directories by measured bytes) and
node_modules (bytes the product installed into the cache's version directories, upstream basis in
its why; node_modules elsewhere under plugins/ is measured apart and attributed to nobody).
unreferenced_versions lists each plugins/cache/<marketplace>/<plugin>/<version>/ directory that
no installPath in plugins/installed_plugins.json references, largest first, with bytes, the
.orphaned_at marker's orphaned_at and marker_age_days, and past_sweep_window (true once
the marker is ORPHAN_SWEEP_DAYS old). A directory with no marker has orphaned_at: null and is
never past the window, so it has no removal date (sweep condition: pointer below). The report keeps only
the 25 largest, so the field stops growing with the version count (each row repeats its path, so
very long directory names still make rows large).
unreferenced_versions_total is the full count and unreferenced_versions_truncated is true when
the list was cut; never report the list length as the total. --versions-out writes the complete
list as a JSON file, and unreferenced_versions_file then records its path and count. When the
registry is missing, unparsable, or belongs to another root, the list is empty and
unreferenced_versions_note says why; an empty list then means "not checked", not "none". The list
is a report, not a deletion list, and removing anything stays with /disk-hygiene:clean (if enabled). That
skill treats the cache as managed state and leaves version directories to the product's own sweep;
do not remove them by hand.
temp_git_clones measures the depth-1 plugins/cache/temp_git_* staging clones apart from the
versions: total, bytes, and the 25 largest under clones (truncated when cut), each with
bytes, files, newest mtime, name_epoch_utc (the creation time in the name, or null) and
orphaned_at_marker (a stat, never a read). Its reading is unclassified-report-only with
no-upstream-row: report the count and bytes, never as a deletion list; removal stays with
/disk-hygiene:clean (if enabled).
Hook, guard, and denial messages that name the previous version's path after an update are expected, not a defect (running-session behavior: pointer below). Restart the session to pick up the new version.
ORPHAN_SWEEP_DAYS in lib/plugin_cache_versions.py (and its byte-identical copy in
disk-hygiene) is our runtime copy of the window, used without a live fetch.
ORPHAN_SWEEP_DAYS and its copy.numeric_names carries counts by (meaning, liveness), every PID-typed group, and the unknown
sample grouped by name shape with a per-directory histogram. Everything that is not pid reads
not_applicable by construction, not because a lookup missed: ide/<n>.lock is a TCP port,
rate-limits/*.tmp.<n> a shell $$, snapshot and backup numbers are epoch milliseconds, and
an unrecognized scheme fails closed as unknown. A pid_typed group marked self_held belongs to
the session running the audit: evidence about the auditor, not the tree; self_pids_walk: parent-only means that ancestry could not be walked, so an alive group may still be this session.
alive measures a process with that id; "therefore in use" is an inference. A probe that could
not run reports unverified, never dead. Schemes: reference/name-schemes.md.
~/.claude.json lives in the home directory. Report its size and mtime, never its values; route
its growth to claude purge <path>. What the command removes, how it confirms, and what the
retention sweep leaves alone are read live from
claude directory: clear local data
and the purge pointer in reference/surfaces.md
(as of 2026-11-03; recheck when that section renames the command or changes what it deletes).
.claude.json.tmp.<n>.<hash> siblings are failed atomic-write remnants whose number is unverified,
so the engine marks it unknown and attempts no lookup.
Reproduce every claim with the evidence tag the engine attached; an untagged paraphrase turns an
inference into an apparent observation. Ranges, never a central tendency, for anything
time-varying: 411–413 files, n=3, never ~412, and carry any unanimous_small_n_on_volatile_path
flag into the report. Check csv.rows against totals.files before claiming completeness, cite the
CSV path and row count, and state that the tree was live (quiesced: false). Fan-out cross-review
and the upstream-claim rule (raw markdown only; absence from a summary is not evidence of absence):
reference/evidence-discipline.md.
Before that cross-review, run
bash "${CLAUDE_PLUGIN_ROOT}/lib/read-verification.sh" --plugin harness-ops --skill audit-install-state
and copy its line into the report
(levels).
standard follows evidence-discipline.md section 5. strict dispatches the fresh-context reviewer
even for a single-agent run. Under light, and off, which acts as light here, dispatch none and
never review the findings yourself in its place: write verification: skipped (<level>) and say
the findings were not cross-reviewed.
/doctor suggestionNative suggestions are on unless native_suggestions resolves off: a personal <home>/harness-ops.local.yaml value wins over the team <home>/harness-ops.yaml value (<home> is what bash "${CLAUDE_PLUGIN_ROOT}/lib/resolve-convention-home.sh" prints, docs/conventions on exit 1; on any other exit skip both files, as ${CLAUDE_PLUGIN_ROOT}/scripts/registry-dir.mjs does), which wins over the per-user value ${user_config.native_suggestions} (a literal unexpanded token means unset); with none set they are on. A value other than on or off is named and that layer dropped: a valid higher layer still wins, otherwise on, never a lower layer's value. When off, skip the sentence below and write nothing in its place, not even a note that it was skipped or why.
Relay the sentence below to the user and do not run /doctor yourself: it is reserved for the person to run.
If /doctor is available in your session (gate basis: Boundary, the bundled doctor skill above) and native suggestions are on (native_suggestions, Configuration), run it for the quick health-and-fix pass this read-only inventory does not perform.
--unattended: omit the suggestion, write Withheld suggestion (unattended): /doctor in the output, and do not run /doctor.
/disk-hygiene:clean Consumes a genuinely unmanaged leftover this report surfaced; the audit itself never deletes.
enabledPlugins: false does not mean disabled. Enablement spans several scopes and is read at
session start; recent_writers is behavioral evidence, /harness-ops:plugins-audit the verdict.evals/evals.json (opens in a new tab)reference/evidence-discipline.md (opens in a new tab)reference/name-schemes.md (opens in a new tab)reference/scope-and-handoffs.md (opens in a new tab)reference/surfaces.md (opens in a new tab)scripts/install_state.py (opens in a new tab)scripts/install_state.test.sh (opens in a new tab)scripts/managed_settings.py (opens in a new tab)scripts/test_install_state.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
claude-code-install, disk-usage, file-inventory, stale-files, audit
npx claudepluginhub melodic-software/claude-code-plugins --plugin harness-ops18 skills in this plugin
/audit-mod-postureAudit mod postureRead-only audit of mods this Claude Code can run (installed and built-in mods, hooks, calls, sec-default guard state); never loads a mod or prints settings. Use when 'mod posture', 'audit my mods', 'can a mod bypass my deny rules', or which mods run here. Not for writing a mod or settings correctness: /harness-config:audit./audit-native-overlapAudit native overlapMap where repo skills and agents duplicate native Claude Code surfaces; read-only unless apply bakes an approved reference. Use when 'does this skill duplicate a built-in', 'refresh the native-surfaces registry', 'which of our skills overlap bundled skills', or what Claude Code already ships. Not for enumerating invocables: /harness-ops:inventory./audit-performanceAudit performanceRead-only slowness diagnostic that never 'fixes' (run before restart/delete): version, retention, bloat, hook/subagent fan-out, kernel-leak. Use when 'Claude Code is slow', 'typing lags', sluggish session, machine freezes, slow hooks, or too many subagents. Not for bugs (/harness-ops:known-issues) or stale files (/harness-ops:audit-install-state)./audit-plugin-landscapeAudit plugin landscapeRead-only report on stale or overlapping installed plugins and marketplaces, recommending what to adopt, adapt, or drop./audit-skill-visibilityAudit skill visibilityAudit which skills the model can see, which are starved or dropped, and whether skill listing is over budget. When built-in skill-doctor resolves in this session, prefer it for cost; this skill for unseen skills. Use when 'audit skill visibility', 'which skills are starved', 'is my skill listing over budget', or why Claude never suggests a skill./behavior-probesBehavior probesLive probes of Claude Code permission, auto-mode, hook, worktree, subagent, and sandbox behavior with paired controls (pass, fail, inconclusive per version; dry run default, live runs opt-in and capped). Use when 'rerun the behavior probes', 'does auto mode still deny this', 'add a probe case', or which probes a release touches.Other plugins' skills for the same job