cmux-next: session side rail behind Labs (Environment, Context, Outputs) (cx-ncc.101)
Leo asked for Claude Code desktop's session side rail in cmux NEXT, as a Labs flag and for every harness. This adds it behind labs.sessionRail (off by default; Help > Labs…). The reference is in the private screenshots repo, references/claude-code-desktop-2026-10-14/ (video 5).
Stacked on #20452 (the Labs registry). This branch has #20452 merged in, so the diff includes it until #20452 lands.
What it does
With the flag on, a Session details button in the chat header shows a rail beside the chat. It's an in-page column like the side preview, about a quarter of the width, and lies over the chat under 720 px. Cards, in the reference's order:
- Environment (open): where the session runs (this Mac by name, or the remote/Cloud host, the same rule as the composer's computer chip), then the session's folder as "name · ~/parent", its worktree if different, and its branch.
- Context (folded): the share of the context window used, as a percent and a small bar, from the session's usage updates. Open, it shows "used of size tokens". Before the agent reports usage it shows "—" and doesn't fold open.
- Outputs (open): the files the session created or changed, with +/- counts. A click opens that file's diff through the existing open-output path (beside the chat, else in place). With none: "No files changed yet".
It reads only acpmux's common session summary and rows, never one harness's fields. Left out:
- Connectors: acpmux doesn't report a session's MCP servers yet; follow-up cx-ncc.105.
- Remote Control: Claude-only, so it stays out (Leo).
With the flag off, nothing changes: no button, no rail.
Verification
heavy --mem 4G bun test test/session-rail.test.tsx: red at bda5ec3 (the rail module didn't exist), green at a157773 (3 pass, 23 expects). The test opens the rail with the flag on, checks the place and folder rows, the Context percent, and that clicking an output calls the diff opener with its path; with the flag off there is no button and no rail.- ui-rules, gallery-coverage, theme-colors and the chat-header tests pass locally, with one exception: theme-colors fails on
newtab/screen.css.nt-lab-switch(#fff), which comes from #20452, not this PR. vp fmt, oxlint, type-scale, layers, system-blue, text-focus andgen-strings --check agentPanepass.- Settings exports regenerated on the fleet (exclusive class) for the new flag, at 1198633.
- Strings: six
rail.*keys in the pane catalog (21 locales), and the flag's title and help in the settings catalog (21 locales). - Real-app captures, light and dark: in progress; added here before merge.
Changelog
Added: A Labs session side rail shows a chat's environment, context use and changed files beside the chat.
🤖 Generated with Claude Code
Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Adds Claude Code desktop's session side rail to the agent chat behind the new labs.sessionRail flag, alongside the Labs flag registry that opt-in features now ship through.
- With the flag on, a header toggle opens a rail beside the chat with Environment (machine, folder, worktree, branch), Context (share of the context window used), and Outputs (files the session changed; clicking opens the diff). It reads only acpmux's common session summary, so it works across harnesses. With the flag off, there is no button or rail. A capture-driven pass fixed rail card sizing, truncated folder paths, a distinct rail icon, and the narrow overlay closing over the chat when a diff split narrowed the pane.
- Flags are defined in
schemas/settings/source/labs.jsonand generated into Swift and TS. They are agent-settable, listed in Settings > Experimental > Labs, and searchable in the palette via Help > Labs… (renamed from Feature Flags). Nightly and dev builds also get Labs toggles on the New Tab page. - This branch includes the registry PR (#20452) merged in.