skills/parallel-claudes/SKILL.md
Guide for running multiple parallel Claude Code sessions using cw (Claude Worktree Manager). Use when the user wants to parallelize work across multiple Claude instances, manage git worktrees for concurrent AI coding tasks, or merge results back together. Triggers on tasks involving parallel Claude sessions, worktree management, or splitting work across multiple agents.
npx skillsauth add joyco-studio/skills parallel-claudesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are the root orchestrator. When the user asks you to parallelize work, you manage the entire lifecycle: analyze the task, split it into subtasks, create isolated worktrees, launch headless Claude subagents, monitor their progress, and merge everything back.
Before starting, verify these are available:
cw — if missing, install with: curl -fsSL https://raw.githubusercontent.com/joyco-studio/cw/main/install.sh | bashclaude CLI (Claude Code)gh CLI (GitHub CLI, required for PR-based merge)When the user describes a task, break it into independent subtasks that won't create file conflicts. Each subtask becomes a worktree with its own Claude subagent.
Rules for splitting:
feat-auth, fix-nav, add-tests)Tell the user your plan before proceeding: list the subtasks, their names, and what each subagent will do.
Before starting any work, you MUST ask the user which merge strategy to use:
cw merge <name> --local) — squash-merges directly into the current branch, no PR created.cw merge <name>) — pushes the branch and opens a GitHub PR for review.Use the AskUserQuestion tool to present this choice. Do NOT proceed to Step 2 until the user has answered.
Use the Bash tool to create all worktrees. Always use --no-open — without it, cw new enters an interactive prompt that will hang indefinitely.
cw new <name> --no-open
Run all cw new commands sequentially in a single Bash call:
cw new feat-auth --no-open && cw new feat-api --no-open && cw new feat-tests --no-open
Launch a headless Claude process in each worktree using the Bash tool with run_in_background: true. Each subagent runs autonomously and exits when done.
For each subtask, run a separate background Bash command:
cw cd <name> && claude -p "<detailed prompt>. Commit your changes when done." --output-format text --dangerously-skip-permissions
Critical rules:
-p flag — this runs Claude in non-interactive (print) mode. It executes the prompt and exits.--output-format text for clean output.--dangerously-skip-permissions — subagents run in isolated worktrees (throwaway branches), so they need full autonomy to read, write, and execute without prompting for approval. Without this flag, subagents will hang waiting for permission in their terminal windows.cw merge has nothing to merge.After launching, poll for completion:
TaskOutput with block: false to check on each background task without blocking.cw ls to see commits-ahead count for each worktree.Before merging, verify that each subagent actually committed its work. Run cw ls and check that every worktree shows commits ahead > 0.
cw ls
If a worktree has 0 commits ahead, the subagent failed to commit. Navigate into it and commit manually:
cw cd <name> && git add -A && git commit -m "Complete <subtask description>"
Do NOT proceed to merging until every worktree has at least one commit.
After verifying, provide the user with the commands to step into each worktree manually in case they want to review or continue the work themselves:
To step into any worktree and take over:
cw cd <name> # enter the worktree
claude # start an interactive Claude session there
List all worktree names so the user can copy-paste. Then ask the user if they want to proceed with merging or take over manually.
Once all worktrees have verified commits, merge each one using the strategy the user chose in Step 1:
# If user chose remote (GitHub PR)
cw merge <name>
# If user chose local (squash merge, no PR)
cw merge <name> --local
If there are dependencies between subtasks (e.g., DB migrations before API routes), merge them in the correct order.
After all merges are complete:
cw clean
cw Commands Reference| Command | Description |
|---|---|
| cw new <name> --no-open | Create a worktree without interactive prompts |
| cw cd <name> | Change directory into a worktree |
| cw ls | List all worktrees with branch and commits-ahead count |
| cw merge <name> | Push branch and create a GitHub PR |
| cw merge <name> --local | Squash-merge locally (no PR) |
| cw rm <name> | Remove a worktree and its branch |
| cw clean | Remove all worktrees |
User asks: "Build a settings feature with UI, API, and database layers"
You do:
Tell the user the plan: 3 parallel subtasks — feat-ui, feat-api, feat-db
Create worktrees (single Bash call):
cw new feat-ui --no-open && cw new feat-api --no-open && cw new feat-db --no-open
run_in_background: true):cw cd feat-ui && claude -p "Build the settings page UI. Create components in src/components/settings/ using the existing design system in src/components/ui/. Include a form for updating user preferences with fields for: display name, email notifications toggle, and theme selector. Commit your changes when done." --output-format text --dangerously-skip-permissions
cw cd feat-api && claude -p "Create REST API routes for settings in src/api/settings/. Add GET /api/settings and PUT /api/settings endpoints. Use the existing auth middleware from src/middleware/auth.ts. Return and accept JSON matching the Settings type. Commit your changes when done." --output-format text --dangerously-skip-permissions
cw cd feat-db && claude -p "Add a settings table migration in src/db/migrations/. Columns: user_id (FK to users), display_name (text), email_notifications (boolean, default true), theme (text, default 'system'). Add the Settings model in src/db/models/. Commit your changes when done." --output-format text --dangerously-skip-permissions
Monitor with TaskOutput (block: false) and cw ls
Merge in dependency order:
cw merge feat-db && cw merge feat-api && cw merge feat-ui
cw clean
cw not found: Source it in the shell — source ~/.local/bin/cwcw cd doesn't change directory: Ensure cw is loaded as a shell function, not just a scriptcw mergecw merge refuses: There are uncommitted changes in the worktree — the subagent may not have committed. Navigate in with cw cd <name> and commit manuallyTaskOutput. If stuck, stop the background task and retry with a revised prompttools
Add sound effects, UI audio, and ambient sound to a web app using the @joycostudio/suno library. Use when the user wants to play audio on button clicks, hover states, game events, or ambient loops, and when they mention @joycostudio/suno, Suno, AudioSource, Voice, or Mixer.
tools
Analyze a Chrome DevTools Performance trace JSON file for performance anomalies, producing a structured audit report with critical issues, warnings, metrics, timeline hotspots, and actionable recommendations.
development
Analyze a bye-thrash layout thrashing report array. Parses stack traces, identifies user-code functions causing forced reflows, locates the offending style-write → layout-read pairs in source files, and produces a structured fix-suggestion report.
development
Author or refactor a skill in this repo. Use when the user asks to "create a skill", "write a skill", "add a new skill", "document this as a skill", or to restructure an existing SKILL.md (split it up, slim it down, fix the frontmatter). Covers frontmatter conventions, file layout, and the rule for splitting deep reference material into linked docs instead of bloating SKILL.md.