[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fh6lah14xy483":3,"code:820d1f42-9431-42a9-b0b6-9ab0079166ee:text":1138,"code:af379259-aa4b-4a70-841a-211cc9109c52:text":1139,"code:314e7317-f494-4adf-aa56-841ebb0b5228:text":1140,"code:efbfd93b-5754-46c9-9af1-9acc4b5439d9:text":1141},{"_id":4,"author":5,"body":16,"excerpt":1129,"mainImage":1130,"publishedAt":1134,"slug":1135,"title":1136,"updatedAt":1137},"devpost-the-ultimate-claude-code-parallelisation-guide-2026",{"image":6,"linkedin":11,"name":12,"role":13,"shortBio":14,"slug":15},{"_type":7,"asset":8},"image",{"_ref":9,"_type":10},"image-50136b043a94b509af172206f08bc917decb5f7f-800x800-jpg","reference","https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Foliver-bagin\u002F","Oliver Bagin","Co-founder & CTO at Draper","All things software at Draper. Currently optimising everything in my life.","oliver-bagin",[17,29,37,45,53,68,80,89,94,102,110,134,142,154,166,178,194,202,210,218,223,247,255,275,287,299,315,327,339,351,367,375,380,396,404,425,437,457,485,494,510,518,526,531,539,555,558,563,571,583,595,607,627,639,651,659,668,676,696,724,736,752,760,768,776,788,800,812,820,828,836,839,847,852,860,876,903,915,927,935,943,962,997,1005,1013,1016,1024,1029,1037,1045,1057,1069,1081,1093,1105,1113,1121],{"_key":18,"_type":19,"children":20,"markDefs":27,"style":28},"d7cd87c62631","block",[21],{"_key":22,"_type":23,"marks":24,"text":26},"d7cd87c626310","span",[25],"em","How we run five Claude Code sessions at once at Draper: git worktrees, Docker, Linear, tmux, and a small CLI we call swt.",[],"normal",{"_key":30,"_type":19,"children":31,"markDefs":36,"style":28},"189787866c98",[32],{"_key":33,"_type":23,"marks":34,"text":35},"189787866c980",[],"One Claude Code session is a great engineer. Five Claude Code sessions in the same checkout are five great engineers fighting over one desk, one database, and one set of ports.",[],{"_key":38,"_type":19,"children":39,"markDefs":44,"style":28},"11dd6406d78a",[40],{"_key":41,"_type":23,"marks":42,"text":43},"11dd6406d78a0",[],"This post is the full recipe we use at Draper to run many agents in parallel without them ever touching each other: how tickets flow from Slack through Linear, how Docker plus git worktrees gives each agent a private universe, and how one command (swt new eng-451) turns a ticket into a running, isolated, agent-ready workspace with a draft PR already open.",[],{"_key":46,"_type":19,"children":47,"markDefs":52,"style":28},"c017baae396a",[48],{"_key":49,"_type":23,"marks":50,"text":51},"c017baae396a0",[],"Two notes before we start:",[],{"_key":54,"_type":19,"children":55,"level":65,"listItem":66,"markDefs":67,"style":28},"b62eac6298b9",[56,61],{"_key":57,"_type":23,"marks":58,"text":60},"b62eac6298b90",[59],"strong","This article covers our development tooling only, not how the deploy works.",{"_key":62,"_type":23,"marks":63,"text":64},"b62eac6298b91",[]," The deploy side (per-PR preview environments, the release pipeline itself) is its own story, and we're happy to write it up if people want it. Let us know.",1,"bullet",[],{"_key":69,"_type":19,"children":70,"level":65,"listItem":66,"markDefs":79,"style":28},"3531d82c87b6",[71,75],{"_key":72,"_type":23,"marks":73,"text":74},"3531d82c87b60",[59],"Everything in this post was built by asking an agent to build it.",{"_key":76,"_type":23,"marks":77,"text":78},"3531d82c87b61",[]," At every step I've included the prompt you can paste into your own agent to get the equivalent for your repo. You don't need to write any of this by hand.",[],{"_key":81,"_type":19,"children":82,"markDefs":87,"style":88},"95431684cf6f",[83],{"_key":84,"_type":23,"marks":85,"text":86},"95431684cf6f0",[],"1. The motivation: Claude sessions aren't isolated by default",[],"h2",{"_key":90,"_type":7,"alt":91,"asset":92},"cec099f1-870b-4cca-aef4-22a1f6851829","Claude + Docker + Linear > vanilla claude code",{"_ref":93,"_type":10},"image-5309608569e021244c5310ba03192aa341f76363-1600x620-png",{"_key":95,"_type":19,"children":96,"markDefs":101,"style":28},"e1e4af3ac424",[97],{"_key":98,"_type":23,"marks":99,"text":100},"e1e4af3ac4240",[],"Git worktrees solve half the problem, and it's the half everyone talks about. Each worktree is a separate checkout on its own branch, so two agents never edit the same file. Code isolation: done.",[],{"_key":103,"_type":19,"children":104,"markDefs":109,"style":28},"72549b85d909",[105],{"_key":106,"_type":23,"marks":107,"text":108},"72549b85d9090",[],"Then session two starts its dev server.",[],{"_key":111,"_type":19,"children":112,"markDefs":133,"style":28},"aaf53392f98f",[113,117,121,125,129],{"_key":114,"_type":23,"marks":115,"text":116},"aaf53392f98f0",[],"Our monorepo runs a Nuxt chat app on 3002, a Fastify API on 3000, a node-graph editor on 3003, a Prefect server on 4200, a CMS dev server on 4001 and an OTLP collector on 4318. Claude Code sessions are port-hungry: every parallel session wants its own copy of ",{"_key":118,"_type":23,"marks":119,"text":120},"aaf53392f98f1",[25],"all",{"_key":122,"_type":23,"marks":123,"text":124},"aaf53392f98f2",[]," of that. The second session either dies with EADDRINUSE, or, much worse, it silently connects to the ",{"_key":126,"_type":23,"marks":127,"text":128},"aaf53392f98f3",[25],"first",{"_key":130,"_type":23,"marks":131,"text":132},"aaf53392f98f4",[]," session's server and cheerfully \"verifies\" its change against code it never wrote. That second failure mode is the expensive one. The agent isn't wrong, its world is.",[],{"_key":135,"_type":19,"children":136,"markDefs":141,"style":28},"a714bd48f609",[137],{"_key":138,"_type":23,"marks":139,"text":140},"a714bd48f6090",[],"And ports are only the visible symptom. Vanilla parallel sessions also share:",[],{"_key":143,"_type":19,"children":144,"level":65,"listItem":66,"markDefs":153,"style":28},"03e1571edc62",[145,149],{"_key":146,"_type":23,"marks":147,"text":148},"03e1571edc620",[59],"One database.",{"_key":150,"_type":23,"marks":151,"text":152},"03e1571edc621",[]," Agent A runs a half-finished migration while agent B is mid-task. Agent B's world just changed shape underneath it.",[],{"_key":155,"_type":19,"children":156,"level":65,"listItem":66,"markDefs":165,"style":28},"f4aad5d79f78",[157,161],{"_key":158,"_type":23,"marks":159,"text":160},"f4aad5d79f780",[59],"One .env.",{"_key":162,"_type":23,"marks":163,"text":164},"f4aad5d79f781",[]," An agent tweaks a variable to test something, and every other session inherits it.",[],{"_key":167,"_type":19,"children":168,"level":65,"listItem":66,"markDefs":177,"style":28},"8d65dc152f0e",[169,173],{"_key":170,"_type":23,"marks":171,"text":172},"8d65dc152f0e0",[59],"One set of background state",{"_key":174,"_type":23,"marks":175,"text":176},"8d65dc152f0e1",[],": queues, caches, uploaded files, seeded users.",[],{"_key":179,"_type":19,"children":180,"markDefs":193,"style":28},"9ee35c866188",[181,185,189],{"_key":182,"_type":23,"marks":183,"text":184},"9ee35c8661880",[],"So the actual requirement is stronger than \"separate branches.\" Every session needs its own ",{"_key":186,"_type":23,"marks":187,"text":188},"9ee35c8661881",[25],"environment",{"_key":190,"_type":23,"marks":191,"text":192},"9ee35c8661882",[],": own services, own database, own hostnames, own blast radius. That's the recipe in one line:",[],{"_key":195,"_type":19,"children":196,"markDefs":201,"style":28},"0001022a37e9",[197],{"_key":198,"_type":23,"marks":199,"text":200},"0001022a37e90",[59],"Claude Code + Docker + Linear > Claude Code.",[],{"_key":203,"_type":19,"children":204,"markDefs":209,"style":28},"b40a6be038c1",[205],{"_key":206,"_type":23,"marks":207,"text":208},"b40a6be038c10",[],"Docker gives each session its environment. Linear gives each session its purpose. The rest of this post wires those together.",[],{"_key":211,"_type":19,"children":212,"markDefs":217,"style":88},"b2ca8c3745d7",[213],{"_key":214,"_type":23,"marks":215,"text":216},"b2ca8c3745d70",[],"2. The Linear ticket lifecycle",[],{"_key":219,"_type":7,"alt":220,"asset":221},"91b2ccaa-fe63-4b82-a848-83b674cb0245","The Linear loop: Slack → Triage → Todo → In Progress → In Staging → Done",{"_ref":222,"_type":10},"image-7cef4827a3cf03f6451e4348af3768aa9ee79b31-1600x690-png",{"_key":224,"_type":19,"children":225,"markDefs":246,"style":28},"7000a242e265",[226,230,234,238,242],{"_key":227,"_type":23,"marks":228,"text":229},"7000a242e2650",[],"Work enters our system in exactly one place: ",{"_key":231,"_type":23,"marks":232,"text":233},"7000a242e2651",[59],"Slack",{"_key":235,"_type":23,"marks":236,"text":237},"7000a242e2652",[],". The product team writes tickets in plain English in a product channel, and bug reports land in a reports channel; an agent files both into Linear as ",{"_key":239,"_type":23,"marks":240,"text":241},"7000a242e2653",[59],"Triage",{"_key":243,"_type":23,"marks":244,"text":245},"7000a242e2654",[]," issues. Nobody opens Linear to create a ticket.",[],{"_key":248,"_type":19,"children":249,"markDefs":254,"style":28},"4419d4bd6c33",[250],{"_key":251,"_type":23,"marks":252,"text":253},"4419d4bd6c330",[],"Two details of how those tickets are filed do a lot of quiet work later:",[],{"_key":256,"_type":19,"children":257,"level":65,"listItem":66,"markDefs":274,"style":28},"ab12a7b94e75",[258,262,266,270],{"_key":259,"_type":23,"marks":260,"text":261},"ab12a7b94e750",[59],"Bug reports become children.",{"_key":263,"_type":23,"marks":264,"text":265},"ab12a7b94e751",[]," A Linear parent issue represents one feature or fix that ships as one PR. User-reported symptoms of it get filed as ",{"_key":267,"_type":23,"marks":268,"text":269},"ab12a7b94e752",[25],"sub-issues",{"_key":271,"_type":23,"marks":272,"text":273},"ab12a7b94e753",[]," of that parent. When the PR eventually merges with a Fixes ENG-451, ENG-452, ENG-453 line, the whole family closes together.",[],{"_key":276,"_type":19,"children":277,"level":65,"listItem":66,"markDefs":286,"style":28},"e0c5d0546b0c",[278,282],{"_key":279,"_type":23,"marks":280,"text":281},"e0c5d0546b0c0",[59],"The reporter's @mention is preserved.",{"_key":283,"_type":23,"marks":284,"text":285},"e0c5d0546b0c1",[]," The Slack agent stores the reporting user's Slack mention on the Linear issue when it files it. Months of goodwill come from this one field, as you'll see in section 5.",[],{"_key":288,"_type":19,"children":289,"markDefs":298,"style":28},"f4a33bac990d",[290,294],{"_key":291,"_type":23,"marks":292,"text":293},"f4a33bac990d0",[],"From there the lifecycle is: ",{"_key":295,"_type":23,"marks":296,"text":297},"f4a33bac990d1",[59],"Triage → Todo → In Progress → In Staging → Done.",[],{"_key":300,"_type":19,"children":301,"markDefs":314,"style":28},"ff9c897f93b3",[302,306,310],{"_key":303,"_type":23,"marks":304,"text":305},"ff9c897f93b30",[],"Here's the important part: ",{"_key":307,"_type":23,"marks":308,"text":309},"ff9c897f93b31",[25],"humans only touch the first two states.",{"_key":311,"_type":23,"marks":312,"text":313},"ff9c897f93b32",[]," Product triages and prioritises into Todo. After that:",[],{"_key":316,"_type":19,"children":317,"level":65,"listItem":66,"markDefs":326,"style":28},"95d6bf474cfe",[318,322],{"_key":319,"_type":23,"marks":320,"text":321},"95d6bf474cfe0",[59],"In Progress",{"_key":323,"_type":23,"marks":324,"text":325},"95d6bf474cfe1",[]," happens automatically the moment an engineer (or their agent) starts the work, because starting the work pushes a branch named after the ticket, and Linear's GitHub integration reacts to it.",[],{"_key":328,"_type":19,"children":329,"level":65,"listItem":66,"markDefs":338,"style":28},"2da84d9ba205",[330,334],{"_key":331,"_type":23,"marks":332,"text":333},"2da84d9ba2050",[59],"In Staging",{"_key":335,"_type":23,"marks":336,"text":337},"2da84d9ba2051",[]," happens automatically when the PR merges into our staging branch.",[],{"_key":340,"_type":19,"children":341,"level":65,"listItem":66,"markDefs":350,"style":28},"ee57420017f4",[342,346],{"_key":343,"_type":23,"marks":344,"text":345},"ee57420017f40",[59],"Done",{"_key":347,"_type":23,"marks":348,"text":349},"ee57420017f41",[]," happens automatically for the whole staged batch when staging is released to main, and Slack gets notified both times.",[],{"_key":352,"_type":19,"children":353,"markDefs":366,"style":28},"4468ac850d8c",[354,358,362],{"_key":355,"_type":23,"marks":356,"text":357},"4468ac850d8c0",[],"Nobody has ever dragged a card across our board. The board is a ",{"_key":359,"_type":23,"marks":360,"text":361},"4468ac850d8c1",[25],"read model",{"_key":363,"_type":23,"marks":364,"text":365},"4468ac850d8c2",[]," of git.",[],{"_key":368,"_type":19,"children":369,"markDefs":374,"style":88},"df4faedde42c",[370],{"_key":371,"_type":23,"marks":372,"text":373},"df4faedde42c0",[],"3. Docker + worktrees: code isolation AND environment isolation",[],{"_key":376,"_type":7,"alt":377,"asset":378},"424bc4f5-d234-499a-813e-798b3c23fa54","One repo, three checkouts, three stacks",{"_ref":379,"_type":10},"image-979dafce2334ea639ef4092672a35ce565865b1d-1600x720-png",{"_key":381,"_type":19,"children":382,"markDefs":395,"style":28},"f3cfd67130a0",[383,387,391],{"_key":384,"_type":23,"marks":385,"text":386},"f3cfd67130a00",[],"This is the foundation everything else stands on, and it's really important to get right: ",{"_key":388,"_type":23,"marks":389,"text":390},"f3cfd67130a01",[59],"worktrees isolate the code, Docker isolates the world.",{"_key":392,"_type":23,"marks":393,"text":394},"f3cfd67130a02",[]," Once both are true, Claude sessions cannot interfere with each other, and the isolated databases mean an agent can iterate violently (run migrations, wipe tables, reseed) without mangling anyone's settings or data.",[],{"_key":397,"_type":19,"children":398,"markDefs":403,"style":28},"a1e0eb7c476c",[399],{"_key":400,"_type":23,"marks":401,"text":402},"a1e0eb7c476c0",[],"The construction:",[],{"_key":405,"_type":19,"children":406,"level":65,"listItem":423,"markDefs":424,"style":28},"833c9751da39",[407,411,415,419],{"_key":408,"_type":23,"marks":409,"text":410},"833c9751da390",[59],"Everything runs in Docker Compose",{"_key":412,"_type":23,"marks":413,"text":414},"833c9751da391",[],", including in development. One docker-compose.yml at the repo root, and every service is gated behind a Compose ",{"_key":416,"_type":23,"marks":417,"text":418},"833c9751da392",[25],"profile",{"_key":420,"_type":23,"marks":421,"text":422},"833c9751da393",[]," (infra, cache, chat-dev, editor-dev, ...), so a stack can run any subset of the system.","number",[],{"_key":426,"_type":19,"children":427,"level":65,"listItem":423,"markDefs":436,"style":28},"26132ccd0fff",[428,432],{"_key":429,"_type":23,"marks":430,"text":431},"26132ccd0fff0",[59],"Each worktree gets its own Compose project.",{"_key":433,"_type":23,"marks":434,"text":435},"26132ccd0fff1",[]," COMPOSE_PROJECT_NAME=sunrise for the main checkout, COMPOSE_PROJECT_NAME=sunrise-eng-451-fix-checkout-race for a feature worktree. Same YAML, different project name, completely disjoint containers, networks and volumes.",[],{"_key":438,"_type":19,"children":439,"level":65,"listItem":423,"markDefs":456,"style":28},"30bae658142f",[440,444,448,452],{"_key":441,"_type":23,"marks":442,"text":443},"30bae658142f0",[59],"OrbStack DNS instead of host ports.",{"_key":445,"_type":23,"marks":446,"text":447},"30bae658142f1",[]," This is the trick that kills the port problem outright. We develop on macOS with OrbStack (I strongly recommend it over Docker Desktop for this), and OrbStack gives every container a hostname: \u003Cservice>.\u003Cproject>.orb.local, with HTTPS terminated for free. So the chat app in the main stack is https:\u002F\u002Fsunrise-chat.sunrise.orb.local and the same app in a feature stack is https:\u002F\u002Fsunrise-chat.sunrise-eng-451-fix-checkout-race.orb.local. ",{"_key":449,"_type":23,"marks":450,"text":451},"30bae658142f2",[59],"Zero published host ports.",{"_key":453,"_type":23,"marks":454,"text":455},"30bae658142f3",[]," Five stacks, no port table, nothing to collide. This is how you get around Claude Code eating your port range: stop giving it ports and give it hostnames.",[],{"_key":458,"_type":19,"children":459,"level":65,"listItem":423,"markDefs":484,"style":28},"5caae25b38f8",[460,464,468,472,476,480],{"_key":461,"_type":23,"marks":462,"text":463},"5caae25b38f80",[59],"Two env files, layered.",{"_key":465,"_type":23,"marks":466,"text":467},"5caae25b38f81",[]," This is worth being precise about, because sharing environment variables across stacks is where most setups get messy:  The payoff of that split: an isolated stack simply ",{"_key":469,"_type":23,"marks":470,"text":471},"5caae25b38f82",[25],"omits",{"_key":473,"_type":23,"marks":474,"text":475},"5caae25b38f83",[]," the infra URLs and Compose falls back to in-stack service names (its own private postgres), while a lightweight stack ",{"_key":477,"_type":23,"marks":478,"text":479},"5caae25b38f84",[25],"sets",{"_key":481,"_type":23,"marks":482,"text":483},"5caae25b38f85",[]," them to the main stack's OrbStack hostnames and reuses main's database. Isolation becomes a per-stack config decision, not an architecture decision.",[],{"_key":486,"_type":19,"children":487,"level":492,"listItem":66,"markDefs":493,"style":28},"3f91a15f5251",[488],{"_key":489,"_type":23,"marks":490,"text":491},"3f91a15f52510",[],".env holds secrets and global config (API keys, third-party services). It's shared by every stack and copied into each worktree.",2,[],{"_key":495,"_type":19,"children":496,"level":492,"listItem":66,"markDefs":509,"style":28},"7dc33027adaa",[497,501,505],{"_key":498,"_type":23,"marks":499,"text":500},"7dc33027adaa0",[],".stack.env holds per-stack ",{"_key":502,"_type":23,"marks":503,"text":504},"7dc33027adaa1",[25],"identity",{"_key":506,"_type":23,"marks":507,"text":508},"7dc33027adaa2",[],": the Compose project name, the profile list, and the URLs that point at infra.",[],{"_key":511,"_type":19,"children":512,"level":492,"listItem":66,"markDefs":517,"style":28},"7ab4d483b120",[513],{"_key":514,"_type":23,"marks":515,"text":516},"7ab4d483b1200",[],"We run docker compose --env-file .env --env-file .stack.env up. Later files win, so the stack file overrides the global one exactly where it needs to.",[],{"_key":519,"_type":19,"children":520,"markDefs":525,"style":28},"06a57016e440",[521],{"_key":522,"_type":23,"marks":523,"text":524},"06a57016e4400",[],"Don't build this by hand. Ask your agent to set up your Docker configuration; it's an afternoon of supervised work. Paste this:",[],{"_key":527,"_type":528,"code":529,"language":530},"820d1f42-9431-42a9-b0b6-9ab0079166ee","code","Read this repo and dockerise it for parallel agent development:\n\n1. One docker-compose.yml at the repo root. Every service (apps and\n   infra: postgres, redis, object storage, workers) gets a Compose\n   profile so a stack can run any subset of the system.\n2. Parameterise identity: the Compose project name and profile list come\n   from a .stack.env file; secrets and global config stay in .env. We'll\n   run compose with `--env-file .env --env-file .stack.env` so the stack\n   file wins on conflicts.\n3. Publish no host ports. I use OrbStack, which gives every container\n   DNS at \u003Cservice>.\u003Cproject>.orb.local with HTTPS. Containers talk to\n   each other by service name; my browser uses the OrbStack URLs.\n4. Every service-to-infra connection (database URL, redis URL, queue\n   API) must be an env var with an in-stack default, so a stack can run\n   its own infra or point at another stack's by URL.\n5. Commit a .stack.env.example documenting every variable.\n\nShow me the plan before writing files.","text",{"_key":532,"_type":19,"children":533,"markDefs":538,"style":88},"d3146c78bf68",[534],{"_key":535,"_type":23,"marks":536,"text":537},"d3146c78bf680",[],"4. SWT: super worktrees",[],{"_key":540,"_type":19,"children":541,"markDefs":554,"style":28},"7f675ce6634b",[542,546,550],{"_key":543,"_type":23,"marks":544,"text":545},"7f675ce6634b0",[],"Once Docker and worktrees work, you'll do the same ritual for every ticket: create the worktree, copy the env files, invent a project name, boot the stack, open the ticket, paste it to Claude, open a draft PR. That's ten minutes of setup per ticket, so the next move is obvious: ",{"_key":547,"_type":23,"marks":548,"text":549},"7f675ce6634b1",[59],"build a tool that bootstraps all of it in one command.",{"_key":551,"_type":23,"marks":552,"text":553},"7f675ce6634b2",[]," Ours is ~1,100 lines of bash called swt (sunrise worktrees, though \"super worktrees\" has stuck), and it turns the whole ritual into:",[],{"_key":556,"_type":528,"code":557,"language":530},"af379259-aa4b-4a70-841a-211cc9109c52","$ swt new eng-451 --stack isolated-chat",{"_key":559,"_type":7,"alt":560,"asset":561},"118485f3-8852-4363-b013-e9649fcc7d28","swt new: Linear in, draft PR out, agent running in tmux",{"_ref":562,"_type":10},"image-32b604b2f926213934cc7c1712abd37637db4626-1600x900-png",{"_key":564,"_type":19,"children":565,"markDefs":570,"style":28},"5fbfff73e224",[566],{"_key":567,"_type":23,"marks":568,"text":569},"5fbfff73e2240",[],"Here's everything that one command does:",[],{"_key":572,"_type":19,"children":573,"level":65,"listItem":423,"markDefs":582,"style":28},"c34a5fd929ab",[574,578],{"_key":575,"_type":23,"marks":576,"text":577},"c34a5fd929ab0",[59],"Recognises the Linear ticket.",{"_key":579,"_type":23,"marks":580,"text":581},"c34a5fd929ab1",[]," The name matches eng-\u003Cnumber>, so swt calls Linear's GraphQL API, fetches the issue, and expands the branch name to eng-451-fix-checkout-race from the ticket title (paste-from-Linear slugs work too).",[],{"_key":584,"_type":19,"children":585,"level":65,"listItem":423,"markDefs":594,"style":28},"d0ef6cbcce15",[586,590],{"_key":587,"_type":23,"marks":588,"text":589},"d0ef6cbcce150",[59],"Creates the worktree",{"_key":591,"_type":23,"marks":592,"text":593},"d0ef6cbcce151",[]," at .worktrees\u002Feng-451-fix-checkout-race, branched from staging, and copies in the gitignored dotfiles every checkout needs (.env and friends, listed in a .worktreeinclude file).",[],{"_key":596,"_type":19,"children":597,"level":65,"listItem":423,"markDefs":606,"style":28},"aa3270f2ae1a",[598,602],{"_key":599,"_type":23,"marks":600,"text":601},"aa3270f2ae1a0",[59],"Writes .stack.env",{"_key":603,"_type":23,"marks":604,"text":605},"aa3270f2ae1a1",[]," with the derived project name and the profiles for the chosen stack type.",[],{"_key":608,"_type":19,"children":609,"level":65,"listItem":423,"markDefs":626,"style":28},"3f30475a2121",[610,614,618,622],{"_key":611,"_type":23,"marks":612,"text":613},"3f30475a21210",[59],"Writes .claude-context.md",{"_key":615,"_type":23,"marks":616,"text":617},"3f30475a21211",[],": the ticket's title, description, labels, recent comments, every sub-issue with ",{"_key":619,"_type":23,"marks":620,"text":621},"3f30475a21212",[25],"its",{"_key":623,"_type":23,"marks":624,"text":625},"3f30475a21213",[]," description and comments, the reporter mentions, plus the stack's own OrbStack URLs and our commit-message conventions. That last part matters more than it sounds: the context file explicitly tells the agent its chat lives at the worktree's *.orb.local hostname, so it never defaults to localhost:3002 and wanders into someone else's stack.",[],{"_key":628,"_type":19,"children":629,"level":65,"listItem":423,"markDefs":638,"style":28},"004322c70bdb",[630,634],{"_key":631,"_type":23,"marks":632,"text":633},"004322c70bdb0",[59],"Pushes the branch and opens a draft PR",{"_key":635,"_type":23,"marks":636,"text":637},"004322c70bdb1",[]," against staging, titled wip: fix checkout race (ENG-451), with a Fixes ENG-451, ENG-452 line covering the parent and every sub-issue. More on why in section 5.",[],{"_key":640,"_type":19,"children":641,"level":65,"listItem":423,"markDefs":650,"style":28},"265b897bc890",[642,646],{"_key":643,"_type":23,"marks":644,"text":645},"265b897bc8900",[59],"Builds a tmux session",{"_key":647,"_type":23,"marks":648,"text":649},"265b897bc8901",[]," named after the Compose project, with three panes: a thin banner across the top printing the stack's URL, claude on the bottom-left already prompted to read .claude-context.md and summarise the ticket, and docker compose up streaming logs on the bottom-right.",[],{"_key":652,"_type":19,"children":653,"markDefs":658,"style":28},"509818f9b454",[654],{"_key":655,"_type":23,"marks":656,"text":657},"509818f9b4540",[],"Thirty seconds after you hit enter, you're looking at an agent that has read the ticket, in a stack nobody else can touch.",[],{"_key":660,"_type":19,"children":661,"markDefs":666,"style":667},"c882e69c76c9",[662],{"_key":663,"_type":23,"marks":664,"text":665},"c882e69c76c90",[],"Isolate fully, or only partly (this is the performance section)",[],"h3",{"_key":669,"_type":19,"children":670,"markDefs":675,"style":28},"6ae0153d7646",[671],{"_key":672,"_type":23,"marks":673,"text":674},"6ae0153d76460",[],"The --stack flag picks how much world the worktree gets, and this is where reuse pays off:",[],{"_key":677,"_type":19,"children":678,"level":65,"listItem":66,"markDefs":695,"style":28},"275bf90cf583",[679,683,687,691],{"_key":680,"_type":23,"marks":681,"text":682},"275bf90cf5830",[59],"isolated-chat \u002F isolated \u002F fullstack",{"_key":684,"_type":23,"marks":685,"text":686},"275bf90cf5831",[],": the stack runs its ",{"_key":688,"_type":23,"marks":689,"text":690},"275bf90cf5832",[25],"own",{"_key":692,"_type":23,"marks":693,"text":694},"275bf90cf5833",[]," postgres, redis and object storage. Mandatory for anything touching a DB migration or schema. Break the database all day; nobody notices.",[],{"_key":697,"_type":19,"children":698,"level":65,"listItem":66,"markDefs":723,"style":28},"b4edb8633ec2",[699,703,707,711,715,719],{"_key":700,"_type":23,"marks":701,"text":702},"b4edb8633ec20",[59],"chat \u002F dawn",{"_key":704,"_type":23,"marks":705,"text":706},"b4edb8633ec21",[],": app containers only, pointed at the ",{"_key":708,"_type":23,"marks":709,"text":710},"b4edb8633ec22",[59],"main stack's infra",{"_key":712,"_type":23,"marks":713,"text":714},"b4edb8633ec23",[]," via those .stack.env URLs. This is the \"share the local staging DB\" trick: for UI work you usually ",{"_key":716,"_type":23,"marks":717,"text":718},"b4edb8633ec24",[25],"want",{"_key":720,"_type":23,"marks":721,"text":722},"b4edb8633ec25",[]," main's real data, and you definitely don't want a fourth idle postgres eating RAM. These stacks boot in seconds.",[],{"_key":725,"_type":19,"children":726,"level":65,"listItem":66,"markDefs":735,"style":28},"89c3f2ae66b4",[727,731],{"_key":728,"_type":23,"marks":729,"text":730},"89c3f2ae66b40",[59],"none",{"_key":732,"_type":23,"marks":733,"text":734},"89c3f2ae66b41",[],": no containers at all, just worktree + tmux + claude, for docs and CI branches.",[],{"_key":737,"_type":19,"children":738,"markDefs":751,"style":28},"af3b990f26c0",[739,743,747],{"_key":740,"_type":23,"marks":741,"text":742},"af3b990f26c00",[],"Reuse shows up everywhere in the numbers: the Docker layer cache is shared across all stacks (stack #2 builds nearly instantly), shared-infra stacks add almost zero overhead, and swt stack \u003Ctype> can switch a worktree between types ",{"_key":744,"_type":23,"marks":745,"text":746},"af3b990f26c01",[25],"in place",{"_key":748,"_type":23,"marks":749,"text":750},"af3b990f26c02",[],", preserving volumes, so flipping isolated → chat and back later doesn't lose the private database.",[],{"_key":753,"_type":19,"children":754,"markDefs":759,"style":28},"b1b70229e529",[755],{"_key":756,"_type":23,"marks":757,"text":758},"b1b70229e5290",[],"One confession: there's exactly one host port in the whole system. Our CMS dev server has to bind one, so swt hashes the project name into the 4002–4901 range deterministically and probes past any port another worktree already claimed. When you can't delete a port, make it deterministic.",[],{"_key":761,"_type":19,"children":762,"markDefs":767,"style":667},"ab830f034e0e",[763],{"_key":764,"_type":23,"marks":765,"text":766},"ab830f034e0e0",[],"tmux: sessions that survive you",[],{"_key":769,"_type":19,"children":770,"markDefs":775,"style":28},"f4e863f00d92",[771],{"_key":772,"_type":23,"marks":773,"text":774},"f4e863f00d920",[],"tmux is doing more work here than decoration:",[],{"_key":777,"_type":19,"children":778,"level":65,"listItem":66,"markDefs":787,"style":28},"437b4004f4f6",[779,783],{"_key":780,"_type":23,"marks":781,"text":782},"437b4004f4f60",[59],"Detach with Ctrl-b d",{"_key":784,"_type":23,"marks":785,"text":786},"437b4004f4f61",[]," and the agent keeps working. swt attach eng-451 drops you back in. swt list shows every worktree with its branch, tmux and stack state.",[],{"_key":789,"_type":19,"children":790,"level":65,"listItem":66,"markDefs":799,"style":28},"4b6bf7d1c954",[791,795],{"_key":792,"_type":23,"marks":793,"text":794},"4b6bf7d1c9540",[59],"Session preservation across reboots",{"_key":796,"_type":23,"marks":797,"text":798},"4b6bf7d1c9541",[],": tmux state dies with the machine, but the worktree doesn't. swt attach detects the dead session, rebuilds the same three-pane layout, runs claude --resume (picking up the most recent conversation in that directory), and re-runs docker compose up. Your five parallel investigations survive a restart.",[],{"_key":801,"_type":19,"children":802,"level":65,"listItem":66,"markDefs":811,"style":28},"81ead8efb192",[803,807],{"_key":804,"_type":23,"marks":805,"text":806},"81ead8efb1920",[59],"Panes are just shells",{"_key":808,"_type":23,"marks":809,"text":810},"81ead8efb1921",[],": Ctrl-C the compose pane and re-run with --build, split another pane for tests, zoom the agent with Ctrl-b z.",[],{"_key":813,"_type":19,"children":814,"markDefs":819,"style":667},"da36bd7cb86a",[815],{"_key":816,"_type":23,"marks":817,"text":818},"da36bd7cb86a0",[],"Teardown",[],{"_key":821,"_type":19,"children":822,"markDefs":827,"style":28},"b20dc2bdf3af",[823],{"_key":824,"_type":23,"marks":825,"text":826},"b20dc2bdf3af0",[],"Cleanup is one command: swt rm eng-451 kills the tmux session, runs docker compose down -v, removes the worktree, and deletes the branch. --keep-volumes preserves the data if you expect to come back, and --keep-branch preserves the branch. Between cheap teardown and shared-infra stack types, running many stacks stays comfortably within a laptop's resources.",[],{"_key":829,"_type":19,"children":830,"markDefs":835,"style":28},"bc6327065abd",[831],{"_key":832,"_type":23,"marks":833,"text":834},"bc6327065abd0",[],"To get your own swt, paste this to your agent (after section 3's setup):",[],{"_key":837,"_type":528,"code":838,"language":530},"314e7317-f494-4adf-aa56-841ebb0b5228","Docker + worktrees are set up (profile-gated compose, per-worktree\n.stack.env, OrbStack DNS). Build me `bin\u002Fswt`, a bash CLI:\n\nswt new \u003Cname> --stack \u003Ctype>\n- git worktree under .worktrees\u002F\u003Cname>, branched from our default branch\n- copy the gitignored dotfiles listed in a .worktreeinclude file\n- write .stack.env: project name derived from \u003Cname>, profiles from the\n  stack type. Define types ranging from full isolation (own DB, redis,\n  storage) to app-only types that point at the main stack's infra by\n  URL, plus \"none\" for no containers at all.\n- if \u003Cname> matches our ticket pattern (e.g. eng-123): fetch the issue\n  from Linear's GraphQL API (title, description, labels, comments,\n  sub-issues, reporters), write it all to .claude-context.md in the\n  worktree, expand the branch name to eng-123-\u003Ctitle-slug>, push the\n  branch, and open a draft PR titled \"wip: \u003Ctitle> (ENG-123)\" whose body\n  has a Fixes line listing the parent and every sub-issue\n- start a tmux session named after the compose project: thin top pane\n  echoing the stack's URL, bottom-left running `claude` prompted to read\n  .claude-context.md and summarise, bottom-right `docker compose\n  --env-file .env --env-file .stack.env up`\n\nAlso implement:\n- swt list: every worktree with branch, tmux and compose state\n- swt attach: reattach; if the tmux session died (reboot), rebuild the\n  layout and run `claude --resume` + `docker compose up`\n- swt stack \u003Ctype>: switch a worktree's profiles in place, preserving\n  volumes, and restart compose in its tmux pane\n- swt rm: kill tmux, compose down -v, remove worktree, delete branch,\n  with --keep-volumes and --keep-branch opt-outs",{"_key":840,"_type":19,"children":841,"markDefs":846,"style":88},"64b8a0725152",[842],{"_key":843,"_type":23,"marks":844,"text":845},"64b8a07251520",[],"5. Linear in the CI\u002FCD: the PR is the state machine",[],{"_key":848,"_type":7,"alt":849,"asset":850},"8aba3412-a7b5-4c3d-9492-bb4ddf4a65ca","The PR drives every Linear transition and every Slack notification",{"_ref":851,"_type":10},"image-532e62ac1548081e7ef2f4125857b62a16cc6ddb-1600x800-png",{"_key":853,"_type":19,"children":854,"markDefs":859,"style":28},"331280dd2171",[855],{"_key":856,"_type":23,"marks":857,"text":858},"331280dd21710",[],"Section 2 promised that nobody updates tickets by hand. Here's the machinery.",[],{"_key":861,"_type":19,"children":862,"markDefs":875,"style":28},"a7b1dccc565e",[863,867,871],{"_key":864,"_type":23,"marks":865,"text":866},"a7b1dccc565e0",[],"The core idea: ",{"_key":868,"_type":23,"marks":869,"text":870},"a7b1dccc565e1",[59],"swt creates the PR at minute zero, as a draft, before any real code exists.",{"_key":872,"_type":23,"marks":873,"text":874},"a7b1dccc565e2",[]," The tool makes an empty scaffold commit, pushes the branch, and opens wip: fix checkout race (ENG-451) against staging. That gives us three things immediately:",[],{"_key":877,"_type":19,"children":878,"level":65,"listItem":66,"markDefs":902,"style":28},"51e73c0f740f",[879,883,887,890,894,898],{"_key":880,"_type":23,"marks":881,"text":882},"51e73c0f740f0",[59],"The push flips the ticket.",{"_key":884,"_type":23,"marks":885,"text":886},"51e73c0f740f1",[]," Linear's GitHub integration sees a branch named eng-451-... and moves ENG-451 to ",{"_key":888,"_type":23,"marks":889,"text":321},"51e73c0f740f2",[59],{"_key":891,"_type":23,"marks":892,"text":893},"51e73c0f740f3",[],". Starting work ",{"_key":895,"_type":23,"marks":896,"text":897},"51e73c0f740f4",[25],"is",{"_key":899,"_type":23,"marks":900,"text":901},"51e73c0f740f5",[]," the status update.",[],{"_key":904,"_type":19,"children":905,"level":65,"listItem":66,"markDefs":914,"style":28},"661ac84f71e7",[906,910],{"_key":907,"_type":23,"marks":908,"text":909},"661ac84f71e70",[59],"The PR becomes the ticket's anchor.",{"_key":911,"_type":23,"marks":912,"text":913},"661ac84f71e71",[]," Linear links the PR onto the issue, so the Slack thread that spawned the ticket, the Linear comments, and the GitHub review all connect to one place. Context stops fragmenting across tools.",[],{"_key":916,"_type":19,"children":917,"level":65,"listItem":66,"markDefs":926,"style":28},"4c2940986866",[918,922],{"_key":919,"_type":23,"marks":920,"text":921},"4c29409868660",[59],"The Fixes line is pre-written.",{"_key":923,"_type":23,"marks":924,"text":925},"4c29409868661",[]," Parent and every sub-issue, generated from the Linear hierarchy, so nothing gets forgotten at merge time.",[],{"_key":928,"_type":19,"children":929,"markDefs":934,"style":28},"7edf57e54307",[930],{"_key":931,"_type":23,"marks":932,"text":933},"7edf57e543070",[],"The wip: prefix is deliberate: our commitlint config rejects it as a squash title, so a PR physically can't merge until someone retitles it to a real conventional commit (feat(chat): fix checkout race (ENG-451)). Draft + failing title check means a PR opened at minute zero is never mergeable by accident.",[],{"_key":936,"_type":19,"children":937,"markDefs":942,"style":28},"7be515d08a73",[938],{"_key":939,"_type":23,"marks":940,"text":941},"7be515d08a730",[],"Then two GitHub Actions workflows close the loop:",[],{"_key":944,"_type":19,"children":945,"level":65,"listItem":66,"markDefs":961,"style":28},"e8bedd0b61d9",[946,950,954,957],{"_key":947,"_type":23,"marks":948,"text":949},"e8bedd0b61d90",[59],"On PR merge into staging",{"_key":951,"_type":23,"marks":952,"text":953},"e8bedd0b61d91",[],": a workflow parses every ENG-x reference from the PR title, body and branch name, fetches those issues from Linear, and posts a \"🚀 Released to staging\" changelog to our #draper-shipping Slack channel. Linear's own integration has already moved the fixed issues to ",{"_key":955,"_type":23,"marks":956,"text":333},"e8bedd0b61d92",[59],{"_key":958,"_type":23,"marks":959,"text":960},"e8bedd0b61d93",[],". Everyone knows what's on staging without asking.",[],{"_key":963,"_type":19,"children":964,"level":65,"listItem":66,"markDefs":996,"style":28},"bd36e931bfb9",[965,969,973,977,981,984,988,992],{"_key":966,"_type":23,"marks":967,"text":968},"bd36e931bfb90",[59],"On release (staging merged into main)",{"_key":970,"_type":23,"marks":971,"text":972},"bd36e931bfb91",[],": a second workflow fetches ",{"_key":974,"_type":23,"marks":975,"text":976},"bd36e931bfb92",[25],"every",{"_key":978,"_type":23,"marks":979,"text":980},"bd36e931bfb93",[]," issue sitting in In Staging, transitions all of them to ",{"_key":982,"_type":23,"marks":983,"text":345},"bd36e931bfb94",[59],{"_key":985,"_type":23,"marks":986,"text":987},"bd36e931bfb95",[]," (failing loudly if any transition fails), and posts a \"🎉 Released to production\" changelog. The changelog clusters sub-issues under their parents, counts user reports closed, and, using those Slack @mentions preserved back in section 2, ",{"_key":989,"_type":23,"marks":990,"text":991},"bd36e931bfb96",[59],"thanks each reporter by name",{"_key":993,"_type":23,"marks":994,"text":995},"bd36e931bfb97",[],". The person who reported a bug in Slack gets pinged in Slack when their bug ships, with zero human effort in between. Concurrency groups serialise the runs so back-to-back merges can't double-post.",[],{"_key":998,"_type":19,"children":999,"markDefs":1004,"style":28},"809e4c8f8716",[1000],{"_key":1001,"_type":23,"marks":1002,"text":1003},"809e4c8f87160",[],"One bonus that falls out of this architecture: since a ticket already contains everything an agent needs, we added an AI: Claude label in Linear that triggers a cloud workflow. It checks out staging, hands the full ticket (description, comments, sub-issues, even screenshot attachments) to Claude Code running in CI, and Claude implements the change and opens the same draft PR itself, then comments the PR link back on the ticket. Small copy fixes never touch a laptop.",[],{"_key":1006,"_type":19,"children":1007,"markDefs":1012,"style":28},"2b26228eb6d7",[1008],{"_key":1009,"_type":23,"marks":1010,"text":1011},"2b26228eb6d70",[],"The prompt for your agent:",[],{"_key":1014,"_type":528,"code":1015,"language":530},"efbfd93b-5754-46c9-9af1-9acc4b5439d9","Wire our ticket tracker into GitHub Actions:\n\n1. Enable Linear's GitHub integration so pushing a branch containing a\n   ticket id moves the ticket to In Progress, and a merged PR with a\n   \"Fixes ENG-x\" line moves it to our staging state.\n2. Add a workflow on PR merge into staging: parse every ticket id from\n   the PR title, body and branch name, fetch those issues via Linear's\n   GraphQL API, and post a changelog to Slack via incoming webhook.\n3. Add a release workflow on push to main: fetch every issue in the\n   \"In Staging\" state, transition all of them to Done (fail the run if\n   any transition fails), and post a changelog that clusters sub-issues\n   under parents and thanks reporters by the Slack @mention stored on\n   each issue. Use a concurrency group so consecutive merges queue\n   instead of double-posting.\n4. Our worktree tool already opens a draft \"wip:\"-titled PR when work\n   starts; make the lint config reject \"wip:\" as a merge title so drafts\n   can never land unretitled.",{"_key":1017,"_type":19,"children":1018,"markDefs":1023,"style":88},"4441e1b77600",[1019],{"_key":1020,"_type":23,"marks":1021,"text":1022},"4441e1b776000",[],"6. Customise it: this whole post is one conversation",[],{"_key":1025,"_type":7,"alt":1026,"asset":1027},"85744465-68f8-41bf-aaaf-b9f617d471f6","Customise it: the whole setup is one conversation away",{"_ref":1028,"_type":10},"image-f21d3cf55f2a3fcfa6bec2707283d22cff2aad4f-1600x640-png",{"_key":1030,"_type":19,"children":1031,"markDefs":1036,"style":28},"5ea71c5d6ee6",[1032],{"_key":1033,"_type":23,"marks":1034,"text":1035},"5ea71c5d6ee60",[],"Nothing above is a product you install. It's a compose file, ~1,100 lines of bash, two GitHub Actions workflows and a couple of conventions, and every piece of it was designed and written by the same kind of agent it now bootstraps. That's the real thesis of this post: in 2026, dev tooling of this shape costs a conversation, not a quarter.",[],{"_key":1038,"_type":19,"children":1039,"markDefs":1044,"style":28},"d1836bb83d25",[1040],{"_key":1041,"_type":23,"marks":1042,"text":1043},"d1836bb83d250",[],"Which also means none of it is sacred. Swap Linear for Jira and the GraphQL calls change, not the shape. Swap tmux for zellij, OrbStack for anything that gives containers hostnames, bash for whatever you like. Run three panes or five. Keep the ideas:",[],{"_key":1046,"_type":19,"children":1047,"level":65,"listItem":66,"markDefs":1056,"style":28},"7e1e34883a02",[1048,1052],{"_key":1049,"_type":23,"marks":1050,"text":1051},"7e1e34883a020",[59],"Environment isolation, not just code isolation.",{"_key":1053,"_type":23,"marks":1054,"text":1055},"7e1e34883a021",[]," One compose project per worktree.",[],{"_key":1058,"_type":19,"children":1059,"level":65,"listItem":66,"markDefs":1068,"style":28},"0fb94763d8b2",[1060,1064],{"_key":1061,"_type":23,"marks":1062,"text":1063},"0fb94763d8b20",[59],"Hostnames, not ports.",{"_key":1065,"_type":23,"marks":1066,"text":1067},"0fb94763d8b21",[]," The port problem doesn't get managed; it gets deleted.",[],{"_key":1070,"_type":19,"children":1071,"level":65,"listItem":66,"markDefs":1080,"style":28},"f8d370b4c06b",[1072,1076],{"_key":1073,"_type":23,"marks":1074,"text":1075},"f8d370b4c06b0",[59],"Reuse what doesn't need isolating.",{"_key":1077,"_type":23,"marks":1078,"text":1079},"f8d370b4c06b1",[]," Shared infra for light work, shared layer cache, preserved volumes.",[],{"_key":1082,"_type":19,"children":1083,"level":65,"listItem":66,"markDefs":1092,"style":28},"895f90f87ec1",[1084,1088],{"_key":1085,"_type":23,"marks":1086,"text":1087},"895f90f87ec10",[59],"The ticket travels to the agent",{"_key":1089,"_type":23,"marks":1090,"text":1091},"895f90f87ec11",[],", in a context file, at bootstrap.",[],{"_key":1094,"_type":19,"children":1095,"level":65,"listItem":66,"markDefs":1104,"style":28},"053c2bb9825e",[1096,1100],{"_key":1097,"_type":23,"marks":1098,"text":1099},"053c2bb9825e0",[59],"The PR is the state machine.",{"_key":1101,"_type":23,"marks":1102,"text":1103},"053c2bb9825e1",[]," Humans write and prioritise tickets; git moves them.",[],{"_key":1106,"_type":19,"children":1107,"markDefs":1112,"style":28},"e1c7dc46a0ff",[1108],{"_key":1109,"_type":23,"marks":1110,"text":1111},"e1c7dc46a0ff0",[],"Start by pasting your repo's reality into your agent and asking for step one. Ask it to edit any of this to support your needs; that's the workflow now.",[],{"_key":1114,"_type":19,"children":1115,"markDefs":1120,"style":28},"a4ee42213cb9",[1116],{"_key":1117,"_type":23,"marks":1118,"text":1119},"a4ee42213cb90",[],"If you want the other half of this story, how these branches actually deploy (every PR gets its own full preview environment on a single cheap VPS, plus the staging → production release pipeline), let us know in the responses and we'll write it up.",[],{"_key":1122,"_type":19,"children":1123,"markDefs":1128,"style":28},"84519f9c8140",[1124],{"_key":1125,"_type":23,"marks":1126,"text":1127},"84519f9c81400",[25],"Built at Draper. All commands and diagrams in this post are from our live setup, lightly renamed.",[],"How we run five Claude Code sessions at once at Draper: git worktrees, Docker, Linear, tmux, and a small CLI we call `swt`.",{"_type":7,"alt":1131,"asset":1132},"Five Claude Code sessions running side by side, each in its own isolated stack",{"_ref":1133,"_type":10},"image-2713747aadddc6a6d0a2ea2b422e43b003ee9bb0-1600x840-png","2026-08-31T09:00:00.000Z","the-ultimate-claude-code-parallelisation-guide-2026","The Ultimate Claude Code Parallelisation Guide (2026)","2026-08-31T01:02:41Z","\u003Cpre class=\"shiki github-light-default\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>Read this repo and dockerise it for parallel agent development:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>1. One docker-compose.yml at the repo root. Every service (apps and\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   infra: postgres, redis, object storage, workers) gets a Compose\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   profile so a stack can run any subset of the system.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>2. Parameterise identity: the Compose project name and profile list come\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   from a .stack.env file; secrets and global config stay in .env. We'll\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   run compose with `--env-file .env --env-file .stack.env` so the stack\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   file wins on conflicts.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>3. Publish no host ports. I use OrbStack, which gives every container\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   DNS at &#x3C;service>.&#x3C;project>.orb.local with HTTPS. Containers talk to\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   each other by service name; my browser uses the OrbStack URLs.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>4. Every service-to-infra connection (database URL, redis URL, queue\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   API) must be an env var with an in-stack default, so a stack can run\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   its own infra or point at another stack's by URL.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>5. Commit a .stack.env.example documenting every variable.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>Show me the plan before writing files.\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki github-light-default\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>$ swt new eng-451 --stack isolated-chat\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki github-light-default\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>Docker + worktrees are set up (profile-gated compose, per-worktree\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>.stack.env, OrbStack DNS). Build me `bin\u002Fswt`, a bash CLI:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>swt new &#x3C;name> --stack &#x3C;type>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>- git worktree under .worktrees\u002F&#x3C;name>, branched from our default branch\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>- copy the gitignored dotfiles listed in a .worktreeinclude file\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>- write .stack.env: project name derived from &#x3C;name>, profiles from the\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  stack type. Define types ranging from full isolation (own DB, redis,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  storage) to app-only types that point at the main stack's infra by\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  URL, plus \"none\" for no containers at all.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>- if &#x3C;name> matches our ticket pattern (e.g. eng-123): fetch the issue\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  from Linear's GraphQL API (title, description, labels, comments,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  sub-issues, reporters), write it all to .claude-context.md in the\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  worktree, expand the branch name to eng-123-&#x3C;title-slug>, push the\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  branch, and open a draft PR titled \"wip: &#x3C;title> (ENG-123)\" whose body\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  has a Fixes line listing the parent and every sub-issue\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>- start a tmux session named after the compose project: thin top pane\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  echoing the stack's URL, bottom-left running `claude` prompted to read\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  .claude-context.md and summarise, bottom-right `docker compose\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  --env-file .env --env-file .stack.env up`\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>Also implement:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>- swt list: every worktree with branch, tmux and compose state\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>- swt attach: reattach; if the tmux session died (reboot), rebuild the\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  layout and run `claude --resume` + `docker compose up`\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>- swt stack &#x3C;type>: switch a worktree's profiles in place, preserving\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  volumes, and restart compose in its tmux pane\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>- swt rm: kill tmux, compose down -v, remove worktree, delete branch,\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>  with --keep-volumes and --keep-branch opt-outs\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>","\u003Cpre class=\"shiki github-light-default\">\u003Ccode>\u003Cspan class=\"line\">\u003Cspan>Wire our ticket tracker into GitHub Actions:\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>1. Enable Linear's GitHub integration so pushing a branch containing a\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   ticket id moves the ticket to In Progress, and a merged PR with a\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   \"Fixes ENG-x\" line moves it to our staging state.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>2. Add a workflow on PR merge into staging: parse every ticket id from\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   the PR title, body and branch name, fetch those issues via Linear's\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   GraphQL API, and post a changelog to Slack via incoming webhook.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>3. Add a release workflow on push to main: fetch every issue in the\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   \"In Staging\" state, transition all of them to Done (fail the run if\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   any transition fails), and post a changelog that clusters sub-issues\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   under parents and thanks reporters by the Slack @mention stored on\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   each issue. Use a concurrency group so consecutive merges queue\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   instead of double-posting.\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>4. Our worktree tool already opens a draft \"wip:\"-titled PR when work\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   starts; make the lint config reject \"wip:\" as a merge title so drafts\u003C\u002Fspan>\u003C\u002Fspan>\n\u003Cspan class=\"line\">\u003Cspan>   can never land unretitled.\u003C\u002Fspan>\u003C\u002Fspan>\u003C\u002Fcode>\u003C\u002Fpre>"]