Parallel sessions
@slashclone/parallel-sessions
Build faster with several Claude Code sessions at once. Splits a big plan into independent workstreams, writes a brief for each, runs each in its own git worktree and branch, and merges every pull request on green CI in a safe order. Works in the Claude Code desktop app and in the terminal.
SkillDevOpsv0.1.0 (latest)
- Activity
- New: be the first to try it
- Installs
- 0 installs
- Likes
- 0 likes
- Clones
- 0 clones
- 1---
- 2name: parallel-sessions
- 3description: Split a big build into independent workstreams and run each one as its own Claude Code session, in its own git worktree and branch, ending in its own pull request, while one lead session plans, briefs, and merges them in a safe order. Use when a plan has several pieces that can be built at the same time, when someone asks to "fan out", "run these in parallel", or "split this up", or before starting any multi-stage build.
- 4---
- 6# Parallel sessions
- 8Goal: turn one long, serial build into several sessions that work at the same time without stepping on each other, and land every piece safely on the main branch.
- 10One **lead** session (the one the person is talking to) plans and coordinates. Each **workstream** runs in its own session, in its own git worktree (a separate folder on its own branch), and ends in its own pull request. Nothing ships until CI passes on it.
- 12## When to use it
- 14Use it when a plan has two or more pieces of real work (more than a handful of tool calls each) that pass the independence test below. Do not split:
- 16- quick things (a question, one edit, a few commands): do them in the lead session;
- 17- a final check that needs every piece together (run the full test suite, a demo): run it in the lead after the pieces merge;
- 18- pieces that must land in one change together.
- 20## The independence test
- 22A piece can run in its own session only if all of these hold:
- 241. It needs no other piece's result to start.
- 252. No other piece needs its result to start.
- 263. It touches no files another piece touches, apart from shared append-only logs (see Conflict rules).
- 274. It does not need uncommitted changes from the lead session.
- 29If two pieces share files, either merge them into one workstream or run them one after the other.
- 31## Steps
- 331. **Plan.** Read the project's own rules (CLAUDE.md, README, contributing docs) and the plan. List the pieces of work.
- 342. **Group.** Apply the independence test. Group pieces into workstreams, aiming for 3 to 6. More than about 6 at once gets hard for one person to steer.
- 353. **Settle decisions first.** Anything only the person can decide (a new dependency, a vendor, a price, a policy) gets asked now, in one batch, so no session stalls on it later. Record each answer in the brief that needs it.
- 364. **Write a brief per workstream** using the template below. The brief is all the session knows, so it carries the quality of the result.
- 375. **Start the sessions.**
- 38 - **Claude Code desktop app:** start one session per workstream, each with its own worktree, and give it the brief. Name each one so it is easy to refer to.
- 39 - **Terminal:** for each workstream, run `git worktree add ../<repo>-<name> -b <name>` from the repository, open a new terminal there, start `claude`, and paste the brief. Show the person these commands; let them run them.
- 40 - **Inside one session only:** if neither of the above is available, run each workstream as a subagent with its own worktree, and open the pull requests yourself when they return.
- 416. **Coordinate.** While they run: answer questions a session sends, forward the person's decisions word for word, and watch for two sessions drifting toward the same files. Never poll; wait to be told a session finished a turn.
- 427. **Merge in order.** Each session merges its own pull request when CI passes. Shared files decide the order: the workstream that changes a shared convention (log format, config layout) merges last, after rebasing on everything else.
- 438. **Integrate.** When all pieces are on the main branch, the lead runs the checks that need everything together and reports what each session produced (its pull request, what is not done).
- 45## Brief template
- 47```text
- 48Task: <one paragraph: what to build and why>
- 49Area: <files, folders, and docs to read first>
- 50Decisions already made: <answers from step 3 that apply here>
- 51Rules: <the project's rules that matter: style, tests, security, no new dependencies without asking>
- 52Out of scope: <what other sessions are doing, so it stays in its lane>
- 53Shared files: <logs or configs others also touch, and how to resolve conflicts in them>
- 54Done means: <tests added, checks green, docs updated, one pull request merged on green CI, no release>
- 55Ask the person before: <anything outward facing or hard to undo>
- 56```
- 58## Conflict rules
- 60- **One writer per set of files.** Two sessions never edit the same files. If they must, run them in sequence.
- 61- **Shared append-only logs** (a progress log, a changelog) conflict on every parallel pull request. Tell each session to keep both entries in date order when it rebases, or better, switch to one file per session.
- 62- **Database migrations:** only one workstream adds migrations at a time, or each takes the next number only after rebasing, so two branches never claim the same number.
- 63- **Overlapping features** (two workstreams touching the same subsystem, for example two sign-in methods): name the overlap in both briefs and say which one builds the shared part; the other rebases onto it.
- 64- **Rebase, do not merge,** the main branch into a workstream before its final CI run.
- 66## Rules
- 68- Every workstream ends in a pull request that merges only after CI passes. Merging is not releasing; releases stay with the person.
- 69- A session's report is a claim, not proof. Check the pull request or diff before telling the person something is done.
- 70- Never invent or predict a session's result.
- 71- Never publish, send, buy, or delete anything outward facing from a workstream without the person's yes.
- 72- Keep secrets out of briefs. Point to where a secret lives, never paste its value.
