Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
Refactor status symbols for better JSON querying
Maximilian Roos1864c7bc1fa6
diff --git a/.claude-plugin/skills/worktrunk/reference/README.md b/.claude-plugin/skills/worktrunk/reference/README.mdindex 01565e9da..d511dea2f 100644--- a/.claude-plugin/skills/worktrunk/reference/README.md+++ b/.claude-plugin/skills/worktrunk/reference/README.md@@ -10,13 +10,13 @@<!-- [](https://crates.io/crates/worktrunk) --><!-- [](https://github.com/max-sixty/worktrunk/stargazers) -->-Worktrunk is a CLI tool which makes working with git worktrees much much easier.+Worktrunk is a CLI tool which makes working with git worktrees much more fluid.It's designed for those running many concurrent AI coding agents.For context, git worktrees let multiple agents work on a single repo withoutcolliding; each agent gets a separate directory with a version of the code. But-creating worktrees, tracking paths & statuses, cleaning up, etc is manual.-Worktrunk offers transparency and automation for this lifecycle.+creating worktrees, tracking paths & statuses, cleaning up, etc, is manual.+Worktrunk offers control, transparency & automation for this workflow.## Quick Start@@ -29,7 +29,7 @@ $ wt switch --create fix-auth✅ Created new worktree for fix-auth from main at ../repo.fix-auth/```-**Work, make changes, then merge back:**+**After making changes, merge it back:**<!-- Output from: tests/snapshots/integration__integration_tests__merge__readme_example_simple.snap -->@@ -43,7 +43,6 @@ $ wt merge✅ Merged to main (1 commit, 1 file, +13)🔄 Removing worktree & branch...✅ Removed worktree & branch for fix-auth, changed directory to ../repo/-# Shell back in main```See [`wt merge`](#wt-merge-target) for all options.@@ -77,9 +76,9 @@ See [Shell Integration](#shell-integration) for details.Worktrunk is opinionated! It's not designed to be all things to all people. The choices optimize for agent workflows:-- Lots of short-lived worktrees- Trunk-based development-- CLI-based agents+- Lots of short-lived worktrees+- Terminal-based coding agents- Inner dev loops are local- Shell navigation- Commits are squashed into linear histories@@ -301,32 +300,36 @@ Options:**BEHAVIOR:**Switching to Existing Worktree:- - If worktree exists for branch, changes directory via shell integration- - No hooks run- - No branch creation++- If worktree exists for branch, changes directory via shell integration+- No hooks run+- No branch creationCreating New Worktree (--create):- 1. Creates new branch (defaults to current default branch as base)- 2. Creates worktree in configured location (default: `../{{ main_worktree }}.{{ branch }}`)- 3. Runs post-create hooks sequentially (blocking)- 4. Shows success message- 5. Spawns post-start hooks in background (non-blocking)- 6. Changes directory to new worktree via shell integration++1. Creates new branch (defaults to current default branch as base)+2. Creates worktree in configured location (default: `../{{ main_worktree }}.{{ branch }}`)+3. Runs post-create hooks sequentially (blocking)+4. Shows success message+5. Spawns post-start hooks in background (non-blocking)+6. Changes directory to new worktree via shell integration**HOOKS:**post-create (sequential, blocking):- - Run after worktree creation, before success message- - Typically: npm install, cargo build, setup tasks- - Failures block the operation- - Skip with --no-verify++- Run after worktree creation, before success message+- Typically: npm install, cargo build, setup tasks+- Failures block the operation+- Skip with --no-verifypost-start (parallel, background):- - Spawned after success message shown- - Typically: dev servers, file watchers, editors- - Run in background, failures logged but don't block- - Logs: `.git/wt-logs/{branch}-post-start-{name}.log`- - Skip with --no-verify++- Spawned after success message shown+- Typically: dev servers, file watchers, editors+- Run in background, failures logged but don't block+- Logs: `.git/wt-logs/{branch}-post-start-{name}.log`+- Skip with --no-verify**EXAMPLES:**@@ -353,6 +356,7 @@ wt switch --create temp --no-verify**SHORTCUTS:**Use '@' for current HEAD, '-' for previous, '^' for main:+```bashwt switch @ # Switch to current branch's worktreewt switch - # Switch to previous worktree@@ -461,34 +465,38 @@ Options:**BEHAVIOR:**Remove Current Worktree (no arguments):- - Requires clean working tree (no uncommitted changes)- - If in worktree: removes it and switches to main worktree- - If in main worktree: switches to default branch (e.g., main)- - If already on default branch in main: does nothing++- Requires clean working tree (no uncommitted changes)+- If in worktree: removes it and switches to main worktree+- If in main worktree: switches to default branch (e.g., main)+- If already on default branch in main: does nothingRemove Specific Worktree (by name):- - Requires target worktree has clean working tree- - Removes specified worktree(s) and associated branches- - If removing current worktree, switches to main first- - Can remove multiple worktrees in one command++- Requires target worktree has clean working tree+- Removes specified worktree(s) and associated branches+- If removing current worktree, switches to main first+- Can remove multiple worktrees in one commandRemove Multiple Worktrees:- - When removing multiple, current worktree is removed last- - Prevents deleting directory you're currently in- - Each worktree must have clean working tree++- When removing multiple, current worktree is removed last+- Prevents deleting directory you're currently in+- Each worktree must have clean working tree**CLEANUP:**When removing a worktree (by default):- 1. Validates worktree has no uncommitted changes- 2. Changes directory (if removing current worktree)- 3. Spawns background removal process (non-blocking)- - Directory deletion happens in background- - Git worktree metadata removed in background- - Branch deletion in background (uses git branch -d, safe delete)- - Logs: `.git/wt-logs/{branch}-remove.log`- 4. Returns immediately so you can continue working- - Use --no-background for foreground removal (blocking)++1. Validates worktree has no uncommitted changes+2. Changes directory (if removing current worktree)+3. Spawns background removal process (non-blocking)+ - Directory deletion happens in background+ - Git worktree metadata removed in background+ - Branch deletion in background (uses git branch -d, safe delete)+ - Logs: `.git/wt-logs/{branch}-remove.log`+4. Returns immediately so you can continue working+ - Use --no-background for foreground removal (blocking)**EXAMPLES:**@@ -671,6 +679,7 @@ Enable AI-generated commit messages2. Configure a modelFor Claude:+```bashllm install llm-anthropicllm keys set anthropic@@ -679,6 +688,7 @@ Enable AI-generated commit messages```For OpenAI:+```bashllm keys set openai# Paste your API key from: https://platform.openai.com/api-keysdiff --git a/CLAUDE.md b/CLAUDE.mdindex a77b5e067..892ed7fad 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -494,10 +494,11 @@ Use `wt list --format=json` for structured data access. The output is an array o- `head_sha`, `timestamp`, `commit_message`: commit info- `ahead`, `behind`: commits ahead/behind main branch- `branch_diff`: `{added, deleted}` - line diff vs main-- `has_conflicts`: boolean - merge conflicts with main- `upstream_remote`, `upstream_ahead`, `upstream_behind`: remote tracking status- `pr_status`: PR/CI status object (null if not available)-- `user_status`: user-defined status from `worktrunk.status` config (optional)+- `status_symbols`: structured status object with two maps:+ - `status`: variant names for queryability (e.g., "MatchesMain", "Ahead")+ - `status_symbols`: display symbols (e.g., "≡", "↑")### Worktree-Specific Fields@@ -509,7 +510,6 @@ Use `wt list --format=json` for structured data access. The output is an array o- `working_tree_diff_with_main`: `{added, deleted}` or null (null = not computed, `{0,0}` = matches main exactly)- `worktree_state`: "rebase" | "merge" | null - git operation in progress- `is_primary`: boolean - is main worktree-- `status_symbols`: structured status object (see below)### Branch-Specific Fields@@ -517,7 +517,7 @@ Use `wt list --format=json` for structured data access. The output is an array o### JSON Field Documentation-**For status symbols and query examples, see:**+**For complete field documentation and additional examples, see:**- `wt list --help` - authoritative source of truth- README.md - copy of help text for quick referencediff --git a/src/cli.rs b/src/cli.rsindex f3fa270e9..79a3cba44 100644--- a/src/cli.rs+++ b/src/cli.rs@@ -387,30 +387,42 @@ Order: `=≠ ≡∅ ↻⋈ ⎇⊠⚠ ↑↓ ⇡⇣ ?!+»✘`## JSON OUTPUT-Use `--format=json` for structured data. The `status_symbols` object provides:--- `has_conflicts`: boolean - true when branch has conflicts with main-- `branch_state`: \"\" | \"=\" (conflicts) | \"≠\" (potential) | \"≡\" (matches main) | \"∅\" (no commits)-- `git_operation`: \"\" | \"↻\" (rebase) | \"⋈\" (merge)-- `worktree_attrs`: \"⎇\" (branch) or combination of \"⊠\" (locked), \"⚠\" (prunable)-- `main_divergence`: \"\" | \"↑\" (ahead) | \"↓\" (behind) | \"↕\" (diverged)-- `upstream_divergence`: \"\" | \"⇡\" (ahead) | \"⇣\" (behind) | \"⇅\" (diverged)-- `working_tree`: combination of \"?\" (untracked), \"!\" (modified), \"+\" (staged), \"»\" (renamed), \"✘\" (deleted)-- `user_status`: custom status from git config (optional)+Use `--format=json` for structured data. The `status_symbols` field contains two maps:++**`status` (variant names for querying):**+- `branch_state`: \"\" | \"Conflicts\" | \"PotentialConflicts\" | \"MatchesMain\" | \"NoCommits\"+- `git_operation`: \"\" | \"Rebase\" | \"Merge\"+- `main_divergence`: \"\" | \"Ahead\" | \"Behind\" | \"Diverged\"+- `upstream_divergence`: \"\" | \"Ahead\" | \"Behind\" | \"Diverged\"+- `working_tree`: object with booleans+ - `untracked`: boolean - untracked files present+ - `modified`: boolean - unstaged changes+ - `staged`: boolean - staged changes+ - `renamed`: boolean - renamed files+ - `deleted`: boolean - deleted files+- `user_status`: string (optional) - custom status from git config++**`status_symbols` (display symbols for rendering):**+- `branch_state`: \"\" | \"=\" | \"≠\" | \"≡\" | \"∅\"+- `git_operation`: \"\" | \"↻\" | \"⋈\"+- `main_divergence`: \"\" | \"↑\" | \"↓\" | \"↕\"+- `upstream_divergence`: \"\" | \"⇡\" | \"⇣\" | \"⇅\"+- `working_tree`: string - combination of \"?!+»✘\"+- `user_status`: string (optional) - same as status.user_status**Query examples:**# Find worktrees with conflicts- jq '.[] | select(.type == \"worktree\" and .status_symbols.has_conflicts)'+ jq '.[] | select(.status_symbols.status.branch_state == \"Conflicts\")'- # Find worktrees with uncommitted changes- jq '.[] | select(.type == \"worktree\" and .working_tree_diff.added > 0)'+ # Find worktrees with untracked files+ jq '.[] | select(.status_symbols.status.working_tree.untracked == true)'# Find worktrees in rebase or merge- jq '.[] | select(.type == \"worktree\" and .status_symbols.git_operation != \"\")'+ jq '.[] | select(.status_symbols.status.git_operation != \"\")'# Get branches ahead of main- jq '.[] | select(.ahead > 0) | {branch: (.branch // .name), ahead}'")]+ jq '.[] | select(.status_symbols.status.main_divergence == \"Ahead\")'")]List {/// Output format#[arg(long, value_enum, default_value = "table")]diff --git a/src/commands/list/collect.rs b/src/commands/list/collect.rsindex ab41019f7..ba8e11ec1 100644--- a/src/commands/list/collect.rs+++ b/src/commands/list/collect.rs@@ -177,14 +177,17 @@ fn determine_worktree_branch_state(/// It will recompute with the latest available data.////// Branches get a subset of status symbols (no working tree, git operation, or worktree attrs).-fn compute_item_status_symbols(item: &mut ListItem, base_branch: Option<&str>) {+fn compute_item_status_symbols(+ item: &mut ListItem,+ base_branch: Option<&str>,+ has_conflicts: bool,+ user_status: Option<String>,+) {// Common fields for both worktrees and brancheslet default_counts = AheadBehind::default();let default_upstream = UpstreamStatus::default();let counts = item.counts.as_ref().unwrap_or(&default_counts);let upstream = item.upstream.as_ref().unwrap_or(&default_upstream);- let has_conflicts = item.has_conflicts.unwrap_or(false);- let user_status = item.user_status.clone();match &item.kind {ItemKind::Worktree(data) => {@@ -295,8 +298,14 @@ fn compute_item_status_symbols(item: &mut ListItem, base_branch: Option<&str>) {fn drain_cell_updates(rx: chan::Receiver<CellUpdate>,worktree_items: &mut [ListItem],- mut on_update: impl FnMut(usize, &mut ListItem),+ mut on_update: impl FnMut(usize, &mut ListItem, bool, Option<String>),) {+ use std::collections::HashMap;++ // Temporary storage for data needed by status_symbols computation+ let mut has_conflicts_map: HashMap<usize, bool> = HashMap::new();+ let mut user_status_map: HashMap<usize, Option<String>> = HashMap::new();+// Process cell updates as they arrivewhile let Ok(update) = rx.recv() {let item_idx = update.item_idx();@@ -332,7 +341,8 @@ fn drain_cell_updates(item_idx,has_conflicts,} => {- worktree_items[item_idx].has_conflicts = Some(has_conflicts);+ // Store temporarily for status_symbols computation+ has_conflicts_map.insert(item_idx, has_conflicts);}CellUpdate::WorktreeState {item_idx,@@ -346,7 +356,8 @@ fn drain_cell_updates(item_idx,user_status,} => {- worktree_items[item_idx].user_status = user_status;+ // Store temporarily for status_symbols computation+ user_status_map.insert(item_idx, user_status);}CellUpdate::Upstream { item_idx, upstream } => {worktree_items[item_idx].upstream = Some(upstream);@@ -361,7 +372,14 @@ fn drain_cell_updates(}// Invoke rendering callback (progressive mode re-renders rows, buffered mode does nothing)- on_update(item_idx, &mut worktree_items[item_idx]);+ let has_conflicts = has_conflicts_map.get(&item_idx).copied().unwrap_or(false);+ let user_status = user_status_map.get(&item_idx).cloned().flatten();+ on_update(+ item_idx,+ &mut worktree_items[item_idx],+ has_conflicts,+ user_status,+ );}}@@ -442,8 +460,6 @@ pub fn collect(branch_diff: None,upstream: None,pr_status: None,- has_conflicts: None,- user_status: None,status_symbols: None,display: super::model::DisplayFields::default(),// Type-specific data@@ -465,8 +481,6 @@ pub fn collect(branch_diff: None,upstream: None,pr_status: None,- has_conflicts: None,- user_status: None,status_symbols: None,display: super::model::DisplayFields::default(),// Type-specific data@@ -643,41 +657,46 @@ pub fn collect(// Drain cell updates with conditional progressive renderinglet base_branch = primary.branch.as_deref();- drain_cell_updates(rx, &mut all_items, |item_idx, info| {- // Compute/recompute status symbols as data arrives (both modes)- // This is idempotent and updates status as new data (like upstream) arrives- // Base branch is None for primary worktree, Some(primary.branch) for others- let item_base_branch = if info.is_primary() { None } else { base_branch };- compute_item_status_symbols(info, item_base_branch);-- // Progressive mode only: update UI- if show_progress {- use anstyle::Style;- let dim = Style::new().dimmed();+ drain_cell_updates(+ rx,+ &mut all_items,+ |item_idx, info, has_conflicts, user_status| {+ // Compute/recompute status symbols as data arrives (both modes)+ // This is idempotent and updates status as new data (like upstream) arrives+ // Base branch is None for primary worktree, Some(primary.branch) for others+ let item_base_branch = if info.is_primary() { None } else { base_branch };+ compute_item_status_symbols(info, item_base_branch, has_conflicts, user_status);++ // Progressive mode only: update UI+ if show_progress {+ use anstyle::Style;+ let dim = Style::new().dimmed();- completed_cells += 1;+ completed_cells += 1;- // Update footer progress- if let Some(pb) = footer_pb.as_ref() {- pb.set_position(completed_cells as u64);- pb.set_message(format!(+ // Update footer progress+ if let Some(pb) = footer_pb.as_ref() {+ pb.set_position(completed_cells as u64);+ pb.set_message(format!("{INFO_EMOJI} {dim}{footer_base} ({completed_cells}/{total_cells} cells loaded){dim:#}"));- }-- // Re-render the row with caching and clamping (now includes status if computed)- if let Some(pb) = progress_bars.get(item_idx) {- let rendered = layout.format_list_item_line(info, current_worktree_path.as_ref());- let clamped = clamp(&rendered);+ }- // Only update if content changed- if clamped != last_lines[item_idx] {- last_lines[item_idx] = clamped.clone();- pb.set_message(clamped);+ // Re-render the row with caching and clamping (now includes status if computed)+ if let Some(pb) = progress_bars.get(item_idx) {+ let rendered =+ layout.format_list_item_line(info, current_worktree_path.as_ref());+ let clamped = clamp(&rendered);++ // Only update if content changed+ if clamped != last_lines[item_idx] {+ last_lines[item_idx] = clamped.clone();+ pb.set_message(clamped);+ }}}- }- });+ },+ );// Finalize progress bars: no clearing race; footer morphs into summary on TTYif show_progress {diff --git a/src/commands/list/layout.rs b/src/commands/list/layout.rsindex 61b91f72f..697eefde5 100644--- a/src/commands/list/layout.rs+++ b/src/commands/list/layout.rs@@ -828,8 +828,6 @@ mod tests {}),upstream: Some(UpstreamStatus::from_parts(Some("origin".to_string()), 4, 2)),pr_status: None,- has_conflicts: Some(false),- user_status: None,status_symbols: Some(StatusSymbols::default()),display: DisplayFields::default(),kind: ItemKind::Worktree(Box::new(WorktreeData {@@ -907,8 +905,6 @@ mod tests {}),upstream: Some(UpstreamStatus::default()),pr_status: None,- has_conflicts: Some(false),- user_status: None,status_symbols: Some(StatusSymbols::default()),display: DisplayFields::default(),kind: ItemKind::Worktree(Box::new(WorktreeData {diff --git a/src/commands/list/model.rs b/src/commands/list/model.rsindex 5612548d8..73eef6e2f 100644--- a/src/commands/list/model.rs+++ b/src/commands/list/model.rs@@ -185,11 +185,6 @@ pub struct ListItem {/// CI/PR status: None = not loaded, Some(None) = no CI, Some(Some(status)) = has CIpub pr_status: Option<Option<PrStatus>>,- #[serde(skip_serializing_if = "Option::is_none")]- pub has_conflicts: Option<bool>,- /// User-defined status from git config- #[serde(skip_serializing_if = "Option::is_none")]- pub user_status: Option<String>,/// Git status symbols - None until all dependencies are ready#[serde(skip_serializing_if = "Option::is_none")]pub status_symbols: Option<StatusSymbols>,@@ -689,28 +684,109 @@ impl StatusSymbols {}}+/// Working tree changes parsed into structured booleans+#[derive(Debug, Clone, serde::Serialize)]+struct WorkingTreeChanges {+ untracked: bool,+ modified: bool,+ staged: bool,+ renamed: bool,+ deleted: bool,+}++impl WorkingTreeChanges {+ fn from_symbols(symbols: &str) -> Self {+ Self {+ untracked: symbols.contains('?'),+ modified: symbols.contains('!'),+ staged: symbols.contains('+'),+ renamed: symbols.contains('»'),+ deleted: symbols.contains('✘'),+ }+ }+}++/// Status variant names (for queryability)+#[derive(Debug, Clone, serde::Serialize)]+struct StatusValues {+ branch_state: &'static str,+ git_operation: &'static str,+ main_divergence: &'static str,+ upstream_divergence: &'static str,+ working_tree: WorkingTreeChanges,+ #[serde(skip_serializing_if = "Option::is_none")]+ user_status: Option<String>,+}++/// Status symbols (for display)+#[derive(Debug, Clone, serde::Serialize)]+struct StatusSymbolsOnly {+ branch_state: String,+ git_operation: String,+ main_divergence: String,+ upstream_divergence: String,+ working_tree: String,+ #[serde(skip_serializing_if = "Option::is_none")]+ user_status: Option<String>,+}+impl serde::Serialize for StatusSymbols {fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>whereS: serde::Serializer,{use serde::ser::SerializeStruct;- let mut state = serializer.serialize_struct("StatusSymbols", 8)?;-- // Convenience boolean - derived from branch_state- let has_conflicts = matches!(- self.branch_state,- BranchState::Conflicts | BranchState::PotentialConflicts- );- state.serialize_field("has_conflicts", &has_conflicts)?;-- state.serialize_field("branch_state", &self.branch_state)?;- state.serialize_field("git_operation", &self.git_operation)?;- state.serialize_field("worktree_attrs", &self.worktree_attrs)?;- state.serialize_field("main_divergence", &self.main_divergence)?;- state.serialize_field("upstream_divergence", &self.upstream_divergence)?;- state.serialize_field("working_tree", &self.working_tree)?;- state.serialize_field("user_status", &self.user_status)?;+ let mut state = serializer.serialize_struct("StatusSymbols", 2)?;++ // Status variant names+ let branch_state_variant = match self.branch_state {+ BranchState::None => "",+ BranchState::Conflicts => "Conflicts",+ BranchState::PotentialConflicts => "PotentialConflicts",+ BranchState::MatchesMain => "MatchesMain",+ BranchState::NoCommits => "NoCommits",+ };++ let git_operation_variant = match self.git_operation {+ GitOperation::None => "",+ GitOperation::Rebase => "Rebase",+ GitOperation::Merge => "Merge",+ };++ let main_divergence_variant = match self.main_divergence {+ MainDivergence::None => "",+ MainDivergence::Ahead => "Ahead",+ MainDivergence::Behind => "Behind",+ MainDivergence::Diverged => "Diverged",+ };++ let upstream_divergence_variant = match self.upstream_divergence {+ UpstreamDivergence::None => "",+ UpstreamDivergence::Ahead => "Ahead",+ UpstreamDivergence::Behind => "Behind",+ UpstreamDivergence::Diverged => "Diverged",+ };++ let status_values = StatusValues {+ branch_state: branch_state_variant,+ git_operation: git_operation_variant,+ main_divergence: main_divergence_variant,+ upstream_divergence: upstream_divergence_variant,+ working_tree: WorkingTreeChanges::from_symbols(&self.working_tree),+ user_status: self.user_status.clone(),+ };++ let status_symbols = StatusSymbolsOnly {+ branch_state: self.branch_state.to_string(),+ git_operation: self.git_operation.to_string(),+ main_divergence: self.main_divergence.to_string(),+ upstream_divergence: self.upstream_divergence.to_string(),+ working_tree: self.working_tree.clone(),+ user_status: self.user_status.clone(),+ };++ state.serialize_field("status", &status_values)?;+ state.serialize_field("status_symbols", &status_symbols)?;state.end()}diff --git a/tests/snapshots/integration__integration_tests__list__json_with_display_fields.snap b/tests/snapshots/integration__integration_tests__list__json_with_display_fields.snapindex 0c2e843be..2134fe9c1 100644--- a/tests/snapshots/integration__integration_tests__list__json_with_display_fields.snap+++ b/tests/snapshots/integration__integration_tests__list__json_with_display_fields.snap@@ -16,7 +16,7 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp5JH1mZ/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp3ZxZaG/test-config.toml---success: trueexit_code: 0@@ -31,16 +31,27 @@ exit_code: 0"upstream_ahead": 0,"upstream_behind": 0,"pr_status": null,- "has_conflicts": false,"status_symbols": {- "has_conflicts": false,- "branch_state": "",- "git_operation": "",- "worktree_attrs": "",- "main_divergence": "",- "upstream_divergence": "",- "working_tree": "",- "user_status": null+ "status": {+ "branch_state": "",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": {+ "untracked": false,+ "modified": false,+ "staged": false,+ "renamed": false,+ "deleted": false+ }+ },+ "status_symbols": {+ "branch_state": "",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": ""+ }},"type": "worktree","path": "[REPO]",@@ -74,16 +85,27 @@ exit_code: 0"upstream_ahead": 0,"upstream_behind": 0,"pr_status": null,- "has_conflicts": false,"status_symbols": {- "has_conflicts": false,- "branch_state": "",- "git_operation": "",- "worktree_attrs": "",- "main_divergence": "↕",- "upstream_divergence": "",- "working_tree": "?!",- "user_status": null+ "status": {+ "branch_state": "",+ "git_operation": "",+ "main_divergence": "Diverged",+ "upstream_divergence": "",+ "working_tree": {+ "untracked": true,+ "modified": true,+ "staged": false,+ "renamed": false,+ "deleted": false+ }+ },+ "status_symbols": {+ "branch_state": "",+ "git_operation": "",+ "main_divergence": "↕",+ "upstream_divergence": "",+ "working_tree": "?!"+ }},"commits_display": "/u001b[32m↑2/u001b[0m /u001b[2m/u001b[31m↓2/u001b[0m","branch_diff_display": "/u001b[32m+1/u001b[0m",@@ -117,16 +139,27 @@ exit_code: 0"upstream_ahead": 0,"upstream_behind": 0,"pr_status": null,- "has_conflicts": false,"status_symbols": {- "has_conflicts": false,- "branch_state": "∅",- "git_operation": "",- "worktree_attrs": "",- "main_divergence": "↓",- "upstream_divergence": "",- "working_tree": "",- "user_status": null+ "status": {+ "branch_state": "NoCommits",+ "git_operation": "",+ "main_divergence": "Behind",+ "upstream_divergence": "",+ "working_tree": {+ "untracked": false,+ "modified": false,+ "staged": false,+ "renamed": false,+ "deleted": false+ }+ },+ "status_symbols": {+ "branch_state": "∅",+ "git_operation": "",+ "main_divergence": "↓",+ "upstream_divergence": "",+ "working_tree": ""+ }},"commits_display": "/u001b[2m/u001b[31m↓2/u001b[0m","type": "worktree",diff --git a/tests/snapshots/integration__integration_tests__list__json_with_metadata.snap b/tests/snapshots/integration__integration_tests__list__json_with_metadata.snapindex fd88ef4fb..269aa821e 100644--- a/tests/snapshots/integration__integration_tests__list__json_with_metadata.snap+++ b/tests/snapshots/integration__integration_tests__list__json_with_metadata.snap@@ -16,7 +16,7 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpg2614S/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpoIbuZx/test-config.toml---success: trueexit_code: 0@@ -31,16 +31,27 @@ exit_code: 0"upstream_ahead": 0,"upstream_behind": 0,"pr_status": null,- "has_conflicts": false,"status_symbols": {- "has_conflicts": false,- "branch_state": "",- "git_operation": "",- "worktree_attrs": "",- "main_divergence": "",- "upstream_divergence": "",- "working_tree": "",- "user_status": null+ "status": {+ "branch_state": "",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": {+ "untracked": false,+ "modified": false,+ "staged": false,+ "renamed": false,+ "deleted": false+ }+ },+ "status_symbols": {+ "branch_state": "",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": ""+ }},"type": "worktree","path": "[REPO]",@@ -74,16 +85,27 @@ exit_code: 0"upstream_ahead": 0,"upstream_behind": 0,"pr_status": null,- "has_conflicts": false,"status_symbols": {- "has_conflicts": false,- "branch_state": "≡",- "git_operation": "",- "worktree_attrs": "",- "main_divergence": "",- "upstream_divergence": "",- "working_tree": "",- "user_status": null+ "status": {+ "branch_state": "MatchesMain",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": {+ "untracked": false,+ "modified": false,+ "staged": false,+ "renamed": false,+ "deleted": false+ }+ },+ "status_symbols": {+ "branch_state": "≡",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": ""+ }},"type": "worktree","path": "[WORKTREE_FEATURE_DETACHED]",@@ -117,16 +139,27 @@ exit_code: 0"upstream_ahead": 0,"upstream_behind": 0,"pr_status": null,- "has_conflicts": false,"status_symbols": {- "has_conflicts": false,- "branch_state": "≡",- "git_operation": "",- "worktree_attrs": "⊠",- "main_divergence": "",- "upstream_divergence": "",- "working_tree": "",- "user_status": null+ "status": {+ "branch_state": "MatchesMain",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": {+ "untracked": false,+ "modified": false,+ "staged": false,+ "renamed": false,+ "deleted": false+ }+ },+ "status_symbols": {+ "branch_state": "≡",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": ""+ }},"type": "worktree","path": "[WORKTREE_LOCKED_FEATURE]",diff --git a/tests/snapshots/integration__integration_tests__list__json_with_user_status.snap b/tests/snapshots/integration__integration_tests__list__json_with_user_status.snapindex adfa3035c..c4b0994cc 100644--- a/tests/snapshots/integration__integration_tests__list__json_with_user_status.snap+++ b/tests/snapshots/integration__integration_tests__list__json_with_user_status.snap@@ -16,7 +16,7 @@ info:LANG: CLC_ALL: CSOURCE_DATE_EPOCH: "1761609600"- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp8q3SVO/test-config.toml+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpQuUWBO/test-config.toml---success: trueexit_code: 0@@ -31,16 +31,27 @@ exit_code: 0"upstream_ahead": 0,"upstream_behind": 0,"pr_status": null,- "has_conflicts": false,"status_symbols": {- "has_conflicts": false,- "branch_state": "",- "git_operation": "",- "worktree_attrs": "",- "main_divergence": "",- "upstream_divergence": "",- "working_tree": "",- "user_status": null+ "status": {+ "branch_state": "",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": {+ "untracked": false,+ "modified": false,+ "staged": false,+ "renamed": false,+ "deleted": false+ }+ },+ "status_symbols": {+ "branch_state": "",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": ""+ }},"type": "worktree","path": "[REPO]",@@ -74,17 +85,29 @@ exit_code: 0"upstream_ahead": 0,"upstream_behind": 0,"pr_status": null,- "has_conflicts": false,- "user_status": "🔧","status_symbols": {- "has_conflicts": false,- "branch_state": "≡",- "git_operation": "",- "worktree_attrs": "",- "main_divergence": "",- "upstream_divergence": "",- "working_tree": "",- "user_status": "🔧"+ "status": {+ "branch_state": "MatchesMain",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": {+ "untracked": false,+ "modified": false,+ "staged": false,+ "renamed": false,+ "deleted": false+ },+ "user_status": "🔧"+ },+ "status_symbols": {+ "branch_state": "≡",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": "",+ "user_status": "🔧"+ }},"type": "worktree","path": "[WORKTREE_WITH_STATUS]",@@ -118,16 +141,27 @@ exit_code: 0"upstream_ahead": 0,"upstream_behind": 0,"pr_status": null,- "has_conflicts": false,"status_symbols": {- "has_conflicts": false,- "branch_state": "≡",- "git_operation": "",- "worktree_attrs": "",- "main_divergence": "",- "upstream_divergence": "",- "working_tree": "",- "user_status": null+ "status": {+ "branch_state": "MatchesMain",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": {+ "untracked": false,+ "modified": false,+ "staged": false,+ "renamed": false,+ "deleted": false+ }+ },+ "status_symbols": {+ "branch_state": "≡",+ "git_operation": "",+ "main_divergence": "",+ "upstream_divergence": "",+ "working_tree": ""+ }},"type": "worktree","path": "[WORKTREE_WITHOUT_STATUS]",