agentleFS
obeoneobeone/claude-skills/skills/automode-config/SKILL.md

automode-config

Skill4 starsChanged 2 months agoMITView on GitHub

Author, validate, and migrate Claude Code autoMode permission blocks (environment, allow, soft_deny, hard_deny) at project level. Writes .claude/settings.local.json behind a critique and sha256 gate; scans the user and shared settings for adoption candidates. Requires Claude Code 2.1.83+.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write target is .claude/settings.local.json.

    line 14
  2. Very specific:

    Before the dry-run, read CLAUDE.md, AGENTS.md, and .claude/CLAUDE.md (skip any that are absent) and translate what they say into prose …

    line 69
  3. Very specific:

    Never write autoMode into the shared file silently: it needs --write-shared, a confirmed prompt, and the classifier-ignores warning …

    line 110
  4. Very specific:

    Never expand "$defaults"; preserve it verbatim at its position.

    line 113
  5. Distinctive:

    Never treat a zero exit from the critique as approval on its own.

    line 114
  6. Very specific:

    Never let a proposal carry any top-level key besides autoMode.

    line 115

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

automode-config

Write target is .claude/settings.local.json. The user file (~/.claude/settings.json) and the shared file (.claude/settings.json) are read for adoption candidates, never written without an explicit opt-in flag plus a re-confirmation.

Three files

FilePathClassifier reads autoMode?This skillMode
User baseline~/.claude/settings.jsonyesread-only (write only via --hoist)0600, warn on 0644
Project local.claude/settings.local.jsonyesread + write, the main target0600
Project shared.claude/settings.jsonnoread for adoption; write needs --write-shared0644

Four sections

autoMode has exactly four array fields, all holding prose rules, not Tool(specifier) patterns. There is no ask bucket and no plain deny bucket; those belong to permissions.

  • environment: trust signals (repos, buckets, domains, services).
  • allow: exceptions overriding soft_deny for the same target.
  • soft_deny: destructive actions, overridable by allow or stated user intent.
  • hard_deny: unconditional. Not lifted by allow, by stated intent, or by --dangerously-skip-permissions.

Each section accepts the literal "$defaults" to splice Anthropic's curated baseline in at that position. Omitting it replaces that section's baseline end-to-end, per section, independently. The skill preserves the sentinel verbatim and never expands it; it warns on every write that drops it.

Procedure

# 1. See what the three files currently say, and what the project implies.
uv run scripts/inspect_automode.py
uv run scripts/scan_project.py --json

# 2. Build a proposal (see below), self-critique it until it stops
#    changing, then dry-run it for the canonical hash.
uv run scripts/apply_automode.py --proposal proposal.json --mode auto --dry-run

# 3. Commit with that hash as the gate predicate.
uv run scripts/apply_automode.py --proposal proposal.json --mode auto \
    --approved-canonical-hash <sha256>

Step 3 runs claude auto-mode critique, archives its output to .claude/.automode-history/, and refuses to write when the critique is missing or says nothing. Mode auto picks fresh or migrate from whether the local file already holds an autoMode block.

Building the proposal

Before the dry-run, read CLAUDE.md, AGENTS.md, and .claude/CLAUDE.md (skip any that are absent) and translate what they say into prose rules. Emit one JSON file covering all four sections:

Trap: allow overrides soft_deny unconditionally for the same target, so any soft_deny condition on a target an allow rule already opens is never enforced. Example: "allow": ["Deploying to release/* is allowed"] next to "soft_deny": ["Never deploy to release/* without a passing test suite"]: the test-suite condition never fires. Move the condition to hard_deny, or narrow the allow rule so it does not cover that case.

{
  "autoMode": {
    "environment": ["$defaults", "Source control: github.com/acme-corp and all repos under it"],
    "allow": ["$defaults", "Deploying to the staging namespace is allowed: it is isolated and resets nightly"],
    "soft_deny": ["$defaults", "Never run database migrations outside the migrations CLI"],
    "hard_deny": ["$defaults", "Never force-push to main or release/* branches"]
  }
}

Self-critique before the dry-run (mandatory)

Once the proposal is written, stop before running anything. Take the critic's seat, list every objection claude auto-mode critique and the lint would raise, rewrite the proposal, and run the pass again from scratch. Exit when a pass finds nothing new (cap: three passes, then ask the user). Checklist and exit rule: references/self_critique.md.

The deterministic guards apply regardless of what the agent proposes, and regardless of whether the vendor critique is reachable: schema validation, a semantic lint over rule content (misses a bare-noun allow/soft_deny overlap; see references/cli.md for --lint-strict / --no-lint and its other known limits), version-band probe, critique gate, hash gate, atomic write under flock.

Invariants

  • Never write autoMode into the shared file silently: it needs --write-shared, a confirmed prompt, and the classifier-ignores warning reprinted at write time.
  • Never expand "$defaults"; preserve it verbatim at its position.
  • Never treat a zero exit from the critique as approval on its own.
  • Never let a proposal carry any top-level key besides autoMode; hooks, env, permissions, and everything else fail validation, since a proposal is agent-authored and a pass-through key would install itself straight into your settings.

Slash command

/automode-edit <query> (commands/automode-edit.md) edits the local block in plain language and drives the same pipeline. It never touches the shared or user files unless the query asks and the user reconfirms.

References

Load on demand, not upfront.

FileRead it when
references/self_critique.mdalways, once the proposal is written
references/cli.mdyou need a flag or an exit code
references/automode_doc_bible.mdthe schema or the classifier's semantics is in question
references/mental_model.mdyou need the full six-phase flow and decision tree
references/three_files.mda per-file mode, gotcha, or precedence question comes up
references/migration.mdadopting existing rules, or picking a --migrate-strategy
references/critique_workflow.mdthe critique misbehaves, drifts, or the swap-file path triggers
references/canonicalization.mdbyte-level output, fixtures, or __example_only
references/recovery.mda write failed, or you need rollback / --repair
references/verification.mdyou are checking acceptance predicates

Docs (verified 2026-05-10): auto mode, permissions, permission modes, settings.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.