v1
latestSwagger 2.02026-07-175445133.1 KBgit
List all worktrees
Returns a list of all worktrees for the current repository with fast cache-enhanced responses. Supports conditional requests via If-None-Match header for efficient polling.
get/v1/git/worktrees
Headers
If-None-Matchstring
ETag from previous request
Response
OK
Example response
[
{
"branch": "feature/api-docs",
"commit_count": 3,
"commit_hash": "abc123def456",
"commits_behind": 2,
"created_at": "2024-01-15T14:00:00Z",
"has_been_renamed": true,
"id": "abc123-def456-ghi789",
"is_dirty": true,
"last_accessed": "2024-01-15T16:30:00Z",
"name": "feature-api-docs",
"path": "/workspace/worktrees/feature-api-docs",
"pull_request_body": "This PR adds new functionality to the system",
"pull_request_state": "open",
"pull_request_title": "Feature: Add new functionality",
"pull_request_url": "https://github.com/owner/repo/pull/123",
"repo_id": "anthropics/claude-code",
"source_branch": "main",
"todos": [
{
"content": "Fix authentication bug",
"id": "1",
"priority": "high",
"status": "in_progress"
}
]
}
]