diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c471a9..d5949bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,11 @@ The version is carried in `pyproject.toml` and `src/assistant/__init__.py` - Add an attention overview with compact task cards, expandable return notes, and reminders to finish older pending work before starting another task. +### Changed +- `spawn-claude-workspace` no longer adds `--dangerously-skip-permissions` + for `engine=claude`. Child sessions use the `claude` alias, which runs in + auto mode, and the ready check waits for `auto mode on`. + ### Fixed - Bring the warm Slack session up again on Claude Code 2.1.303 and cmux 0.65. Claude Code now writes several hundred KB of records right after each prompt, diff --git a/skills/spawn-claude-workspace/SKILL.md b/skills/spawn-claude-workspace/SKILL.md index 7550919..1905361 100644 --- a/skills/spawn-claude-workspace/SKILL.md +++ b/skills/spawn-claude-workspace/SKILL.md @@ -40,8 +40,9 @@ bracket number. Leave naming and color to the daemon. ### `claude` -- Launch via the login-shell `claude` alias PLUS an explicit `--dangerously-skip-permissions`. The alias may drift and drop the flag; adding it explicitly is idempotent and prevents an unattended session stalling on the first permission gate. The alias still supplies `--model`, `--add-dir`, etc. -- The command must run in a login shell so the alias expands: `zsh -lic 'claude --dangerously-skip-permissions'`. +- Launch via the login-shell `claude` alias. It runs `--permission-mode auto`, so the child gets the same auto-mode safety checks. Never add `--dangerously-skip-permissions`. +- The command must run in a login shell so the alias expands: `zsh -lic claude`. +- Run each cmux step as its own command, with nothing piped or chained around it. - Do NOT hardcode `--model`/`--add-dir` — the alias owns them. Override `--model` only when the task genuinely needs a different tier. - Claude transcripts: `~/.claude/projects//.jsonl`. `` is the cwd with every `/` replaced by `-` (leading `-` included). Sessions share one project dir; confirmation is a NEW jsonl appearing after spawn. - Never fall back to Droid if Claude fails. @@ -96,8 +97,8 @@ LAUNCH_CMD="droid --settings '$HOME/.assistant/droid-glm-settings.json' --auto h if test -f "$HOME/.claude/CLAUDE.md"; then LAUNCH_CMD="$LAUNCH_CMD --append-system-prompt-file '$HOME/.claude/CLAUDE.md'" fi -# engine=claude (login shell so the alias expands; explicit dsp for unattended runs): -LAUNCH_CMD="zsh -lic 'claude --dangerously-skip-permissions'" +# engine=claude (login shell so the alias expands; the alias runs auto mode): +LAUNCH_CMD="zsh -lic claude" OUT=$(cmux new-workspace --cwd "$CWD" --name "$TITLE" --focus false --command "$LAUNCH_CMD") WS_REF=$(printf '%s' "$OUT" | grep -oE 'workspace:[0-9]+' | head -n1) SURFACE_REF=$(cmux list-pane-surfaces --workspace "$WS_REF" | grep -oE 'surface:[0-9]+' | head -n1) @@ -107,7 +108,7 @@ test -n "$WS_REF" && test -n "$SURFACE_REF" 5. Poll the whole screen until the engine is ready. Read 200 lines and accept an engine-appropriate marker: - **droid**: `GLM-5.2`, `allow all commands`, `Skills ()`, or `? for help`. Do not accept a Claude banner. -- **claude**: the Claude Code prompt box / `? for shortcuts`, `bypass permissions` (the dsp banner), or the model id `claude-opus`. Do not accept a Droid banner. +- **claude**: `auto mode on` in the footer. Do not accept a Droid banner or `bypass permissions on`. ```bash READY=0 @@ -116,7 +117,7 @@ for _ in $(seq 1 30); do # engine=droid: if printf '%s' "$SCREEN" | grep -Eq 'GLM-?5\.2|allow all commands|Skills \([0-9]+\)|\? for help'; then READY=1; break; fi # engine=claude: - if printf '%s' "$SCREEN" | grep -Eiq 'bypass permissions|\? for shortcuts|claude-opus|Welcome to Claude'; then READY=1; break; fi + if printf '%s' "$SCREEN" | grep -q 'auto mode on'; then READY=1; break; fi sleep 1 done test "$READY" = 1