From 3442ed9607cab12d1e8e909e5520af6f1ecfc919 Mon Sep 17 00:00:00 2001 From: autocommit Date: Sat, 6 Jun 2026 20:54:27 -0700 Subject: [PATCH] =?UTF-8?q?feat(cli):=20=E2=9C=A8=20Add=20--spawn=20flag?= =?UTF-8?q?=20to=20enable=20headless=20operation=20in=20claude-rc=20and=20?= =?UTF-8?q?default=20to=20worktree=20spawn=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- bin/claude-rc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/claude-rc b/bin/claude-rc index 2c5b2eb..7adaf00 100755 --- a/bin/claude-rc +++ b/bin/claude-rc @@ -64,7 +64,11 @@ case "$cmd" in dir=$(reg_dir "$name") [ -n "$dir" ] || { echo "claude-rc: '$name' not in $REG" >&2; exit 1; } cd "$dir" || { echo "claude-rc: dir missing: $dir" >&2; exit 1; } - exec claude rc --name "$name" + # --spawn is mandatory for headless operation: without it `claude rc` + # prompts "Choose [1/2]" for spawn mode and blocks forever. Default to + # worktree (isolated session per spawn — safe for concurrent agents); + # override per-instance with CLAUDE_RC_SPAWN=same-dir|session. + exec claude rc --name "$name" --spawn "${CLAUDE_RC_SPAWN:-worktree}" ;; list|ls) printf '%-16s %-10s %s\n' NAME STATE DIR