feat: auto-name tabs from Claude Code conversation content
Closed
HO
8mo ago+281+281+012345678901234567890123456789-22-22-01234567890123456789
Summary
- Auto-generates tab titles from Claude Code conversation content using keyword frequency extraction
- Runs in the existing
claude-hook stophandler with zero additional latency (transcript is already being read) - Supports multilingual conversations (CJK + Latin tokenization)
- Respects user
/rename— if a custom title exists in the transcript, auto-naming is skipped
Motivation
Currently, cmux tabs running Claude Code sessions show generic names (e.g., the shell command or directory). When working with multiple Claude Code sessions across tabs, it's hard to distinguish which tab is doing what without manually /rename-ing each one.
This change automatically extracts meaningful keywords from user messages in the Claude Code transcript and uses them as the tab title. For example, a conversation about "debugging cmux hooks" would auto-name the tab something like "cmux hooks debugging".
How it works
readTranscriptSummarynow also extracts the first 3 and last 3 user messages (in addition to the existinglastAssistantMessage)generateTabTitleuses regex-based tokenization to extract CJK runs and Latin words, filters stop words (English + Chinese), and picks the top keywords by frequency- The title is capped at 25 characters and 2-5 words
- If the user has
/renamed the session (detected viacustom-titleentries in the transcript JSONL), auto-naming is completely skipped
Design decisions
| Decision | Rationale |
|---|---|
| Keyword extraction vs AI summary | Zero latency, no external API dependency, runs in the synchronous hook path |
| Stop words in EN + ZH | Most cmux users are English or Chinese speakers based on repo demographics |
| First 3 + last 3 user messages | Captures both the initial topic and recent focus shifts |
| 25 char / 5 word limit | Fits comfortably in the cmux sidebar tab width |
| Skip on custom-title | User intent should always take precedence over auto-generated names |
Test plan
- Verify tab auto-names after first Claude Code response in a cmux terminal
- Verify
/renamecustom title is preserved (auto-naming skipped) - Verify CJK conversation generates CJK tab title
- Verify English conversation generates English tab title
- Verify existing notification behavior is unchanged
Summary by cubic
Automatically names Claude Code tabs from recent conversation keywords so you can tell sessions apart. Also stabilizes UI test launch and fixes portal geometry after window restore.
-
New Features
- Generates short tab titles from the first/last user messages using keyword frequency.
- Runs in the existing
claude-hook stophandler with no added latency; supports CJK and Latin. - Skips auto-naming if a
/renamecustom title is found in the transcript.
-
Bug Fixes
- Resyncs terminal portal geometry after restore-time bind so queued layout shifts (sidebar/splits) don’t leave stale hit-targets.
- Improves UI test reliability: retries app activation on launch and re-runs the display resolution UI test in CI on the known activation flake.
Summary by CodeRabbit
-
New Features
- Tabs automatically rename based on conversation content when transcripts are available and no custom title is set.
-
Tests
- Improved CI test reliability with retry logic for UI tests.
- Enhanced UI test window stabilization during launch.