---
title: "List worktrees"
method: GET
path: "/api/worktree"
tags: ["worktree"]
---

# List worktrees

`GET /api/worktree`

## Request

- Base URL: `https://opencode.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://opencode.ai/api/worktree`
- Auth: none required

Return the project's saved worktree inventory without loading configuration or running discovery.

## Query parameters

- `projectID` string, required

## Response `200`

Worktree.List

- WorktreeDirectory[]
  - `directory` string, required
  - `strategy` string

## Other responses

- `400`: InvalidRequestError
- `401`: UnauthorizedError
- `404`: ProjectNotFoundError

---

[API](https://skmtc.dev/kaaass/apis/opencode.md) - [All operations](https://skmtc.dev/kaaass/apis/opencode/llms.txt) - [OpenAPI document](https://skmtc.dev/kaaass/apis/opencode/revisions/4e083d954707?raw)
