[{"data":1,"prerenderedAt":585},["ShallowReactive",2],{"content-\u002Fplugins\u002Faio-devops\u002Faio-worktree":3,"children-\u002Fplugins\u002Faio-devops\u002Faio-worktree":584},{"id":4,"title":5,"author":6,"body":7,"budget_tier":6,"build_tags":6,"created":6,"description":575,"document_type":576,"extension":577,"game":6,"install":36,"investment_tier":6,"league":6,"meta":578,"navigation":579,"patch":6,"path":580,"plugin":24,"profit_per_hour":6,"ratings":6,"seo":581,"skills_count":6,"status":6,"stem":582,"strategy_tier":6,"tags":6,"updated":6,"version":6,"weight":6,"__hash__":583},"content\u002Fplugins\u002Faio-devops\u002Faio-worktree.md","aio-worktree",null,{"type":8,"value":9,"toc":552},"minimark",[10,37,42,45,50,66,77,81,181,185,190,200,204,207,213,218,233,239,244,250,254,257,263,267,284,289,300,310,314,320,324,328,334,338,360,364,386,390,394,400,404,407,413,417,428,433,439,445,450,470,476,480],[11,12,13],"blockquote",{},[14,15,16,17,25,26,25,30,33,34],"p",{},"From plugin ",[18,19,21],"a",{"href":20},"\u002Fplugins\u002Faio-devops",[22,23,24],"strong",{},"aio-devops"," · ",[27,28,29],"code",{},"v1.0.2",[22,31,32],{},"Install:"," ",[27,35,36],{},"\u002Fplugin install aio-devops@aiocean-plugins",[38,39,41],"h1",{"id":40},"git-worktree-management","Git Worktree Management",[14,43,44],{},"Manages git worktrees for parallel development workflows.",[46,47,49],"h2",{"id":48},"environment","Environment",[51,52,53,60],"ul",{},[54,55,56,57],"li",{},"git: !",[27,58,59],{},"which git 2>\u002Fdev\u002Fnull || echo \"NOT INSTALLED\"",[54,61,62,63],{},"Scripts: !",[27,64,65],{},"echo \"${CLAUDE_PLUGIN_ROOT}\u002Fskills\u002Faio-worktree\"",[14,67,68,69,72,73,76],{},"Set ",[27,70,71],{},"WT"," to the Scripts path shown above. Then call scripts as ",[27,74,75],{},"$WT\u002Fscript-name",".",[46,78,80],{"id":79},"available-scripts","Available Scripts",[82,83,84,97],"table",{},[85,86,87],"thead",{},[88,89,90,94],"tr",{},[91,92,93],"th",{},"Script",[91,95,96],{},"Purpose",[98,99,100,111,121,131,141,151,161,171],"tbody",{},[88,101,102,108],{},[103,104,105],"td",{},[27,106,107],{},"worktree-create.sh",[103,109,110],{},"Create new worktree with branch",[88,112,113,118],{},[103,114,115],{},[27,116,117],{},"worktree-list.sh",[103,119,120],{},"List all worktrees and their status",[88,122,123,128],{},[103,124,125],{},[27,126,127],{},"worktree-sync.sh",[103,129,130],{},"Sync worktree ↔ main (rebase + ff)",[88,132,133,138],{},[103,134,135],{},[27,136,137],{},"worktree-spotlight.sh",[103,139,140],{},"Live file sync for hot reload",[88,142,143,148],{},[103,144,145],{},[27,146,147],{},"worktree-spotlight-status.sh",[103,149,150],{},"Check if spotlight is running",[88,152,153,158],{},[103,154,155],{},[27,156,157],{},"worktree-merge.sh",[103,159,160],{},"Merge worktree branch to\u002Ffrom parent",[88,162,163,168],{},[103,164,165],{},[27,166,167],{},"worktree-remove.sh",[103,169,170],{},"Remove worktree and delete branch",[88,172,173,178],{},[103,174,175],{},[27,176,177],{},"worktree-cleanup.sh",[103,179,180],{},"Emergency cleanup after crash",[46,182,184],{"id":183},"workflow","Workflow",[186,187,189],"h3",{"id":188},"_1-create-worktree","1. Create Worktree",[191,192,198],"pre",{"className":193,"code":195,"language":196,"meta":197},[194],"language-bash","$WT\u002Fworktree-create.sh \u003Cname> [source_ref]\n\n# Examples:\nworktree-create.sh feature-login          # from HEAD\nworktree-create.sh hotfix-bug main        # from main branch\nworktree-create.sh experiment abc123      # from specific commit\n\n# Creates:\n#   Folder: {repo}--wtr-{name}  (e.g., myrepo--wtr-feature-login)\n#   Branch: wtr-{name}          (e.g., wtr-feature-login)\n","bash","",[27,199,195],{"__ignoreMap":197},[186,201,203],{"id":202},"_2-sync-rebase-fast-forward","2. Sync (Rebase + Fast-Forward)",[14,205,206],{},"Sync worktree with parent branch. Both end up at the same commit with same hash.",[191,208,211],{"className":209,"code":210,"language":196,"meta":197},[194],"# From within worktree directory\n$WT\u002Fworktree-sync.sh\n",[27,212,210],{"__ignoreMap":197},[14,214,215],{},[22,216,217],{},"How it works:",[219,220,221,227],"ol",{},[54,222,223,226],{},[22,224,225],{},"Rebase"," worktree onto parent (get latest from main, put your commits on top)",[54,228,229,232],{},[22,230,231],{},"Fast-forward"," parent to worktree (now both identical)",[14,234,235,238],{},[22,236,237],{},"Result:"," Both branches at same commit, same hash. No duplicates.",[14,240,241],{},[22,242,243],{},"Example workflow:",[191,245,248],{"className":246,"code":247,"language":196,"meta":197},[194],"# In worktree: make changes, commit\ngit add . && git commit -m \"feat: new feature\"\n\n# Sync with main\nworktree-sync.sh\n\n# Output:\n# Syncing: wtr-feature ↔ main\n# Status: worktree +2 commits, parent +1 commits\n# === Step 1: Rebase onto main ===\n# === Step 2: Fast-forward main ===\n# Sync complete!\n# Both branches at: abc1234\n",[27,249,247],{"__ignoreMap":197},[186,251,253],{"id":252},"_3-spotlight-temporary-file-sync","3. Spotlight (Temporary File Sync)",[14,255,256],{},"Preview worktree changes in main repo with hot reload. One-way sync, temporary.",[191,258,261],{"className":259,"code":260,"language":196,"meta":197},[194],"# Run in background from MAIN repo\n$WT\u002Fworktree-spotlight.sh \u003Cworktree_path> . [excludes...]\n\n# Example:\nworktree-spotlight.sh ..\u002Fmyrepo--wtr-feature . node_modules dist .env\n",[27,262,260],{"__ignoreMap":197},[14,264,265],{},[22,266,217],{},[51,268,269,272,275,278],{},[54,270,271],{},"Watches worktree for file changes",[54,273,274],{},"Copies changed files to main repo (for hot reload preview)",[54,276,277],{},"On exit: main repo restored to clean state",[54,279,280,283],{},[22,281,282],{},"Does NOT commit anything"," - purely temporary",[14,285,286],{},[22,287,288],{},"Important:",[51,290,291,297],{},[54,292,293,294],{},"Run with ",[27,295,296],{},"run_in_background: true",[54,298,299],{},"Main repo must be clean before starting",[14,301,302,305,306,309],{},[22,303,304],{},"To stop:"," Ctrl+C or ",[27,307,308],{},"kill \u003CPID>",". Cleanup is automatic.",[186,311,313],{"id":312},"_4-remove-worktree","4. Remove Worktree",[191,315,318],{"className":316,"code":317,"language":196,"meta":197},[194],"$WT\u002Fworktree-remove.sh \u003Cpath_or_name>\n\n# Examples:\nworktree-remove.sh ..\u002Fmyrepo--wtr-feature  # by path\nworktree-remove.sh feature                 # by name (auto-resolves path)\n",[27,319,317],{"__ignoreMap":197},[46,321,323],{"id":322},"common-scenarios","Common Scenarios",[186,325,327],{"id":326},"multiple-ai-agents-working-in-parallel","\"Multiple AI agents working in parallel\"",[191,329,332],{"className":330,"code":331,"language":196,"meta":197},[194],"# Agent A creates worktree\nworktree-create.sh agent-a-task\n\n# Agent B creates worktree\nworktree-create.sh agent-b-task\n\n# Both work and commit independently...\n\n# Agent A syncs first\ncd ..\u002Frepo--wtr-agent-a-task\nworktree-sync.sh\n# main now has Agent A's commits\n\n# Agent B syncs (gets A's work + pushes B's work)\ncd ..\u002Frepo--wtr-agent-b-task\nworktree-sync.sh\n# main now has both A and B's commits\n# Agent B's worktree also has A's commits\n\n# Agent A syncs again to get B's work\ncd ..\u002Frepo--wtr-agent-a-task\nworktree-sync.sh\n# All three (main, worktree-a, worktree-b) now identical\n",[27,333,331],{"__ignoreMap":197},[186,335,337],{"id":336},"i-want-hot-reload-preview-while-working-in-worktree","\"I want hot reload preview while working in worktree\"",[219,339,340,343,349,352,355],{},[54,341,342],{},"Ensure main repo is clean",[54,344,345,346],{},"Run spotlight: ",[27,347,348],{},"worktree-spotlight.sh \u003Cworktree> . node_modules",[54,350,351],{},"Edit in worktree → changes appear in main for hot reload",[54,353,354],{},"Stop spotlight → main restored clean",[54,356,357,358],{},"Commit in worktree, then sync: ",[27,359,127],{},[186,361,363],{"id":362},"i-want-to-work-on-a-feature-and-sync-with-main","\"I want to work on a feature and sync with main\"",[219,365,366,372,375,380],{},[54,367,368,369],{},"Create worktree: ",[27,370,371],{},"worktree-create.sh feature-x",[54,373,374],{},"Work in worktree, commit as usual",[54,376,377,378],{},"Sync anytime: ",[27,379,127],{},[54,381,382,383],{},"When done: ",[27,384,385],{},"worktree-remove.sh feature-x",[46,387,389],{"id":388},"error-recovery","Error Recovery",[186,391,393],{"id":392},"spotlight-crashed","\"Spotlight crashed\"",[191,395,398],{"className":396,"code":397,"language":196,"meta":197},[194],"worktree-cleanup.sh .\n",[27,399,397],{"__ignoreMap":197},[186,401,403],{"id":402},"sync-has-conflicts","\"Sync has conflicts\"",[14,405,406],{},"Script will stop at rebase conflict. Resolve conflicts, then:",[191,408,411],{"className":409,"code":410,"language":196,"meta":197},[194],"git rebase --continue\n# Then run sync again\nworktree-sync.sh\n",[27,412,410],{"__ignoreMap":197},[46,414,416],{"id":415},"worktrees-agent-teams","Worktrees + Agent Teams",[14,418,419,420,423,424,427],{},"When using ",[22,421,422],{},"Agent Teams"," (experimental, requires ",[27,425,426],{},"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1","), combine worktrees with agent teams for maximum parallel safety.",[14,429,430],{},[22,431,432],{},"Pattern: Each teammate gets their own worktree",[191,434,437],{"className":435,"code":436,"language":196,"meta":197},[194],"# Lead creates worktrees for each teammate\nworktree-create.sh teammate-frontend\nworktree-create.sh teammate-backend\nworktree-create.sh teammate-tests\n\n# Each teammate works in their own worktree (no file conflicts)\n# Teammate messages via SendMessage when ready to sync\n# Lead coordinates sync order to avoid conflicts\n",[27,438,436],{"__ignoreMap":197},[14,440,441,444],{},[22,442,443],{},"Why:"," Agent teams let multiple Claude instances work in parallel. Worktrees give each instance an isolated filesystem. Combined = true parallel development without merge conflicts.",[14,446,447],{},[22,448,449],{},"Sync strategy with teams:",[219,451,452,455,458,464,467],{},[54,453,454],{},"Teammates work and commit independently in their worktrees",[54,456,457],{},"When a teammate finishes, they message the lead",[54,459,460,461,463],{},"Lead runs ",[27,462,127],{}," in order (first-done-first-synced)",[54,465,466],{},"Later teammates get earlier teammates' work when they sync",[54,468,469],{},"All worktrees converge to the same history",[14,471,472,475],{},[22,473,474],{},"When NOT to combine:"," If tasks are small and touch different files anyway, agent teams alone (without worktrees) work fine. Use worktrees when there's ANY risk of file overlap.",[46,477,479],{"id":478},"key-points","Key Points",[51,481,482,513,519,525,531,537,543],{},[54,483,484,33,487,490,491],{},[22,485,486],{},"Naming convention:",[27,488,489],{},"wtr-"," prefix for easy identification\n",[51,492,493,504],{},[54,494,495,496,499,500,503],{},"Folder: ",[27,497,498],{},"{repo}--wtr-{name}"," (e.g., ",[27,501,502],{},"myrepo--wtr-feature",")",[54,505,506,507,499,510,503],{},"Branch: ",[27,508,509],{},"wtr-{name}",[27,511,512],{},"wtr-feature",[54,514,515,518],{},[22,516,517],{},"Sync keeps same hash:"," Rebase + fast-forward = identical commits",[54,520,521,524],{},[22,522,523],{},"No duplicate commits:"," Unlike cherry-pick, sync keeps history clean",[54,526,527,530],{},[22,528,529],{},"Parallel-friendly:"," Multiple worktrees can sync independently",[54,532,533,536],{},[22,534,535],{},"Spotlight = file-based:"," Temporary file copying for preview, no commits",[54,538,539,542],{},[22,540,541],{},"Always commit before sync:"," Sync works with commits, not uncommitted changes",[54,544,545,548,549,503],{},[22,546,547],{},"Spotlight fallback:"," Uses polling if fswatch not installed (",[27,550,551],{},"brew install fswatch",{"title":197,"searchDepth":553,"depth":553,"links":554},2,[555,556,557,564,569,573,574],{"id":48,"depth":553,"text":49},{"id":79,"depth":553,"text":80},{"id":183,"depth":553,"text":184,"children":558},[559,561,562,563],{"id":188,"depth":560,"text":189},3,{"id":202,"depth":560,"text":203},{"id":252,"depth":560,"text":253},{"id":312,"depth":560,"text":313},{"id":322,"depth":553,"text":323,"children":565},[566,567,568],{"id":326,"depth":560,"text":327},{"id":336,"depth":560,"text":337},{"id":362,"depth":560,"text":363},{"id":388,"depth":553,"text":389,"children":570},[571,572],{"id":392,"depth":560,"text":393},{"id":402,"depth":560,"text":403},{"id":415,"depth":553,"text":416},{"id":478,"depth":553,"text":479},"Manage git worktrees for parallel development workflows — create, sync, and spotlight preview.","skill","md",{},true,"\u002Fplugins\u002Faio-devops\u002Faio-worktree",{"title":5,"description":575},"plugins\u002Faio-devops\u002Faio-worktree","8hVJfu8evgRXeaK1mJHmRGDAEkn0C_77geqiUWqiqRs",[],1779707416330]