---
title: "List all worktrees"
method: GET
path: "/v1/git/worktrees"
tags: ["git"]
---

# List all worktrees

`GET /v1/git/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.

## Headers

- `If-None-Match` string

## Response `200`

OK

- InternalHandlersEnhancedWorktree[]
  - `branch` string — Current git branch name in this worktree
  - `cache_status` InternalHandlersWorktreeCacheStatus
    - `is_cached` boolean
    - `is_loading` boolean
    - `last_updated` integer — Unix timestamp in milliseconds
  - `claude_activity_state` 'inactive' | 'running' | 'active'
  - `commit_count` integer — Number of commits ahead of the divergence point (CommitHash)
  - `commit_hash` string — Commit hash where this worktree diverged from source branch (updated after merges)
  - `commits_behind` integer — Number of commits the source branch is ahead of our divergence point
  - `created_at` string — When this worktree was created
  - `has_active_claude_session` boolean — Whether there's an active Claude session for this worktree (deprecated - use ClaudeActivityState)
  - `has_been_renamed` boolean — Whether this worktree's branch has been renamed from its original catnip ref
  - `has_commits_ahead_of_remote` boolean — Whether the branch has commits ahead of the remote branch (calculated on list)
  - `has_conflicts` boolean — Whether the worktree is in a conflicted state (rebase/merge conflicts)
  - `id` string — Unique identifier for this worktree
  - `is_dirty` boolean — Whether there are uncommitted changes in the worktree
  - `last_accessed` string — When this worktree was last accessed
  - `latest_claude_message` string — Latest Claude message from the current session
  - `latest_claude_message_type` string — Type of the latest Claude message ("assistant" or "user")
  - `latest_session_title` string — Latest session title from the current session (simplified string version)
  - `latest_user_prompt` string — Latest user prompt from ~/.claude.json history
  - `name` string — User-friendly name for this worktree (e.g., 'vectorize-quasar')
  - `path` string — Absolute path to the worktree directory
  - `pull_request_body` string — Body/description of the associated pull request (persisted for updates)
  - `pull_request_last_synced` string — Last time the PR state was synced
  - `pull_request_state` string — State of the associated pull request (open, closed, merged)
  - `pull_request_title` string — Title of the associated pull request (persisted for updates)
  - `pull_request_url` string — URL of the associated pull request (if one exists)
  - `repo_id` string — Repository this worktree belongs to
  - `session_title` GithubComVanpeltCatnipInternalModelsTitleEntry
    - `commit_hash` string
    - `timestamp` string
    - `title` string
  - `session_title_history` GithubComVanpeltCatnipInternalModelsTitleEntry[] — History of session titles
    - `commit_hash` string
    - `timestamp` string
    - `title` string
  - `source_branch` string — Branch this worktree was originally created from
  - `todos` GithubComVanpeltCatnipInternalModelsTodo[] — Current todos from the most recent TodoWrite in Claude session
    - `content` string — The content/description of the todo
    - `id` string — Unique identifier for the todo item
    - `priority` 'high' | 'medium' | 'low' — Priority level of the todo
    - `status` 'pending' | 'in_progress' | 'completed' — Current status of the todo

## Other responses

- `304` — Not Modified - content unchanged

---

[API](https://skmtc.net/wandb/apis/catnip-container-api.md) · [All operations](https://skmtc.net/wandb/apis/catnip-container-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/wandb/catnip-container-api/versions/a075b0fa501a/schema)
