ccc-yolo-setup · diff
git:20260707.947ab2f to git:20261013.fbe187d
91 added, 50 removed. Audit A to A.
---
name: ccc-yolo-setup
- description: "One-click safe-YOLO + Plan mode — auto-approve read-only/safe ops via a vetted allowlist, keep Plan mode for risky changes. Use when: 'yolo setup', 'reduce prompts', 'fewer approvals'."
+ description: "Cut approval prompts safely: keep auto permission mode, add a vetted read-only allowlist plus secret deny rules, back up settings, and set bypassPermissions only with explicit consent. Use when the user says yolo setup, reduce prompts, fewer approvals, or skip permissions."
allowed-tools:
- Read
- Edit
- Bash
- AskUserQuestion
+ argument-hint: "[conservative | balanced | aggressive-safe | revert]"
+ model: sonnet
+ effort: medium
+ disable-model-invocation: true
---
- # /ccc-yolo-setup — Safe YOLO + Plan Mode
+ # /ccc-yolo-setup — safe YOLO permissions
- Reduce approval friction **without** going recklessly permissive. Safe-YOLO auto-approves a **vetted allowlist of read-only / non-destructive** operations, keeps **Plan mode** for anything that writes, deletes, or hits the network, and **logs every auto-approval** so the trail is auditable.
+ **CC Commander** · /ccc-yolo-setup · fewer prompts on safe operations, the auto-mode classifier on everything else, and a backup to roll back to.
- **CC Commander** · Reduce Approval Friction · [Docs](https://commanderplugin.com)
+ Interactive Claude Code sessions start in **auto permission mode** when no mode is configured: a classifier approves routine actions and denies risky ones without a prompt. Safe-YOLO builds on that default. It adds a vetted allowlist of read-only and non-destructive commands, adds deny rules for secret files, and leaves risky work (writes outside scope, deletes, deploys, force-push, network mutations) to the classifier or a prompt. Plan mode stays available on request for risky changes.
- ---
+ ## When to use / when not to
- ## What it does
+ - Use when routine reads, git/gh reads or cloud describes keep prompting.
+ - Use `/fewer-permission-prompts` (built in) to mine the user's own transcripts for further safe entries.
+ - Do not use to approve writes, deletes, deploys or cloud mutations; those stay gated.
+ - `revert` jumps to [Reverse it](#reverse-it).
- 1. **Allowlists safe, recurring commands** — reads, `git status/log/diff/show`, `gh pr/issue/run view|list`, `ls/grep/find/cat/head/tail`, read-only cloud describes/gets. No prompts for these.
- 2. **Keeps Plan mode the default** — risky changes (writes, deletes, deploys, force-push, network mutations) still surface a plan + approval.
- 3. **Audit logging** — every auto-approved call is appended to `~/.claude/commander/auto-approve-log.jsonl` so you can review what ran unattended.
+ ## What happens
- ## What it does NOT do
+ ### 1. Read the current state
- - ❌ It never enables blanket `--dangerously-skip-permissions`.
- - ❌ It never auto-approves writes, deletes, `rm`, `git push --force`, deploys, or money/cloud-mutating commands.
- - ❌ It never touches secrets-printing commands.
+ ```bash
+ for f in ~/.claude/settings.json .claude/settings.local.json .claude/settings.json; do
+ [ -f "$f" ] && node -e 'const s=JSON.parse(require("fs").readFileSync(process.argv[1],"utf8"));const p=s.permissions||{};console.log(process.argv[1]+": defaultMode="+(p.defaultMode||"unset (auto)")+" allow="+(p.allow||[]).length+" deny="+(p.deny||[]).length)' "$f"
+ done
+ ```
- ## Pick a profile (click-first)
+ Report each line. A parse error means the file is already invalid JSON: stop and show the error; do not write to it.
- Call `AskUserQuestion`:
+ ### 2. Pick a profile
+ Ask with AskUserQuestion (Codex: plain-text question):
+
```
- question: "How aggressive should safe-YOLO be?"
- header: "Safe-YOLO"
- multiSelect: false
+ question: "How much should safe-YOLO auto-approve?"
+ header: "Profile"
options:
- - label: "🟢 Conservative"
- description: "Auto-approve reads + git/gh read-only only. Everything else prompts. Safest."
- - label: "🟡 Balanced (recommended)"
- description: "Reads + git/gh reads + read-only cloud describes/gets + safe build/test. Plan mode for writes."
- - label: "🔴 Aggressive-safe"
- description: "Balanced + scoped writes inside the repo worktree. Still no deletes/deploys/force-push/network mutations."
+ - label: "🟢 Balanced"
+ description: "Reads, git/gh reads, read-only cloud describes, and this repo's test/lint/build scripts."
+ - label: "Conservative"
+ description: "Reads and git/gh read-only only. Everything else goes to auto mode or a prompt."
+ - label: "Aggressive-safe"
+ description: "Balanced plus file edits scoped to this repo. Still no deletes, deploys, force-push or network mutations."
```
- Then ask **where** to apply:
+ Profile entries: [references/allowlists.md](references/allowlists.md).
+ ### 3. Pick the scope
+
```
- question: "Apply to which scope?"
+ question: "Where should the rules apply?"
header: "Scope"
options:
- - label: "🌐 Global (~/.claude/settings.json)"
- description: "Every project + Desktop. Best for a single-user workstation."
- - label: "📁 This project (.claude/settings.local.json)"
- description: "Only this repo; gitignored so it doesn't ship to collaborators."
+ - label: "🟢 This project (.claude/settings.local.json)"
+ description: "Only this repo; gitignored, so it does not ship to collaborators."
+ - label: "Global (~/.claude/settings.json)"
+ description: "Every project and Desktop. Suits a single-user workstation."
```
- ## Apply
+ ### 4. Back up, merge, validate
- 1. **Back up first:** `cp <settings> <settings>.backup-$(date +%Y%m%d-%H%M%S)`.
- 2. Merge the profile's patterns into `permissions.allow` (de-dupe; never remove existing entries).
- 3. Ensure Plan mode stays the default (do **not** disable it).
- 4. Ensure the audit-log directory exists: `mkdir -p ~/.claude/commander`.
- 5. Re-read the file and confirm valid JSON before reporting success.
+ 1. Back up the target (skip if it does not exist yet):
+ ```bash
+ f=<settings-file>; [ -f "$f" ] && cp "$f" "$f.backup-$(date +%Y%m%d-%H%M%S)" && ls "$f".backup-* | tail -1
+ ```
+ 2. Merge entries without removing any existing ones. Run once with `allow` and the profile's entries, and once with `deny` and the deny rules from the reference:
+ ```bash
+ node -e '
+ const fs=require("fs"); const [file,key,...add]=process.argv.slice(1);
+ const s=fs.existsSync(file)?JSON.parse(fs.readFileSync(file,"utf8")):{};
+ s.permissions=s.permissions||{}; const set=new Set(s.permissions[key]||[]); const n=set.size;
+ add.forEach(e=>set.add(e)); s.permissions[key]=[...set];
+ fs.mkdirSync(require("path").dirname(file),{recursive:true});
+ fs.writeFileSync(file,JSON.stringify(s,null,2)+"\n"); console.log(key+": +"+(set.size-n));
+ ' <settings-file> allow 'Bash(git status:*)' 'Bash(git log:*)'
+ ```
+ 3. Leave `permissions.defaultMode` as it is. If it is set to something other than `auto` and the user wants fewer prompts, ask: 🟢 "Set it to auto" / "Keep it". Change it only on "Set it to auto".
+ 4. Re-run step 1 and confirm the file parses and the counts rose by the reported amounts.
- ### Vetted allowlist seed (Balanced)
+ ### 5. bypassPermissions — only with explicit consent
+ Offer this only when the user explicitly asks to skip all permission checks. Explain that `bypassPermissions` runs every tool call, including deletes and network writes, with no classifier and no prompt. Then ask:
+
```
- Bash(git status:*) Bash(git log:*) Bash(git diff:*) Bash(git show:*)
- Bash(gh pr view:*) Bash(gh pr list:*) Bash(gh run view:*) Bash(gh run list:*)
- Bash(ls:*) Bash(grep:*) Bash(find:*) Bash(cat:*) Bash(head:*) Bash(tail:*) Bash(wc:*)
- Bash(aws sts get-caller-identity:*) Bash(aws s3 ls:*) Bash(aws ec2 describe-instances:*)
+ question: "Turn off all permission checks for this project?"
+ header: "Bypass"
+ options:
+ - label: "🟢 No, stay in auto mode"
+ description: "Keeps the classifier and the allowlist. Recommended."
+ - label: "Yes, this project only"
+ description: "Sets permissions.defaultMode to bypassPermissions in .claude/settings.local.json. Use only in a disposable container or worktree."
```
- (Most of these are already auto-allowed by Claude Code; this skill adds the gaps + cloud read-only describes/gets. See `/fewer-permission-prompts` to mine your own transcripts for more.)
+ On "Yes", back up and set `defaultMode` in the project-local file only, never globally, then re-run step 1. Consent applies to this request only. The `ccc` CLI's own YOLO loop asks separately with a typed `yes`, and `CCC_DISABLE_SKIP_PERMISSIONS=1` disables that path.
+ ## Audit trail
+
+ The plugin's hooks log permission decisions and auto-mode denials to `~/.claude/commander/analytics/permission-gate.jsonl`; review them with `/ccc-safety`. Calls that match an allowlist entry are approved by Claude Code itself and are not logged one by one.
+
## Reverse it
- Restore the backup, or remove the added entries from `permissions.allow`. Plan mode is unaffected.
+ Restore the newest backup (`cp <settings-file>.backup-<stamp> <settings-file>`), or remove the added entries from `permissions.allow` and `permissions.deny` with the Edit tool. Re-run step 1 to confirm.
- ## Anti-patterns — DO NOT
+ ## Done when
- - ❌ Add interpreters (`python`, `node`, `bash`, `npx`) or `gh api *` to the allowlist — that's arbitrary code execution, not safe-YOLO.
- - ❌ Auto-approve any write/delete/deploy/force-push/network-mutation.
- - ❌ Disable Plan mode to "go faster" — safe-YOLO keeps the plan gate for risky work on purpose.
- - ❌ Skip the backup or the JSON re-validation.
+ - A backup path was printed (or the file was new).
+ - Step 1 re-runs cleanly on the target file and shows the added allow and deny counts.
+ - `defaultMode` is reported, and it is `bypassPermissions` only if the user chose "Yes, this project only" in step 5.
- ---
+ ## Guardrails
- **Bottom line:** fewer prompts on the safe stuff, a plan gate on the risky stuff, an audit trail on all of it. Pair with `/fewer-permission-prompts` to extend the allowlist from your real usage.
+ - Never add interpreters (`python`, `node`, `bash`, `npx`) or `gh api *` to the allowlist; that is arbitrary code execution.
+ - Never auto-approve writes outside the repo, deletes, deploys, force-pushes or network mutations.
+ - Never set `bypassPermissions` without the step 5 consent, and never in global settings.
+ - Never remove existing entries, skip the backup, or skip the re-validation.
+ - Never print secret-bearing settings values; report counts and modes only.
+
+ ## See also
+
+ - `/ccc-nightwatch` — approve risky calls from a phone during unattended runs.
+ - `/ccc-night-mode` — the autonomous build these settings support.
+ - `/ccc-safety` — review permission decisions.
+ - `/ccc-settings` — other Claude Code settings.
---
> ⚙️ **Fable contract:** plan before build · verifier ≠ worker · prove before alarm · loops need gates · leave durable state — `rules/fable-method.md`