Closed as not planned
Closed as not planned
Copy link
Description
Problem
Subagents (general, explore, scout) share the primary session's working tree. No documented way to spawn a subagent in an isolated git worktree so it can experiment (build, run tests, mutate files) without touching the parent's checkout.
What Claude Code has
isolation: "worktree" param on the Agent tool: creates .claude/worktrees/<name> on a new branch, switches the agent's cwd there; ExitWorktree cleans up. Ref: Claude Code Agent tool schema (2026-07-02).
Why it matters
Multi-agent parallelism on the same repo currently risks stepping on each other's edits. Worktrees are git-native (near-zero overhead) and let each agent verify in isolation before merging back.
Suggested shape
- Frontmatter or CLI flag:
isolation: worktreeon agent definitions. - Auto-create
.opencode/worktrees/<agent>-<uuid>/on a branch off HEAD. - New plugin events
worktree.create/worktree.remove. - Cleanup on session end unless dirty (prompt to keep).
Thanks for the great work on OpenCode!
Reacted by Kevin Cox and jchristi
Metadata
Metadata
Assignees
Labels
No labels
Activity
github-actions commentedon Jul 2, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:(e.g.,[FEATURE]: Subagent worktree isolation (isolation: worktree))Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
isolation: worktreeconfig field for automatic subagent worktree provisioning — nearly identical request, same Claude Code reference, same suggested shapeIf you believe this was flagged incorrectly, please let a maintainer know.
github-actions commentedon Jul 2, 2026
This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.
Feel free to open a new issue that follows our issue templates.