[{"data":1,"prerenderedAt":367},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fguides\u002Fworktrees":3},{"id":4,"title":5,"body":6,"description":359,"extension":360,"meta":361,"navigation":362,"path":363,"seo":364,"stem":365,"__hash__":366},"docs\u002Fdocs\u002Fguides\u002Fworktrees.md","Parallel work with worktrees",{"type":7,"value":8,"toc":350},"minimark",[9,13,17,25,30,50,54,57,129,140,147,153,157,160,173,176,188,207,222,226,235,243,247,250,264,268,271,303,312,316,332,346],[10,11,5],"h1",{"id":12},"parallel-work-with-worktrees",[14,15,16],"p",{},"One checkout can only be on one branch. If Slo is building feature A and you want it to start feature B, you either wait, or you give B its own directory.",[14,18,19,20,24],{},"A git worktree is that directory: a second (or fifth) checkout of the same repository, each on its own branch, all sharing one ",[21,22,23],"code",{},".git",". It's how you run two or three Slo sessions side by side, and it's the setup most heavy Slo users settle on.",[26,27,29],"h2",{"id":28},"when-to-reach-for-one","When to reach for one",[31,32,33,37,44,47],"ul",{},[34,35,36],"li",{},"You want two features built at the same time.",[34,38,39,40,43],{},"You want a clean copy of ",[21,41,42],{},"main"," to read while your branch is half-finished.",[34,45,46],{},"You want one session writing code and another reviewing it, without either seeing the other's uncommitted edits.",[34,48,49],{},"You want to try two approaches to the same problem and keep the better one.",[26,51,53],{"id":52},"_1-create-a-worktree-per-piece-of-work","1. Create a worktree per piece of work",[14,55,56],{},"From your main checkout:",[58,59,64],"pre",{"className":60,"code":61,"language":62,"meta":63,"style":63},"language-bash shiki shiki-themes github-dark-high-contrast","git fetch origin main\ngit worktree add -b feature\u002Frefunds  .worktrees\u002Frefunds  origin\u002Fmain\ngit worktree add -b feature\u002Finvoices .worktrees\u002Finvoices origin\u002Fmain\n","bash","",[21,65,66,85,109],{"__ignoreMap":63},[67,68,71,75,79,82],"span",{"class":69,"line":70},"line",1,[67,72,74],{"class":73},"s_sBn","git",[67,76,78],{"class":77},"sTRMh"," fetch",[67,80,81],{"class":77}," origin",[67,83,84],{"class":77}," main\n",[67,86,88,90,93,96,100,103,106],{"class":69,"line":87},2,[67,89,74],{"class":73},[67,91,92],{"class":77}," worktree",[67,94,95],{"class":77}," add",[67,97,99],{"class":98},"sCcAr"," -b",[67,101,102],{"class":77}," feature\u002Frefunds",[67,104,105],{"class":77},"  .worktrees\u002Frefunds",[67,107,108],{"class":77},"  origin\u002Fmain\n",[67,110,112,114,116,118,120,123,126],{"class":69,"line":111},3,[67,113,74],{"class":73},[67,115,92],{"class":77},[67,117,95],{"class":77},[67,119,99],{"class":98},[67,121,122],{"class":77}," feature\u002Finvoices",[67,124,125],{"class":77}," .worktrees\u002Finvoices",[67,127,128],{"class":77}," origin\u002Fmain\n",[14,130,131,132,135,136,139],{},"Add ",[21,133,134],{},".worktrees\u002F"," to ",[21,137,138],{},".gitignore"," so the folders don't show up as untracked files.",[14,141,142,143,146],{},"Or skip the typing and ask Slo. It ships with a ",[21,144,145],{},"worktrees"," skill:",[148,149,150],"blockquote",{},[14,151,152],{},"\"Create a worktree for the refunds feature off the latest main.\"",[26,154,156],{"id":155},"_2-start-one-slo-session-in-each","2. Start one Slo session in each",[14,158,159],{},"Each session is scoped to the directory you launch it in:",[58,161,163],{"className":60,"code":162,"language":62,"meta":63,"style":63},"slo .worktrees\u002Frefunds\n",[21,164,165],{"__ignoreMap":63},[67,166,167,170],{"class":69,"line":70},[67,168,169],{"class":73},"slo",[67,171,172],{"class":77}," .worktrees\u002Frefunds\n",[14,174,175],{},"And in a second terminal:",[58,177,179],{"className":60,"code":178,"language":62,"meta":63,"style":63},"slo .worktrees\u002Finvoices\n",[21,180,181],{"__ignoreMap":63},[67,182,183,185],{"class":69,"line":70},[67,184,169],{"class":73},[67,186,187],{"class":77}," .worktrees\u002Finvoices\n",[14,189,190,191,194,195,198,199,202,203,206],{},"Each session reads the same ",[21,192,193],{},"SLO.md",", ",[21,196,197],{},"AGENTS.md"," and ",[21,200,201],{},"RESEARCH.md"," (they're in every checkout) and writes only to its own branch. Session history for both lands in ",[21,204,205],{},"~\u002F.slo\u002Fsessions\u002F",", tagged with the directory it ran in.",[208,209,211],"note",{"kind":210},"tip",[14,212,213,214,217,218,221],{},"Name your sessions with ",[21,215,216],{},"\u002Frename refunds"," so you can find them later with ",[21,219,220],{},"slo --resume refunds",".",[26,223,225],{"id":224},"_3-brief-each-one-separately","3. Brief each one separately",[14,227,228,229,234],{},"Treat them like two engineers. Each gets a ",[230,231,233],"a",{"href":232},"\u002Fdocs\u002Fguides\u002Fwrite-a-brief","full brief"," with its own outcome and boundaries. Say which directory it owns:",[58,236,241],{"className":237,"code":239,"language":240,"meta":63},[238],"language-text","Work only in .worktrees\u002Frefunds on branch feature\u002Frefunds.\nImplement task 12.b from specifications\u002F12-refunds\u002F. Don't commit.\n","text",[21,242,239],{"__ignoreMap":63},[26,244,246],{"id":245},"_4-keep-track-of-where-you-are","4. Keep track of where you are",[14,248,249],{},"With several sessions open, it's easy to lose track. Two quick checks:",[31,251,252,258],{},[34,253,254,257],{},[21,255,256],{},"\u002Fcwd"," shows the directory the current session is scoped to.",[34,259,260,263],{},[21,261,262],{},"git worktree list"," shows every worktree and its branch.",[26,265,267],{"id":266},"_5-ship-and-clean-up","5. Ship and clean up",[14,269,270],{},"When a branch is done, ship it from its worktree the usual way (or ask Slo to commit, push and open the pull request). Then remove the directory:",[58,272,274],{"className":60,"code":273,"language":62,"meta":63,"style":63},"git worktree remove .worktrees\u002Frefunds\ngit branch -d feature\u002Frefunds   # once it's merged\n",[21,275,276,287],{"__ignoreMap":63},[67,277,278,280,282,285],{"class":69,"line":70},[67,279,74],{"class":73},[67,281,92],{"class":77},[67,283,284],{"class":77}," remove",[67,286,172],{"class":77},[67,288,289,291,294,297,299],{"class":69,"line":87},[67,290,74],{"class":73},[67,292,293],{"class":77}," branch",[67,295,296],{"class":98}," -d",[67,298,102],{"class":77},[67,300,302],{"class":301},"sQrFR","   # once it's merged\n",[208,304,306],{"kind":305},"warning",[14,307,308,311],{},[21,309,310],{},"git worktree remove"," refuses to delete a worktree with uncommitted changes. That's a feature. If Slo left work there you still want, commit or copy it first rather than forcing the removal.",[26,313,315],{"id":314},"worktrees-and-dynamic-workflows","Worktrees and dynamic workflows",[14,317,318,319,323,324,328,329,221],{},"A ",[230,320,322],{"href":321},"\u002Fdocs\u002Ffeatures\u002Fdynamic-workflows","dynamic workflow"," already splits one job across sub-agents. Worktrees split ",[325,326,327],"em",{},"different"," jobs across sessions. They combine well: run a dynamic workflow in each worktree and watch both with ",[21,330,331],{},"slo visualize",[208,333,335],{"kind":334},"check",[31,336,337,340,343],{},[34,338,339],{},"Each piece of work has its own worktree and branch.",[34,341,342],{},"Each Slo session was launched in its worktree and briefed with that directory as its boundary.",[34,344,345],{},"Finished worktrees are removed.",[347,348,349],"style",{},"html pre.shiki code .s_sBn, html code.shiki .s_sBn{--shiki-default:#FFB757}html pre.shiki code .sTRMh, html code.shiki .sTRMh{--shiki-default:#ADDCFF}html pre.shiki code .sCcAr, html code.shiki .sCcAr{--shiki-default:#91CBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sQrFR, html code.shiki .sQrFR{--shiki-default:#BDC4CC}",{"title":63,"searchDepth":87,"depth":87,"links":351},[352,353,354,355,356,357,358],{"id":28,"depth":87,"text":29},{"id":52,"depth":87,"text":53},{"id":155,"depth":87,"text":156},{"id":224,"depth":87,"text":225},{"id":245,"depth":87,"text":246},{"id":266,"depth":87,"text":267},{"id":314,"depth":87,"text":315},"Run several Slo sessions on different branches of one repository without them tripping over each other.","md",{},true,"\u002Fdocs\u002Fguides\u002Fworktrees",{"title":5,"description":359},"docs\u002Fguides\u002Fworktrees","MWs97udqOPXr4MnhwHjR8B3v0CSdo-zN3SbNH-jI6qQ",1791641282712]