Claude Code
gmux has built-in support for Claude Code. No configuration is needed — launch Claude Code through gmux and everything works automatically.
What you get
Section titled “What you get”Live status
Section titled “Live status”The sidebar shows when Claude Code is actively working. gmux detects user and assistant messages in the session file — a user message sets the status to working (pulsing cyan dot), and a completed assistant response clears it.
Session titles
Section titled “Session titles”Instead of showing “claude” for every session, gmux extracts a meaningful title:
▼ ~/dev/myapp ● Fix the auth bug in login.go ● Add pagination to the API ○ Refactor database layerTitle priority:
- Claude Code’s auto-generated title (the
custom-titleentry in the session file) - The text of your first message
- “(new)” if there are no messages yet
Resumable sessions
Section titled “Resumable sessions”When a Claude Code session exits, it remains in the sidebar as a resumable entry. Click it to resume — gmux launches claude --resume <session-id>.
Resumable sessions are deduplicated: if you’re already running a session that matches a resumable entry, only the live one appears.
Launch from the UI
Section titled “Launch from the UI”Claude Code appears in the launch menu only when the claude binary is on PATH. gmuxd checks this at startup; if not found, the Claude Code launcher is omitted from the UI.
How it works
Section titled “How it works”Detection
Section titled “Detection”- Availability discovery in
gmuxd:LookPath("claude")at startup - Runtime matching in
gmux: scan the launched command for aclaudebinary name
The runtime matching works with direct invocation, full paths, and wrappers:
gmux claude # ✓ matchedgmux /usr/bin/claude # ✓ matchedgmux env claude # ✓ matchedgmux echo "not claude" # ✗ not matchedIf detection fails, override it:
GMUX_ADAPTER=claude gmux my-claude-wrapperSession files
Section titled “Session files”Claude Code stores conversations as JSONL files in ~/.claude/projects/. Each working directory gets its own subfolder with an encoded name — / and . are replaced with -:
~/.claude/projects/ -home-mg-dev-myapp/ a1b2c3d4-e5f6-7890-abcd-ef1234567890.jsonl f9e8d7c6-b5a4-3210-fedc-ba0987654321.jsonl -home-mg--local-share-chezmoi/ 1192413d-098c-47d5-9cae-8f622ad29463.jsonlNote the double dash in -home-mg--local-share-chezmoi — that’s because /home/mg/.local has a dot that also becomes a dash.
gmuxd watches these directories and reads the files to populate the sidebar. Each line in the file is a JSON object with a type field (user, assistant, system, custom-title, etc.).
Status detection
Section titled “Status detection”gmux watches the session file (not PTY output) for status signals:
| File event | Sidebar effect |
|---|---|
type: "user" line appended | Working (cyan dot) — assistant will respond |
type: "assistant" with only text content | Idle (dot clears) — turn complete |
type: "assistant" with tool_use content | Still working — tool execution in progress |
type: "custom-title" line appended | Title updates to the generated title |
This approach avoids the flickering that would result from parsing Claude Code’s TUI spinner output.
Limitations
Section titled “Limitations”- Status has one-message granularity. gmux marks the session as working after a user message and idle after a text-only assistant message. It doesn’t distinguish between “thinking”, “writing code”, or “running a tool” — all are shown as “working”.
- File creation timing. Claude Code writes to the session file in real time, so there’s no significant delay for initial title or status.
- Multi-instance attribution. If you run two Claude Code sessions in the same directory, gmuxd uses content matching to attribute files. This works well in practice but has a one-write delay for initial attribution.