showSessionName only renders after a manual /rename — fallback reads "slug", but Claude Code now writes "ai-title" entries
Summary
display.showSessionName renders nothing until the user manually runs /rename. The fallback path reads a top-level slug field that current Claude Code no longer writes; the auto-generated session title now arrives as a dedicated {"type":"ai-title","aiTitle":"..."} transcript entry, which the parser ignores.
src/transcript.ts (v0.8.0, lines 558-561 and 760):
if (entry.type === 'custom-title' && typeof entry.customTitle === 'string') {
customTitle = entry.customTitle;
} else if (typeof entry.slug === 'string') {
latestSlug = entry.slug;
}
// ...
result.sessionName = customTitle ?? latestSlug;custom-title is matched as an entry type, but the fallback matches slug as a top-level field — and nothing in a current transcript carries it.
Steps to Reproduce
- Set
display.showSessionName: true - Start a new session and let Claude Code generate its title
- Look at the HUD — no session-name segment
- Run
/rename anything— the segment appears
Expected Behavior
The auto-generated session title shows without requiring a manual /rename.
Actual Behavior
The segment is absent for every session that was never renamed, so showSessionName: true looks like a no-op.
Evidence
Across 203 local transcripts (Claude Code 2.1.259, macOS):
- 89 files contain
{"type":"ai-title","aiTitle":"..."}, spanning 2026-08-04 → 2026-09-03 (i.e. current and still being written) - 2 files contain a top-level
slug, both from 2026-08-08 / 2026-08-10 — and there it is a random word-triple (frolicking-enchanting-pebble,streamed-bubbling-knuth) carried as a field onsystementries, not a dedicated entry type - 53 files contain
{"type":"custom-title","customTitle":"..."}— the only path that currently produces a visible name
Concrete case, a session where the HUD showed no name despite showSessionName: true:
{"type":"ai-title","aiTitle":"Claude-hud session display","sessionId":"8669b86d-..."}After /rename test, the same transcript gained the following, and the segment appeared:
{"type":"custom-title","customTitle":"test","sessionId":"8669b86d-..."}
{"type":"agent-name","agentName":"test","sessionId":"8669b86d-..."}Suggested Fix
Add aiTitle to the fallback chain, keeping slug for older transcripts:
result.sessionName = customTitle ?? aiTitle ?? latestSlug;matched the same way custom-title is (entry.type === 'ai-title' && typeof entry.aiTitle === 'string').
Environment
- OS: macOS 26.6.2
- Bun 1.3.13 (Node v22.22.1 also installed)
- Claude Code version: 2.1.259
- claude-hud: 0.8.0 (same code path in 0.6.0, reproduced on both)
Source: jarrodwatts/claude-hud