Skip to content

wt list

List worktrees and their status.

Shows uncommitted changes, divergence from the default branch and remote, and optional CI status and LLM summaries.

wt list demo
Progressive rendering, then --full and --branches

--full adds the CI status column, fetched from the forge over the network, and LLM-generated summaries of each branch’s changes.

List all worktrees:

wt list
Branch Status @± ^↕ ^…± Remote⇅ Commit Age Message
@ feature-api + ↕⇡ +54 -5 ↑4 ↓1 +234 -24 ⇡3 6814f02 30m Add API tests
^ main ^⇅ ⇡1 ⇣1 41ee083 4d Merge fix-auth: ha…
+ fix-auth ↕| ↑2 ↓1 +25 -11 | b772e68 5h Add secure token s…
+ fix-typos _| | 41ee083 4d Merge fix-auth: ha…
○ Showing 4 worktrees, 1 with changes, 2 ahead, hidden: Path (↕ diverged from default)

Include CI status, LLM summaries, and branches without worktrees:

wt list --branches --full
Branch Status @± ^↕ ^…± Summary Remote⇅ CI
@ feature-api + ↕⇡ +54 -5 ↑4 ↓1 +234 -24 Refactor API to REST archit… ⇡3 #412
^ main ^⇅ ⇡1 ⇣1 #
+ fix-auth ↕| ↑2 ↓1 +25 -11 Harden auth with constant-t… | #408
+ fix-typos _| | #410
/ exp /↕ ↑2 ↓1 +137 Explore GraphQL schema and…
/ wip /↕ ↑1 ↓1 +33 Start API documentation
○ Showing 4 worktrees, 2 branches, 1 with changes, 4 ahead, hidden: Path, Commit, Age, Message

Output as JSON for scripting:

wt list --format=json
ColumnShows
BranchBranch name, elided with … past 32 characters; a detached worktree shows its short hash
StatusCompact symbols (see below)
@±Uncommitted changes, including untracked files: +added -deleted lines
^↕Commits ahead/behind default branch
^…±Lines merging into the default branch would add and delete; the merge-base diff (three-dot) when the merge would conflict
SummaryLLM-generated branch summary (see LLM summaries)
Remote⇅Commits ahead/behind tracking branch
CIPR/MR number colored by pipeline status; shown with --full
PathWorktree directory
URLDev server URL from project config; dimmed if port is not listening
(custom)User-defined custom columns from [list.custom-columns] user config
CommitShort hash, abbreviated per core.abbrev
AgeTime since last commit
MessageLast commit message (truncated)

In the headers, @ stands for the worktree’s own HEAD and ^ for the default branch, whatever it is named — the same shortcuts wt switch accepts.

Counts too large for their column are shortened, rounded down, and drawn brighter: C is hundreds and K thousands (↑3C is 300–399 commits, +2K is 2,000–2,999 lines), and ∞ means 10,000 or more. Line counts stay exact up to 999; commit counts up to 99. --format=json carries the exact counts.

The table sizes itself to the terminal. When the columns don’t all fit, the least important go first — roughly right to left, since the order above runs from identity to nice-to-have — and the summary footer names them (hidden: Commit, Age, Message). A wider terminal brings them back. To pin a set rather than leave it to the width, name the columns in [list] columns; a column named there shows even without --full. --format=json carries every field at any width.

The leftmost column marks each row by physical presence, from most present to least:

SymbolMeaning
@Current worktree
^Primary worktree (the repo’s home worktree)
+Other worktree
/Local branch without a worktree (--branches)
|Remote branch, not present locally until fetched (--remotes)

The Status column packs five subcolumns, left to right. Working-tree flags combine (+!?); each other subcolumn shows only its highest-priority symbol, top row first, and is blank when nothing applies. JSON output carries each as independent fields.

When space permits, the footer rotates through visible status explanations.

SymbolMeaning
+Staged files
!Modified files (unstaged)
?Untracked files
SymbolMeaning
✘Merge conflicts
↻Rebase, merge, cherry-pick, revert, or bisect in progress
⊟Prunable (worktree directory or its .git gone)
⊞Locked
⊘Detached HEAD
⚐Off the path its branch implies, or the branch is checked out in another worktree too
/Branch without a worktree
SymbolMeaning
^Primary worktree
∅No common ancestor
_Same commit, clean — safe to delete, row dimmed
⊂Content integrated via other history — safe to delete, row dimmed
✗Merging would conflict, counting tracked uncommitted changes
–Same commit, with uncommitted changes
↕Ahead and behind
↑Ahead
↓Behind
SymbolMeaning
|In sync
⇡Ahead
⇣Behind
⇅Ahead and behind

The last subcolumn holds the branch’s marker, set with wt config state marker set, usually an emoji. While the table loads, · stands in for a value not yet collected, or one that timed out.

The CI column shows the branch’s open PR/MR — #3035 on GitHub, Gitea, and Azure DevOps, !3035 on GitLab — colored by pipeline status, or a bare # when no number is available (e.g. branch workflows without a PR/MR). Green, blue, red, yellow, and gray show the pipeline state; magenta and cyan show the review state:

IndicatorMeaning
# greenAll checks passed
# blueChecks in progress
# redOne or more checks failed
# yellowMerge conflicts with the target branch
# grayNo PR/MR, or no checks configured
⚠ yellowCI status could not be fetched (expired login, rate limit, network, etc.)
# magentaA reviewer requested changes
# cyanA review is required (e.g. branch protection) but not yet given
(blank)Branch never pushed, forge CLI not logged in to the host, or no PR/MR and no branch workflow

A draft PR/MR only dims the cell, and an approved one leaves the color unchanged.

Changes requested (magenta) outranks running checks, while a required review (cyan) only recolors an otherwise green or gray branch. GitLab reports only required reviews and drafts.

CI cells are clickable links to the PR or pipeline page, and appear dimmed for a draft PR/MR or when unpushed local changes make the status stale. Results are cached for 30-60 seconds; use wt config state cache to view or clear.

Reuses the commit.generation command — the same LLM that generates commit messages. Enable with summary = true in [list] config; requires --full. Results are cached until the branch’s diff changes.

Each [list.custom-columns] entry in user config adds a column. Its key sets the header; its template renders each row’s cell. Templates read {{ vars.* }}, set with wt config state vars set, and {{ git.branch.* }}, from branch.<name>.* in Git config:

~/.config/worktrunk/config.toml
[list.custom-columns.Ticket]
template = "{{ vars.ticket }}"

wt config --help covers their templates, widths, and drop priority under Custom columns.


--format=json emits one envelope object. Items carry independent facts; rendered strings (including the collapsed Status value) live under display.

How “no value” reads:

  • Absent — nothing to report: not applicable (worktree on a branch-only row), not requested this run (the envelope’s collected records what was), or determined-empty (no PR, no lock, not integrated).
  • null — requested but not determined: a task timed out, a check was skipped, or a forge fetch failed. This is the JSON form of the table’s · placeholder.

jq treats absent and null identically in path expressions, so filters need no null checks; has() distinguishes the two when it matters.

Examples:

# Current worktree path (for scripts)
wt list --format=json | jq -r '.items[] | select(.worktree.current) | .worktree.path'
# Branches with uncommitted changes
wt list --format=json | jq '.items[] | select(.worktree.changes.modified)'
# Worktrees with merge conflicts
wt list --format=json | jq '.items[] | select(.worktree.changes.conflicted)'
# Branches ahead of main (needs merging)
wt list --format=json | jq '.items[] | select(.default_branch.ahead > 0) | .branch'
# Integrated branches (safe to remove)
wt list --format=json | jq '.items[] | select(.display.state == "integrated" or .display.state == "empty") | .branch'
# Branches without worktrees
wt list --format=json --branches | jq '.items[] | select(.worktree == null) | .branch'
# Worktrees ahead of upstream (needs pushing)
wt list --format=json | jq '.items[] | select(.upstream.ahead > 0) | {branch, ahead: .upstream.ahead}'
# Stale CI (local changes not reflected in CI)
wt list --format=json --full | jq '.items[] | select(.checks.stale) | .branch'

An envelope, trimmed to one item:

{
"schema": 2,
"repo": {
"default_branch": "main",
"forge": {
"url": "https://github.com/org/repo",
"provider": "github",
"host": "github.com",
"owner": "org",
"name": "repo",
"remote": "origin"
}
},
"collected": {
"ci": false,
"summary": false
},
"items": [
{
"branch": "feature",
"head": {
"sha": "05a4a45d…",
"short_sha": "05a4a45",
"subject": "Add login page",
"committed_at": "2025-01-01T08:00:00Z"
},
"worktree": {
"path": "/home/user/repo.feature",
"modified_at": "2025-01-01T09:30:00Z",
"main": false,
"current": true,
"previous": false,
"detached": false,
"branch_mismatch": false,
"duplicate_branch": false,
"changes": {
"staged": false,
"modified": true,
"untracked": false,
"renamed": false,
"deleted": false,
"conflicted": false,
"diff": {
"added": 10,
"deleted": 2
}
}
},
"default_branch": {
"ahead": 3,
"behind": 1,
"diff": {
"added": 50,
"deleted": 20
},
"orphan": false,
"merge_conflicts": false
},
"upstream": {
"remote": "origin",
"branch": "feature",
"ahead": 0,
"behind": 2
},
"display": {
"state": "diverged",
"symbols": "!↕⇣",
"statusline": "feature …"
}
}
]
}

A JSON Schema for the envelope is published at worktrunk.dev/schema/list-v2.json.

Envelope fields:

FieldTypeDescription
schemanumberFormat version; always 2
repoobject{default_branch, forge} — the branch every default_branch object measures against (absent when detection failed), and forge metadata derived from the primary remote (absent when no remote URL parses; see repo object)
collectedobject{ci, summary} — which gated fact families this run requested, so an absent pr/checks/summary reads as “not requested” rather than “none”
itemsarrayOne object per row: a worktree, a local branch, or a remote-only branch

Item fields:

FieldTypeDescription
branchstring/nullBranch name; null for a detached-HEAD worktree. Remote rows carry the bare name with the remote in remote
remotestringRemote name, present only on remote-only branch rows
headobject/nullHEAD commit (see head object); null for unborn branches
worktreeobjectWorktree facts (see worktree object); absent on branch-only rows
default_branchobjectRelation to the default branch (see default_branch object); absent on the default branch itself
upstreamobjectTracking branch (see upstream object); absent when none is configured
probjectOpen PR/MR (see pr object); collected with --full
checksobjectCI pipeline (see checks object); collected with --full
dev_serverobject{url, listening} from the project’s list.url template; absent when not configured
summarystringLLM branch summary; needs --full, [list] summary = true, and a [commit.generation] command
markerstringBranch marker from wt config state marker; absent when none is set
varsobjectPer-branch variables from wt config state vars
displayobjectRendered strings (see display object)
FieldTypeDescription
shastringFull commit SHA (40 chars)
short_shastring/nullShort commit SHA, abbreviated per core.abbrev (auto-extends for ambiguous prefixes); null when the commit can’t be read
subjectstring/nullCommit subject (first line); null when not loaded, as for a prunable worktree
committed_atstring/nullCommitter time, RFC 3339 UTC; null when not loaded

Present only on worktree rows. The location attributes are independent, so they co-occur — see Worktree for the symbols, which pick one:

FieldTypeDescription
pathstringWorktree path
modified_atstring/nullLater of HEAD committer time and the newest changed or untracked file mtime, RFC 3339 UTC; null when unresolved
mainbooleanIs the primary worktree: the main worktree, or in a bare repo the one on the default branch
currentbooleanIs the worktree the command ran from
previousbooleanIs the previous worktree (wt switch -)
detachedbooleanHEAD is detached
lockedobject{reason}; absent when not locked
prunableobject{reason}; absent when git doesn’t report the worktree prunable
branch_mismatchbooleanWorktree isn’t at the path its branch implies
duplicate_branchbooleanAnother worktree has the same branch checked out
operationstring/nullIn-progress operation: "merge", "rebase", "cherry_pick", "revert", "bisect"; absent when none
changesobject/nullWorking-tree state (see changes object)

The five change flags map to the Working tree symbols (renamed and deleted have none of their own):

FieldTypeDescription
stagedbooleanHas staged files
modifiedbooleanHas modified files (unstaged)
untrackedbooleanHas untracked files
renamedbooleanHas renamed files
deletedbooleanHas deleted files
conflictedboolean/nullTracked files carry merge conflicts
diffobject/nullLines changed vs HEAD: {added, deleted}

Independent facts; the table’s priority-collapsed symbol is display.state.

FieldTypeDescription
aheadnumber/nullCommits ahead of the default branch (null for orphans)
behindnumber/nullCommits behind the default branch (null for orphans)
diffobject/nullLines merging into the default branch would change, as in ^…±: {added, deleted}
orphanboolean/nullNo common ancestor with the default branch
integrationobject/null{reason} — which check found the content integrated (see integration reasons); absent when determined not-integrated, null when undetermined (a check timed out or was skipped)
merge_conflictsboolean/nullMerging into the default branch would conflict, simulated locally with git merge-tree

ahead / behind drive the Remote divergence symbol:

FieldTypeDescription
remotestringRemote name (e.g., "origin")
branchstring/nullBranch name on the remote
aheadnumberCommits ahead of remote
behindnumberCommits behind remote
FieldTypeDescription
numberinteger/nullPR/MR number
urlstring/nullURL to the PR/MR page
reviewstringReview state (see review states); absent when the forge reports no review signal
mergeableboolean/nullFalse when the forge reports conflicts, null otherwise
repoobjectStructured metadata for the repository the PR/MR targets, the upstream for fork PRs (see repo object); absent when the URL doesn’t parse
FieldTypeDescription
statusstring/null"passed", "running", or "failed"; null when a conflicts report masks it
sourcestring"pr" (PR/MR) or "branch" (branch workflow)
stalebooleanLocal HEAD differs from remote (unpushed changes)

Three CI status values have no checks.status of their own, because the shape of pr and checks reports them: a fetch error (⚠) makes both null, no CI leaves checks absent, and merge conflicts leave checks.status null with pr.mergeable false.

FieldTypeDescription
urlstringDev server URL from project config
listeningboolean/nullWhether the URL’s port is listening

Presentation only — every value here renders facts that appear elsewhere in the item:

FieldTypeDescription
statestringThe table’s collapsed default-branch state (see state values); absent when none applies
symbolsstringRaw status symbols without colors (e.g., "!?↓")
statuslinestringPre-formatted status with colors and links
columnsobjectRendered custom column values keyed by header; empty cells omitted

repo.forge describes the local checkout’s repository as derived from the primary remote. pr.repo describes the repository targeted by the PR/MR (for fork PRs, the upstream target).

FieldTypeDescription
urlstringRepository web URL
providerstring"github", "gitlab", "gitea", "azure-devops", or "unknown"
hoststringRepository web host
api_hoststringAPI host from forge.hostname, only on repo.forge when set
ownerstringOwner, organization, or namespace path
namestringRepository name
projectstringAzure DevOps project name; absent for other providers
remotestringLocal remote name; present on repo.forge, absent from pr.repo

display.state is the Default branch symbol, as a string:

ValueSymbol
"is_main"^
"orphan"∅
"empty"_
"integrated"⊂ (which check matched is in default_branch.integration.reason)
"would_conflict"✗
"same_commit"–
"diverged"↕
"ahead"↑
"behind"↓

default_branch.integration.reason records which check matched. Checks run cheapest-first and the first match wins. See Default branch for symbols.

ValueMeaning
"same_commit"Branch HEAD is the default branch’s commit
"ancestor"Branch HEAD is an ancestor of the default branch, which has moved past it
"no_added_changes"The three-dot diff (main...branch) is empty — no file changes beyond the merge-base
"trees_match"Different history, but the branch’s tree is identical to the default branch’s
"merge_adds_nothing"The branch has changes, but merging them leaves the default branch’s tree unchanged (e.g. a squash merge where the target advanced on other files)
"patch_id_match"The branch’s squashed diff matches a single commit on the default branch (e.g. a GitHub/GitLab squash merge)

pr.review is one of "changes_requested", "pending", "draft", "approved", absent when the forge reports no review signal. CI status shows how each renders. The vocabulary matches Claude Code’s statusline pr.review_state field.

[list] json-schema = 1 selects the retired schema-1 format, a bare array of rows; https://github.com/max-sixty/worktrunk/blob/v0.83.0/docs/src/content/docs/list.md#schema-1 maps its fields to schema 2.

Missing a field that would be generally useful? Open an issue.

  • wt switch — Switch worktrees or open interactive picker
wt list - List worktrees and their status
Usage: wt list [OPTIONS]
wt list <COMMAND>
Commands:
statusline Single-line status for the current worktree
Options:
--format <FORMAT>
Output format
[default: table]
[possible values: table, json]
--branches
Include branches without worktrees
--remotes
Include remote branches
--full
Show CI status and LLM summaries
--progressive
Show fast info immediately, update with slow info
Displays local data (branches, paths, status) first, then updates with remote data (CI,
upstream) as it arrives. Use --no-progressive to force buffered rendering. Auto-enabled
for TTY.
-h, --help
Print help (see a summary with '-h')
Global Options:
-C <path>
Working directory for this command
--config <path>
User config file path
--config-set <toml>
Override config with inline TOML, e.g. --config-set list.full=true (repeatable)
-v, --verbose...
Verbose output (-v: template variables; -vv: debug logs)
-y, --yes
Skip approval prompts

Single-line status for the current worktree.

The line carries the same cells as the worktree’s row in wt list. A stale CI status cache makes it reach the network for a second or two, so it fits a statusline the host renders in the background — Claude Code’s, a tmux status bar — better than a prompt the shell blocks on. Want it fast enough for a synchronous prompt? Open an issue.

  • table (default): branch status @± ^↕ ^…± Remote⇅ CI URL
  • json: the wt list --format=json output for this one item
  • claude-code: the table cells, preceded by dir and followed by model context pace

A cell with nothing to show is left out, so most lines are shorter than that. A line that overruns the terminal drops whole cells, least important first.

The CI reference links to its PR/MR, and a dev server URL carrying a port shows as :3000 linking to the URL in full, dim until something answers on that port. Both are underlined terminal links.

--format=claude-code reads JSON context from stdin (.workspace.current_dir is required; the rest are optional):

  • .workspace.current_dir — working directory
  • .model.display_name — model name
  • .context_window.used_percentage — context usage (0–100), rendered as 🌔 65%, the moon waning 🌕→🌑 as context fills
  • .rate_limits.{five_hour,seven_day}.used_percentage — rate-limit window usage (0–100)
  • .rate_limits.{five_hour,seven_day}.resets_at — window reset time (Unix epoch seconds)

The pace segment appears only when usage is likely to hit a rate limit before its window resets, and shows the higher-risk window: 2.9×(Tue–Tue 5pm) reads as 2.9× the pace that would exactly fill that window. Above 90% used it shows usage instead of pace — 93%(Tue–Tue 5pm). Its color deepens from dim to yellow as more of the window would be spent capped.

Claude Code statusline setup has the ~/.claude/settings.json entry that feeds this mode.

Command reference

Section titled “Command reference”
wt list statusline - Single-line status for the current worktree
Usage: wt list statusline [OPTIONS]
Options:
--format <FORMAT>
Output format
Possible values:
- table
- json
- claude-code: Claude Code statusline mode (reads context from stdin)
[default: table]
-h, --help
Print help (see a summary with '-h')