bip-conductor-spawn
Spawn a Claude session in a clone for an EPIC issue
by matsen★ 35 GitHub stars
Install bip-conductor-spawn in Claude Code & Claude Desktop
Sign up to install this skill
Create a free account to reveal the install command and save the skill to your library.
- Reveal the one-line install command
- Save skills to your synced library
- Get notified when skills update
About this skill
/bip-conductor-spawn
Spawn a Claude Code worker in a tmux window for a GitHub issue. The worker runs in a ralph-loop with an issue-lead subagent at stopping points.
The conductor runs this skill and adds the live fleet facts that /bip-epic cannot see.
Usage
/bip-conductor-spawn <issue-number> [clone-name]
If clone-name is omitted, pick the best idle clone.
Configuration
Reads .epic-config.json from the repo root (format: /bip-conductor). If it is missing, stop and ask the user to set it up via /bip-conductor.
Where the prompt comes from
Usually /bip-epic has written the brief to $CLONE_ROOT/.spawn-prompts/, as <N>.md (current) or spawn-<N>.txt (older). Check there first:
source "$(dirname "<this-skill's-base-directory>")/lib/spawn-intent.sh"
CLONE_ROOT=$(resolve_clone_root .epic-config.json)
INTENT=$(find_spawn_intent "$CLONE_ROOT" <N>)
[ -n "$INTENT" ] && cat "$INTENT"
<this-skill's-base-directory> is this skill's base directory as given at invocation; lib/spawn-intent.sh is a sibling of every skill directory.
- Intent file present: it is the base of Step 4's
IMPORTANT CONTEXT. Check it against live state (Step 2b), append fleet facts it couldn't know (free host/clone, a worker on an overlapping file, a build on the target host), and mark it consumed after launch (Step 6). An epic brief has anEPIC:line near the top; the conductor counts live slots by it. Three forms are in use (EPIC: matsengrp/phyz#369,EPIC: 369,**EPIC**: #369), so match withgrep -iE '^\**EPIC\**:? *([[:alnum:]_.-]+/[[:alnum:]_.-]+)?#?([0-9]+)'. If an epic brief lacks one, ask the epic; a user-originated brief has none. - No intent file: compose the prompt from the issue; this is normal (user spawns, respawns, maintenance), so don't wait for a brief. An issue may belong to no EPIC; never reject or defer it for that (
/bip-conductor"Terms and intake").
Resolve a conflict between intent and fleet state from measured state, and report it. Escalate only per /bip-conductor "Arbitration".
Workflow
Prerequisite: Issue number required
Every spawn targets an existing issue (EPIC tracking, PR linking and slot monitoring need one). If none exists, file a minimal one (title, 3-sentence motivation, success criteria) through /bip-issue-check.
Step 1: Select or create slot
Read clone_root and local_worktrees from .epic-config.json.
Clone mode (local_worktrees absent or false). If clone-name is not given, find an idle clone:
source "$(dirname "<this-skill's-base-directory>")/lib/spawn-intent.sh"
CLONE_ROOT=$(resolve_clone_root .epic-config.json)
OCCUPIED=$(tmux list-panes -a -F '#{pane_current_path}' 2>/dev/null) || OCCUPIED=""
for name in $(jq -r '.clone_names[]' .epic-config.json); do
dir="$CLONE_ROOT/$name"
[ "$(git -C "$dir" branch --show-current 2>/dev/null)" = "main" ] || continue
# Capture, then test: a bare `-z` on failed output reads "unreadable" as "clean".
# `st`, not `status`: zsh makes `status` read-only.
st=$(git -C "$dir" status --porcelain 2>/dev/null) || continue
[ -z "$st" ] || continue
echo "$OCCUPIED" | grep -qxF "$dir" && continue # live tmux pane here → owned
[ -f "$dir/.epic-status.json" ] && continue # a worker claimed it, unfinished
[ -f "$CLONE_ROOT/.holds/$name" ] && continue # a conductor hold (bip-conductor Step 4)
echo "$name"
done
If tmux fails, every clone looks free; bip spawn's refusal of an occupied directory (Step 5) is the real guard.
If all are busy, offer to create a clone named from new_clone_names (see "Creating new slots").
Worktree mode (local_worktrees: true). Slot is issue-<N>; branch is <N>-<slug>, slug = first 4 words of the issue title, lowercased and hyphenated.
source "$(dirname "<this-skill's-base-directory>")/lib/spawn-intent.sh"
CLONE_ROOT=$(resolve_clone_root .epic-config.json)
SLOT="$CLONE_ROOT/issue-<N>"
if [ -d "$SLOT" ]; then
# Worktree exists — check for active tmux window
if tmux list-windows -F "#W" | grep -q "^<N>-issue-<N>$"; then
echo "Active session already running for <N>-issue-<N> — attach to it instead"
exit 0
else
echo "Worktree exists, no active session — will resume"
fi
else
# Check for leftover branch from a previous failed attempt
if git branch --list "<N>-*" | grep -q .; then
git branch -D $(git branch --list "<N>-*" | tr -d ' ')
fi
# Create worktree from the main repo (conductor's working directory)
git worktree add "$SLOT" -b <N>-<slug>
fi
Step 2: Prepare slot and clean stale state
Run each block below as one command; the working directory does not persist between Bash calls.
Preserve the prior state; only if that did not fail, clear .epic-status.json, .epic-worklog.md and .claude/ralph-loop.local.md. Delete with find <absolute-path> -delete, not rm: a $ in an rm command trips Claude Code's destructive-removal guard, even in by
Allowed tools
Tools this skill is permitted to call.
No restriction — this skill can use any tool.
Bundled files
- context-additions.md
- worker-brief.txt
FAQ
What does the bip-conductor-spawn skill do?
Spawn a Claude session in a clone for an EPIC issue
How do I install the bip-conductor-spawn skill?
Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.
Does the bip-conductor-spawn skill run scripts?
No, this skill is instructions only (SKILL.md) with no executable scripts.
Related skills
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…