# `T3.Worktrees`
[🔗](https://github.com/dl-alexandre/t3-elixir/blob/main/lib/t3/worktrees.ex#L1)

Worktrees MCP operations. Pass T3's original string-keyed argument maps.

Tool availability depends on the authenticated server, permission mode and
invocation context. In-app agent tools may not be available to outside clients.
See `T3.Catalog.tools(:worktrees)` for descriptions and context requirements.

# `handoff`

```elixir
@spec handoff(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

Move THIS thread into a new git worktree on a new branch. Runs the setup script by default. A separate agent in a worktree: `t3_thread_launch` with `workspaceStrategy`. Call last in your turn. The move ends the live session. `continuationPrompt` resumes work there next turn. Without it, the thread waits. The worktree stays after the thread is deleted. Fails if this thread has a worktree.

Some operations require a T3-launched agent/thread context. The server enforces tool visibility and permissions.

# `list`

```elixir
@spec list(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

List branch refs and checkout paths for a thread's workspace. Omit `threadId` for this thread. Detached worktrees with no branch are left out.

Some operations require a T3-launched agent/thread context. The server enforces tool visibility and permissions.

# `status`

```elixir
@spec status(T3.Client.t(), map()) :: {:ok, map()} | {:error, T3.Error.t()}
```

Report this thread's worktree: attached or not, path, branch, project root, and the `startFromOrigin` default. Check before `t3_worktree_handoff`.

Some operations require a T3-launched agent/thread context. The server enforces tool visibility and permissions.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
