Skip to content

Feature request: subagent worktree isolation (isolation: worktree) #34872

Closed as not planned

Description

@chirag127

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: worktree on 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!

Activity

  1. github-actions commented on Jul 2, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • The title should start with [FEATURE]: (e.g., [FEATURE]: Subagent worktree isolation (isolation: worktree))
    • The feature request template requires a verification checkbox confirming you have checked that this feature hasn't been suggested before

    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:

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on Jul 2, 2026

    @github-actions
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions