| name | loop-loop-launch-a |
| description | Pre-flight checks and launch for agent loops. Validates branch state, session prompts, creates loop directory structure, and launches run.sh in a tmux session. Use when the user wants to start a new agent loop in the current repo.
|
| metadata | {"source-plugin":"loop","source-skill":"loop-launch-a"} |
Action skill — Pre-flight, setup, and launch for agent loops.
Input
$ARGUMENTS
Launch an agent loop in the current repo. This skill handles everything from validation to tmux launch.
Pre-Flight Checks
Run these checks before launching. If any fail, report the issue and stop — do not launch a broken loop.
1. Git State
git status --porcelain
- If there are uncommitted changes, warn the user. Uncommitted work can be lost or cause conflicts during the loop.
- Suggest committing or stashing before launch.
2. Branch State
git rev-parse --abbrev-ref HEAD
- Note the current branch — this becomes the base branch for the loop.
3. Existing Loops
ls agents/loops/ 2>/dev/null
- If other loops are running, warn about potential conflicts (especially if on the same branch).
- Check
~/.claude-loops/registry.jsonl for start events without matching end events in this repo.
4. Tooling Setup
ls agents/prompts/session.md agents/prompts/worker.md agents/prompts/reviewer.md agents/run.sh 2>/dev/null
Loop ID
Derive the loop-id from the user's input:
- If the user provided a loop-id, use it directly
- If the user described a task, derive a short kebab-case slug (e.g., "fix auth flow" →
fix-auth-flow)
- Append timestamp:
{slug}_{YYYYMMDD_HHMM} (e.g., fix-auth-flow_20260315_1430)
Session Prompts
Check if session prompts exist for this loop:
ls agents/loops/{loop-id}/session/SESSION_WORKER.md agents/loops/{loop-id}/session/SESSION_REVIEWER.md 2>/dev/null
If they don't exist:
- Ask the user if they want to write them now or have you generate them
- If generating, invoke the
loop-author-a skill with the task description
- If writing manually, create the directory structure and tell them where to write:
agents/loops/{loop-id}/session/SESSION_WORKER.md
agents/loops/{loop-id}/session/SESSION_REVIEWER.md
Launch
Once pre-flight passes and session prompts exist:
./agents/run.sh --loop-id {loop-id} [additional flags]
run.sh automatically wraps itself in a tmux session named loop-{loop-id}.
Additional Flags
Ask the user or infer from context:
--max-iter N — default is 5
--worker-spec FILE — specialization (e.g., planner.md, python.md, rust.md)
--pr-per-iteration — enable PR-per-iteration branching
--claude-effort LEVEL — low, medium (default), or high
Post-Launch Output
After launching, tell the user:
- The tmux session name:
loop-{loop-id}
- How to attach:
tmux attach -t loop-{loop-id}
- How to detach without stopping:
Ctrl+B, then D
- How to check status: point them to the
loop-observe-a skill
- Where state files will live:
agents/loops/{loop-id}/state/
- Where git-committed history will be:
.agent-loops/{loop-id}/
Common Patterns
| User says | What to do |
|---|
| "Start a loop for X" | Full pre-flight → generate prompts → launch |
| "Launch loop {id}" | Pre-flight → check prompts exist → launch |
| "Resume loop {id}" | Check if loop dir exists, session prompts present → launch with existing dir |