claude-code - 💡(How to fix) Fix [DOCS] Status line docs missing `workspace.git_worktree` field [1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45466Fetched 2026-04-09 08:04:47
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2
RAW_BUFFERClick to expand / collapse

Documentation Type

Missing documentation (feature not documented)

Documentation Location

https://code.claude.com/docs/en/statusline

Section/Topic

Available data and Full JSON schema

Current Documentation

The status line reference currently documents these workspace and worktree-related fields:

| cwd, workspace.current_dir | Current working directory. Both fields contain the same value; workspace.current_dir is preferred for consistency with workspace.project_dir. | | workspace.project_dir | Directory where Claude Code was launched, which may differ from cwd if the working directory changes during a session | | workspace.added_dirs | Additional directories added via /add-dir or --add-dir. Empty array if none have been added | ... | worktree.name | Name of the active worktree. Present only during --worktree sessions | | worktree.path | Absolute path to the worktree directory |

The same page's example schema shows:

"workspace": { "current_dir": "/current/working/directory", "project_dir": "/original/project/directory", "added_dirs": [] }, ... "worktree": { "name": "my-feature", "path": "/path/to/.claude/worktrees/my-feature", "branch": "worktree-my-feature", "original_cwd": "/path/to/project", "original_branch": "main" }

No documentation currently exists for workspace.git_worktree.

What's Wrong or Missing?

Claude Code v2.1.97 added workspace.git_worktree to the status line JSON input when the current directory is inside a linked git worktree, but the status line docs do not mention this field anywhere.

That leaves status line authors without reference documentation for:

  • when workspace.git_worktree appears
  • what value shape/type it has
  • how it differs from the existing top-level worktree object, which the docs currently describe as appearing only during --worktree sessions

Suggested Improvement

Add workspace.git_worktree to the Available data table and the Full JSON schema example on https://code.claude.com/docs/en/statusline.

The update should document:

  • when the field is present or absent
  • its exact type/value shape
  • how it relates to linked git worktrees
  • how it differs from worktree.*, which is currently documented as --worktree-session metadata

Impact

Medium - Makes feature difficult to understand

Additional Context

Affected Pages:

PageContext
https://code.claude.com/docs/en/statuslineStatus line field reference and example JSON schema both omit workspace.git_worktree
https://code.claude.com/docs/en/common-workflowsGit worktree behavior is documented here, so this page is a useful cross-reference for explaining the new field

Total scope: 2 pages affected

Source: Changelog v2.1.97

Changelog entry: Added workspace.git_worktree to the status line JSON input, set when the current directory is inside a linked git worktree

extent analysis

TL;DR

Add documentation for the workspace.git_worktree field to the status line reference and example JSON schema on the affected pages.

Guidance

  • Review the changelog entry for v2.1.97 to understand the purpose and behavior of the workspace.git_worktree field.
  • Update the Available data table on the status line documentation page to include workspace.git_worktree, describing when it appears, its value shape/type, and its relation to linked git worktrees.
  • Modify the Full JSON schema example on the same page to include workspace.git_worktree and illustrate its structure.
  • Cross-reference the common-workflows page to provide additional context for git worktree behavior and the new field.

Notes

The suggested improvement should focus on documenting the workspace.git_worktree field's presence, type, and relationship to linked git worktrees, as well as its distinction from the existing worktree object.

Recommendation

Apply workaround by adding the missing documentation for workspace.git_worktree to the affected pages, ensuring that status line authors have the necessary reference information.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING