Summary
Show the active session's cwd, the enclosing git worktree (when different from the cwd), and the current git branch in a small status strip at the bottom of the session view (below the message list, above or alongside the composer).
The existing status bar at the top of the session shows the session title and connection state. It doesn't tell you where the agent actually is on disk or which branch is checked out — information that is critical when you have many concurrent sessions across different repos / worktrees / branches.
Why this matters
- Many sessions, many checkouts. Power users keep multiple worktrees per repo (one per in-flight feature/PR). A glance at the bottom of the screen should answer "which worktree and which branch is this session driving right now?" without running
pwd / git branch in a tool call.
- Branch context drives intent. A session on
main is usually for reading; a session on feat/<x> is usually for writing. Surfacing the branch makes the current intent obvious and reduces "wait, did I commit to the wrong branch?" mistakes.
- Cross-checks the session metadata. The session row in the drawer shows the
cwd it was created in. The agent's active cwd can drift (the agent itself can cd into a sibling directory mid-session). The status strip should reflect the live state, not the create-time cwd, so it stays honest.
- Click-through. A nice side benefit: clicking the path could open it in a file manager / terminal, and clicking the branch could open the PR (when
gh / origin metadata is available). Out of scope for the first cut, but worth designing the strip to allow it.
Proposed UX
A single-line strip at the bottom edge of the session view, inside the composer column:
📁 ~/code/<repo>/<worktree>
🌿 feat/<branch-name> ↗ #123 ← branch + linked PR (optional)
- Cwd: show the active cwd, with a tilde-collapsed path. Truncate the middle of long paths (head + tail), full path on hover.
- Worktree: if the active cwd is inside a
git worktree distinct from the main repo path, show the worktree's directory name. Otherwise show only the cwd.
- Branch: show the current branch with a
git-branch icon. If the working tree is dirty, append a small dot/marker. If HEAD is detached, show detached @ <sha7>.
- Optional PR link: when the upstream remote is GitHub (
origin matches …github.com…) and a PR exists for the branch, render it as a small ↗ #N chip linking to the PR. Best-effort; skip silently when offline / not GitHub / no PR.
- Empty state: when the session is detached from any cwd (e.g. brand-new session before first message), show a muted "no working directory" hint rather than blank.
Where it would live
- New module:
src/status/repoInfoBar.ts (or src/composer/repoInfoBar.ts since it sits above the composer).
- New CSS:
src/styles/repoInfoBar.css, hooked into the existing app grid.
- Server-side helper to extract
{ cwd, worktreePath, branch, isDirty, headSha, prUrl? } for a given cwd. Use plain git CLI calls; no extra deps. Cache per-cwd with a short TTL since the user can switch sessions rapidly.
- Live updates via the existing realtime channel: emit a
repo_info_changed event when the active session's cwd or branch changes.
Non-goals
- Editing branches / running git commands from the bar. Read-only display.
- Showing diff stats, ahead/behind, stash count. Could come later behind a hover popover.
- Replacing the top status bar's session title — they coexist.
Acceptance criteria
Summary
Show the active session's cwd, the enclosing git worktree (when different from the cwd), and the current git branch in a small status strip at the bottom of the session view (below the message list, above or alongside the composer).
The existing status bar at the top of the session shows the session title and connection state. It doesn't tell you where the agent actually is on disk or which branch is checked out — information that is critical when you have many concurrent sessions across different repos / worktrees / branches.
Why this matters
pwd/git branchin a tool call.mainis usually for reading; a session onfeat/<x>is usually for writing. Surfacing the branch makes the current intent obvious and reduces "wait, did I commit to the wrong branch?" mistakes.cwdit was created in. The agent's active cwd can drift (the agent itself cancdinto a sibling directory mid-session). The status strip should reflect the live state, not the create-timecwd, so it stays honest.gh/ origin metadata is available). Out of scope for the first cut, but worth designing the strip to allow it.Proposed UX
A single-line strip at the bottom edge of the session view, inside the composer column:
git worktreedistinct from the main repo path, show the worktree's directory name. Otherwise show only the cwd.git-branchicon. If the working tree is dirty, append a small dot/marker. IfHEADis detached, showdetached @ <sha7>.originmatches…github.com…) and a PR exists for the branch, render it as a small↗ #Nchip linking to the PR. Best-effort; skip silently when offline / not GitHub / no PR.Where it would live
src/status/repoInfoBar.ts(orsrc/composer/repoInfoBar.tssince it sits above the composer).src/styles/repoInfoBar.css, hooked into the existing app grid.{ cwd, worktreePath, branch, isDirty, headSha, prUrl? }for a given cwd. Use plaingitCLI calls; no extra deps. Cache per-cwd with a short TTL since the user can switch sessions rapidly.repo_info_changedevent when the active session's cwd or branch changes.Non-goals
Acceptance criteria