---
title: "Create worktree"
method: POST
path: "/experimental/worktree"
---

# Create worktree

`POST /experimental/worktree`

Create a new git worktree for the current project and run any configured startup scripts.

## Query parameters

- `directory` string
- `workspace` string

## Request body

- WorktreeCreateInput
  - `name` string
  - `startCommand` string — Additional startup script to run after the project's start command

## Response `200`

Worktree created

- Worktree
  - `name` string, required
  - `branch` string, required
  - `directory` string, required

## Other responses

- `400` — Bad request

---

[API](https://skmtc.net/kaaass/apis/opencode.md) · [All operations](https://skmtc.net/kaaass/apis/opencode/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kaaass/opencode/versions/8bb9a15bd144/schema)
