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