/harness-config:audit-permission-state [--unattended] [--scopes] [--entry-diff] [--lint] [--managed] [--block] [--oracle] [--critique]from harness-config
Reports the merged allow/ask/deny permission rules actually in effect across all settings scopes, flagging rules dropped by auto mode. Use when investigating effective permissions, rule survival in auto mode, or managed policy readability.
Ships in harness-config. 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] [--scopes] [--entry-diff] [--lint] [--managed] [--block] [--oracle] [--critique]. Full form: (none) every read-only stage | [--scopes] [--entry-diff] [--lint] [--managed] [--block] narrow | [--oracle] [--critique] priced
For "where is this rule written", use /permissions. This skill answers a different question: it
computes the merged allow/ask/deny outcome itself, locally and off a live session, as line records a
script can read, and it reports a scope it could not read apart from one that was empty.
/permissions
row of commands: all commands live./permissions export
action, or either section adds one.It answers a question the siblings do not. audit-permission-grants asks whether the grants you
wrote are durable and portable; audit asks whether your config files are correct. This
skill asks what is in effect: which scopes exist on this machine, which of them this reader
could actually open, and what each one holds.
harness-config:audit-permission-grants.harness-config:audit. The
permission plane's own dead config, the disableAutoMode type trap, and rules that cannot match
stay here, in Phase 4: they are read across all five scopes at once, which is this skill's asset
and not something a project-scope reader can do.harness-memory plugin.Two native surfaces act on the same permission rules this skill reports, so "fix my permissions" can mean any of the three.
fewer-permission-prompts (bundled skill): writes an allowlist into project settings to cut
prompts. Either the model or the person may run it./permissions (built-in command). The person's interactive editor for rules by scope and
for auto mode's classifier rules. This skill never runs it.The built-in /status command is the person's in-session view (what it lists: its row of All commands).
This skill never runs it; its inert record, naming the rule that outranked each beaten entry, is the evidence-backed answer off a live session.
Native suggestions are on unless native_suggestions resolves off: the native_suggestions key of <home>/harness-config.local.yaml wins over the same key of <home>/harness-config.yaml (<home> is what bash "${CLAUDE_PLUGIN_ROOT}/lib/resolve-convention-home.sh" prints, else docs/conventions), 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 /permissions offer below and write nothing in its place, not even a note that it was skipped or why.
Routing. When the bundled fewer-permission-prompts skill resolves in this session, prefer it
for reducing prompts by writing an allowlist; prefer this skill to see what is in effect. When the
report ends with a rule the person wants added, removed, or moved, offer it to the person:
If /permissions is available in your session (gate basis: it varies by version and host; records
in reference/native-surfaces.md) and native suggestions are on
(native_suggestions, Configuration), you can run it to view and
edit these rules interactively. When the caller passes
--unattended, omit the offer, write Withheld suggestion (unattended): /permissions in the
output, and do not ask; without that flag it asks.
Mutation gate. fewer-permission-prompts writes project settings, and /permissions writes
whichever scope the person edits. This skill never chains into either on its own behalf.
Availability is never assumed. Settings, version and host decide whether either surface resolves; this section states what to do when they resolve, never that they are present. The four-part records live in reference/native-surfaces.md.
This skill writes no settings file, in any scope, under any flag. That is the contract, and it
holds including under --oracle. It is not the same as writing nothing at all: --oracle spawns a
real claude -p session, and a session rewrites ~/.claude.json and adds project, session-env,
security, subagent and backup state under your config directory. The flag prints that before it
spawns anything. Every other action writes nothing anywhere. This skill treats managed policy as
read-only by construction: it reads the managed sources and never authors them.
Parse $ARGUMENTS. Flags narrow; they never widen.
--unattended, anywhere: the caller declares nobody is present, which changes only the
/permissions offer (see "Boundary" above). It is not a stage flag and audit.sh refuses it: drop
it from the arguments "Run it" passes.--scopes: surface records only, no rule inventory and no downstream stage. Use when the question
is "which scopes exist and which could you read", not "what is in them".--entry-diff: inventory, merge, and the auto-mode entry diff (Phase 3).--lint: inventory and the permission-plane lint (Phase 4).--managed: inventory and the managed-conformance report (Phase 6).--block: the autoMode block lint (Phase 5). Reads the CLI, not the inventory, so it runs alone.--oracle: with --entry-diff, cross-check the prediction against the harness's own drop
narration. Spawns a real claude -p session; never fires without this flag. See its cost
notice, which the run prints before anything is spawned.--critique: with --block, add claude auto-mode critique. Slow, and it truncates or returns
nothing while still exiting 0, so its result is reported as unavailable rather than as clean.One entry point runs each stage once and fans the inventory out, instead of walking every scope once
per pipeline (with --unattended dropped from the arguments):
bash "${CLAUDE_PLUGIN_ROOT}/skills/audit-permission-state/scripts/audit.sh" $ARGUMENTS
The phases below document what each stage decides and how to read it. Every stage script stays
independently invocable and composes on its own, which is what draft-auto-mode-rules and
audit-pass rely on; audit.sh is a convenience caller, never a gateway.
Read the status= token on every summary line before the counts above it. status=read means
the stage saw every scope; status=incomplete means at least one could not be opened and the counts
cover only what was read. A finding count of zero under status=incomplete is not a clean bill.
Search scope. Search plugin sources with the Grep or Glob tool rooted at the installed version
directory of the plugin in question (its installPath in plugins/installed_plugins.json under the
config directory), never the whole plugin cache; search transcripts with Grep rooted at one session
directory; bound any shell walk with timeout below the Bash tool's own. Hand this rule to any
subagent this run starts: a recursive search of ~/.claude/plugins/cache walks every marketplace and cached
version. The orphaned-search report behind this rule:
#20533.
Stage: permission-state.sh, the deterministic spine every other stage consumes. It emits one record
per line:
<scope> <surface> <status> <path> one per settings surface
rule <scope> <surface> <kind> <rule text> one per allow/ask/deny entry
NOTE: <text> anything the operator must know
| Field | Values |
|---|---|
scope | managed, user, project, local, startdir-local |
surface | file, dropin-dir, dropin-file:<name>, registry, plist (managed); toplevel (project, see Scopes); settings elsewhere |
status | present, absent, unreadable, invalid-json, skipped, not-applicable |
kind | allow, ask, deny |
Stage: permission-merge.sh, fed the inventory. It reports what is actually in force, each rule
carrying its provenance. It passes the records above through, then appends:
CAVEAT: <text> what bounds the claim
effective <kind> scopes=<a,b> precedence_basis=<token> <rule> one per live rule
inert <kind> scopes=<a,b> outranked_by=<kind> <rule> one per beaten entry
carveout <kind> source=<scope>:<surface> [bare] <rule> one per ! Read/Edit rule
These mechanics decide those records, and conflating them produces confident wrong answers:
scopes= names every contributor.
Never report one of them as having overridden the other.scripts/permission-merge.sh encodes,
across scopes, and records which rule made another inert. That inert record is what answers
"why is my allow rule ignored". When checking that order and whether scope rank enters it, fetch
settings: permission rules combine differently than you expected
live.reference/criteria.md names. A whole-tool ask leaves no scoped allow for that tool in effect.
Both print a NOTE: naming the tool.! carve-out inside its own source. A deny or ask Read or Edit rule
whose pattern starts with ! is reported as a carveout record naming the one file it came
from, never merged across scopes, so never read it as reopening a path another file blocks. A
carve-out whose pattern is a bare ! is tagged bare, and its effect is a known gap the merge
does not model.
reference/criteria.md maps every precedence_basis token to the docs section it follows from,
and states the two standing bounds the run prints.
This stage predicts which of your broad allow rules auto mode sets aside on entry, with no notice, until the session leaves auto mode again, and which carry over.
It describes a transition not every run shape makes, so state the precondition when you report
it. The run prints it as a DIFF-NOTE, with a run shape that never makes the transition and the
pointer to the live start-mode table; carry it rather than presenting the diff as unconditional. reference/criteria.md §"The auto-mode entry
diff" and §"The precondition: which sessions enter auto mode at all" hold the pointers.
Stage: automode-entry-diff.sh, fed the merge.
DIFF-NOTE: <text> classifyAllShell state, bounds
entry-diff dropped class=<class> scopes=<a,b> <rule> dropped on entry
entry-diff suspended reason=classifyAllShell ... suspended while auto mode is active
entry-diff kept scopes=<a,b> <rule> carries over
entry-diff summary allow_before=<n> dropped=<n> suspended=<n> kept=<n>
dropped and suspended both describe what is in force while auto
mode is active, and this skill edits no settings file. What Claude Code does with those rules
when the session leaves auto mode:
how auto mode evaluates actions.
The two labels are kept apart because the remedies differ: a dropped rule is fixable by
narrowing that rule, while suspended is a global switch no rule edit reaches.class names the reason: blanket, interpreter-wildcard, wrapper-wildcard,
leading-wildcard, path-wildcard, package-manager-run, agent, or monitor. The six shell
shapes come from lib/permission-patterns.sh, the vocabulary audit-permission-grants check P1
also scans with; agent and monitor are whole-tool classes this script tests on the tool token,
monitor with the version bound reference/criteria.md §"The auto-mode entry diff" records.autoMode.classifyAllShell inverts the answer wholesale. The stage treats it, when true, as
suspending every Bash and PowerShell allow rule, so narrow rules do not carry over. It
resolves the key only from the scopes it treats the classifier as reading, so a project- or
local-scope copy is reported inert rather than obeyed. reference/criteria.md holds the pointers.--oracle is opt-in and priced. It spawns a real claude -p session to corroborate the
prediction, and prints what that session costs and leaves behind before it spawns anything; the
measured list is reference/criteria.md §"The auto-mode entry diff", "What the oracle costs,
measured". A capture that yields nothing is unavailable, never an empty drop set.The permission plane accepts things it silently ignores. This finds them across every scope at once, before a session starts:
Stage: permission-plane-lint.sh, fed the inventory.
finding <severity> [<check>] <scope> <detail>
lint summary findings=<n> checks_run=<n> status=<read|incomplete>
Twelve checks: three C2-* dead-config gates, C5-disableType, and eight C6-* rule-shape checks, including a malformed Tool(content) rule, an uncompilable Read/Edit path, and a * in a Bash allow rule's leading variable assignment.
reference/criteria.md maps each to the docs section it follows from and lists the legitimate rule
shapes the checks are written not to flag.
C5-disableType is the one to read first. It flags any value other than the string
"disable" as a false lockout: valid JSON the operator believes locks auto mode out. When deciding which value
locks it out, fetch
settings reference: disableAutoMode
live (as of 2026-11-03; recheck when that section changes the value that disables auto mode).C2 gates stay separate findings. Different scope sets, different version histories:
an operator who fixed one and saw the count drop would reasonably believe they had fixed all three.findings=0 is a clean bill only under status=read. Under status=incomplete a scope could
not be opened and was never linted; the accompanying LINT-NOTE names which.autoMode classifier blockA different surface from everything above: four natural-language sections an LLM classifier reads, not permission rules the harness matches. Independent of the pipeline, it reads the CLI, not stdin:
bash "${CLAUDE_PLUGIN_ROOT}/skills/audit-permission-state/scripts/automode-block-lint.sh" [--critique]
C4-defaults: a customized section that omits "$defaults". We treat such a section as
replacing the built-in list rather than adding to it, so the finding names how many built-in
entries are gone. reference/criteria.md §"The autoMode block lane" holds the pointer.C2b-contradiction: the same subject in allow and in a deny section.C3-shadowed: an entry an earlier hard_deny already forecloses, so it can never fire.C5-provenance: a date or issue reference in an entry you wrote.--critique surfaces claude auto-mode critique, wrapped and never replaced. It owns the
semantic judgment. What this adds is honesty about it: its exit status is not trusted, so a
mid-sentence cut is reported as truncated, and an empty result is reported as unavailable, telling
you to run the critique yourself, never as rules that are clean. The measured runs behind this are
reference/criteria.md §"The measured defensive contract".This lane is optional. It needs python3: the claude auto-mode config output needs a
non-strict parser, which neither jq nor a line-oriented POSIX filter provides
(reference/criteria.md §"The measured defensive contract" records why). Absent python3 or
claude, the lane prints a visible skip notice and exits 0; every other stage still runs.
Exit status is never trusted here. A run that exits 0 having produced nothing is reported
status=unavailable with an explicit "this is NOT a clean bill". The distinction between "your block
is clean" and "the block was never read" is the whole point.
An administrator deploys managed policy believing it is policy. Some of it is; some is not, and
nothing surfaces which. Stage: managed-conformance.sh, fed the inventory.
managed enforced deny <rule>: the strongest thing an administrator can write. We treat a
managed permission rule as outranked by no level, command line included, and a tool denied at
any level as allowed at none.managed loosenable rule …: the interaction that surprises people, reported when a
lower-scope rule of an earlier-evaluated kind outranks a managed rule, because an administrator
reads the managed rule as policy. When deciding how managed rules rank and evaluate, fetch
permissions: settings precedence
live.managed loosenable autoMode: we report a managed autoMode section as additive, not a
policy boundary, since a developer's own entries can loosen it.managed loosenable lockout: disableAutoMode set to anything but the string "disable".reference/criteria.md §"Managed policy, and what it does not buy" holds the pointers for all
four.
This report never prescribes. It says what the consumer's own policy does and does not achieve; every rule string it prints came from a file it read. It ships no security floor of its own.
Completeness is bounded on every run. "Managed" means the local admin surfaces only. We do not
fold the server-managed cache into the effective set, and do not treat it as the live policy. When
deciding where the cache lives and how current it is, fetch
server-managed settings: fetch and caching behavior
live. A surface that could not be read gets its own note saying so, because an administrator
reading silence as "no policy deployed" is the failure this report exists to prevent. The note
routes that diagnosis to the Organization policy line in /status and claude doctor.
/status row of All commands./status as the
place a managed source is shown.Interpret and report the records below; the judgment is over the consumer's configuration, never over anything this skill produced. The status vocabulary carries the whole point of the skill, so do not collapse it in the report:
absent means looked and found nothing. skipped means could not look. Never present a
skipped surface as "no policy". Say the surface was not read and why. The script emits a NOTE:
naming the reason every time.not-applicable). A surface missing from the output is a defect in this reader,
not evidence about the machine.managed means the local managed surfaces. The script does not fold the server-managed cache
at ~/.claude/remote-settings.json into the effective set, and treats the Organization policy
line in /status as the failure read. The script says so on every run; carry it into the report
rather than implying completeness.ask finding names where the contract lives: the auto mode config page, and the
upstream issue anthropics/claude-code#83766 against it. Carry the caveat reference/criteria.md §"Ask rules under auto
mode" words, with its pointer, when reporting an ask result, and point at
permissions.deny where the outcome must hold regardless.invalid-json is not absent. A malformed settings file contributes no rules to the
inventory. Report the parse failure, not an empty scope, and do not describe a managed parse
failure as silent non-enforcement: we treat an unparsable managed source as stopping Claude Code
at startup, on the versions the pointer names, and an unparsable user, project, or local file as a
reported settings error.
Five: managed, user, project, local and startdir-local. local and startdir-local are
the two easy to get wrong; when deciding where the local file is read from, fetch
settings: where Claude Code keeps the local file in a git repository
live.
The reader takes its own working directory as the session's primary working directory, the one input
for project and local. Run it from the directory the session started in (or last moved to with
/cd). Below the repository root it reads two shared files, project settings from its own
directory and project toplevel from the root, and no other. So after an in-session Bash cd, the
start directory's file is not read unless it is the root's: a session started in repo/a that ran
cd b gets repo/a/b and the root, never repo/a. Both files it reads feed the merge, and the set
can over-report the one not in force. Say which directory the session started in when that decides
the answer. When judging whether a cd still carries over, fetch
tools reference: what persists between commands
live.
managed
is four admin surfaces per OS, not one file, plus a remote-cache record for the server-managed
cache that is not folded into the effective set. reference/criteria.md §Scopes has the full table
and the dated record.
The reader resolves every condition we treat as keeping the local file beside
.claude/settings.json instead, and the basis line names which applied. One further case, the
Agent SDK's resolveSettings() helper, is stated rather than detected, because it is a helper's
behavior and not a session property. reference/criteria.md §"The four start-directory
conditions, and the one that is not detectable" holds the list and its pointer.
A cloud session reads a different scope set, and the run says so. We treat a user-scope record
in a cloud session as describing the container, not the operator. The reader detects a cloud
session by CLAUDE_CODE_REMOTE, the only entrypoint variable it branches on.
reference/criteria.md §Scopes holds both records.
jq, required for correctness. Absent, the script stops at the entry point with
ERROR: jq required and exit 2, followed by the install command for the platform when it finds
one. Report the environment gap and that install line; do not report a clean bill.reg (Windows) and defaults (macOS), required for an optional feature. Absent, that one
managed surface is skipped with a visible notice and everything else still runs./harness-config:draft-auto-mode-rules when the audit shows dropped rules or an autoMode block needing drafting.
Failure modes that produce a confidently wrong answer, and the honest limits of what has been verified on real hardware, are in reference/gotchas.md. Read it when a result looks wrong, when debugging a stage by hand, or before trusting a managed surface on macOS or Linux.
evals/evals.json (opens in a new tab)evals/fixtures/automode-config-rawctl.json (opens in a new tab)evals/fixtures/automode-defaults.json (opens in a new tab)reference/criteria.md (opens in a new tab)reference/gotchas.md (opens in a new tab)reference/native-surfaces.md (opens in a new tab)scripts/audit.sh (opens in a new tab)scripts/audit.test.sh (opens in a new tab)scripts/automode-block-lint.sh (opens in a new tab)scripts/automode-block-lint.test.sh (opens in a new tab)scripts/automode-entry-diff.sh (opens in a new tab)scripts/automode-entry-diff.test.sh (opens in a new tab)scripts/managed-conformance.sh (opens in a new tab)scripts/managed-conformance.test.sh (opens in a new tab)scripts/no-writes.test.sh (opens in a new tab)scripts/permission-merge.sh (opens in a new tab)scripts/permission-merge.test.sh (opens in a new tab)scripts/permission-plane-lint.sh (opens in a new tab)scripts/permission-plane-lint.test.sh (opens in a new tab)scripts/permission-state-primary-dir.test.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub melodic-software/claude-code-plugins --plugin harness-config10 skills in this plugin
/auditIf update-config resolves in this session, prefer it to change settings; this skill audits settings.json, settings.local.json, .mcp.json, hooks, plugins, permissions, env vars (correctness, security, drift vs official docs; --fix confirms auto-fix). Use when: 'audit settings', 'check config', 'check for config drift', after Claude Code update./audit-automation-gapsAudit automation gapsAudit a repo's Claude Code automation (hooks, MCP servers, skills, subagents, scheduled tasks) vs enforcement hierarchy with PASS/REJECT/CONDITIONAL verdicts (REJECT default); --implement applies, or filter hooks|mcp|skills|subagents|scheduled. Use when: 'audit automations', 'what automations should we add', 'should I add an MCP server for X'./audit-instructionsAudit instructionsIf claude-api resolves in this session, prefer it for app prompts; this skill audits Claude Code instructions (CLAUDE.md, AGENTS.md, rules, skills, agents, hooks) report-only for stale/conflicting text. Use when: 'audit instructions', 'too prescriptive', 'which instruction wins'. Not for missing text: /harness-config:audit-prompting-postures./audit-passAudit passRun one coordinated, resumable audit pass over a repo: three-scope inventory, each owning plugin's checks lane by lane, findings persisted per lane with one human gate (read-only unless --fix) for one reconciled findings report/release artifact. Use when: 'audit pass', 'audit this repo end to end', 'resume the audit', or sweep all three scopes./audit-permission-grantsAudit permission grantsReport-only permission grant audit: allowed-tools frontmatter, permissions.allow, portable auto-mode durability (dropped interpreter wildcards, machine paths, substitution tokens, inert plugin grants, guarded helper denied despite allow rule). Use when: 'why was my allowed-tools grant ignored', 'audit allow rules', 'is this permission portable'./audit-prompting-posturesAudit prompting posturesReport-only audit of posture guidance instructions lack per official prompting guide: missing delegation criteria, guardrails, stop rules (when to stop), confirm destructive actions. Use when: 'posture audit', 'audit prompting postures', 'is my skill missing guardrails', or align CLAUDE.md. Not for wrong text: /harness-config:audit-instructions.Other plugins' skills for the same job