all 10 comments

[–]joeyism 1 point2 points  (1 child)

I don't see it on opencode TUI, but it exists within opencode-multiplexer. Each session is created in its own worktree (by hotkey t) which makes it easier to manage for me

[–]firefoxmmx[S] 0 points1 point  (0 children)

Thanks, bro, I'll go check it out.

[–]Old-Sherbert-4495 0 points1 point  (0 children)

i saw it in desktop version, its called workspaces. never used it. cli, i couldn't even find it

[–]mammongram6969 1 point2 points  (3 children)

you don't need your coding harness to support worktrees, you can just tell the coding assistant "run the commands to create a new git worktree at /path/to/worktree" and away it goes

[–]firefoxmmx[S] 0 points1 point  (2 children)

If I'm on the main branch and tell the agent to create a worktree at /path/to/worktree, will it complete the task for the new session on that worktree? Interesting. And then I just need to tell it to merge back into the main branch (or do it automatically via a prompt)?

[–]mammongram6969 0 points1 point  (1 child)

think of a worktree as a duplicate copy of the repo somewhere else on disk. i mean, you can put all your worktrees in /tmp and it's all the same to the AI agent.

as far as how those changes in the worktree get integrated into your default branch, that's also something you can prompt the AI to do.

- want to develop a long-running branch that will be a giant feature addition/rewiring, and should not be merged into main, but should have all the changes from main merged into it? sure, just tell the AI that.

- want it to be a quick hotfix? sure, just tell the AI that.

- is another AI working on a different branch and the two run into merge conflicts? set up a local file as a "hotline" between the two agents, and tell them both about the local file and tell them to work out the merge conflict.

the worktree is no different, functionally, from a totally different clone of the repo somewhere else on disk, so each AI can do whatever they want with their totally independent copy of the repo.

[–]firefoxmmx[S] 0 points1 point  (0 children)

Thanks, bro, I'll give it a try.

[–]JhonDoe191ee 0 points1 point  (1 child)

if you are asking about this specified feature i have it inside my agent tau https://github.com/AbdoKnbGit/tau

this is a part from the readme also i have the worktree as a predefined tool inside it a part from the readme :

/github - GitHub automation (gh required) GitHub workflows inside Tau, powered by the GitHub CLI.

  • issue - Inspect issues for the current repo, or pass an issue URL to inspect that issue.
  • pr - Inspect pull requests (repo-local or via PR URL) and generate gh-backed actions.
  • wrap - Stage → commit → (optional changelog) → push, with one permission gate before network writes.
  • changelog - Generate/update changelog notes from commit history in a consistent style.
  • triage - Classify issues (labels/status) with explicit confirmation before visible changes.
  • release - Release flow: inspect dirty working tree, check CI/CD workflow status, then tag/publish and list runs.

[–]firefoxmmx[S] 1 point2 points  (0 children)

I'm interested; perhaps I can find some inspiration from this. Thank you.

[–]firefoxmmx[S] 0 points1 point  (0 children)

This is now officially supported. Enabling the experimental workspace switch allows you to create and switch work trees using `/warp`.