fix(claude): propagate mid-session titles to zellij tab names #573

Merged
lytedev merged 1 commit from claude-zellij-tab-titles into main 2026-06-10 14:49:23 -05:00
Owner

Claude Code only includes session_title in SessionStart hook payloads, so a title set mid-session (auto-naming or /rename) never reached claude-hook and the zellij tab stayed on the project:petname fallback until the next --resume.

Fix: fall back to the most recent custom-title entry in the transcript (transcript_path is present in every hook payload), so renames propagate to the tab on the next hook event. Also clean up the session state file written under the old name when a session's name changes, so renames no longer leave phantom sessions in ~/.local/state/claude/sessions/.

Verified live: ran the modified script against a running session with a synthetic UserPromptSubmit payload — the containing zellij tab renamed from nixos:enchanting-crane to the session's actual title nix:claude-zellij. Shellcheck passes (writeShellApplication will also enforce this at build).

🤖 Generated with Claude Code

Claude Code only includes `session_title` in SessionStart hook payloads, so a title set mid-session (auto-naming or `/rename`) never reached `claude-hook` and the zellij tab stayed on the `project:petname` fallback until the next `--resume`. Fix: fall back to the most recent `custom-title` entry in the transcript (`transcript_path` is present in every hook payload), so renames propagate to the tab on the next hook event. Also clean up the session state file written under the old name when a session's name changes, so renames no longer leave phantom sessions in `~/.local/state/claude/sessions/`. Verified live: ran the modified script against a running session with a synthetic UserPromptSubmit payload — the containing zellij tab renamed from `nixos:enchanting-crane` to the session's actual title `nix:claude-zellij`. Shellcheck passes (writeShellApplication will also enforce this at build). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(claude): propagate mid-session titles to zellij tab names
All checks were successful
/ check-format (push) Successful in 1m50s
/ build (push) Successful in 39m28s
1bac217678
Claude only includes session_title in SessionStart hook payloads, so a
title set mid-session (auto-naming or /rename) never reached the hook
and the zellij tab stayed on the project:petname fallback until the
next --resume.

Fall back to the most recent custom-title entry in the transcript
(transcript_path is in every hook payload), so renames land on the next
hook event. Also clean up the session state file written under the old
name when the name changes, so renames don't leave phantom sessions.
lytedev changed title from WIP: fix(claude): propagate mid-session titles to zellij tab names to fix(claude): propagate mid-session titles to zellij tab names 2026-06-10 13:51:42 -05:00
lytedev force-pushed claude-zellij-tab-titles from 1bac217678
All checks were successful
/ check-format (push) Successful in 1m50s
/ build (push) Successful in 39m28s
to 50253323cc
All checks were successful
/ check-format (push) Successful in 7s
/ build (push) Successful in 5m59s
2026-06-10 13:51:47 -05:00
Compare
lytedev force-pushed claude-zellij-tab-titles from 50253323cc
All checks were successful
/ check-format (push) Successful in 7s
/ build (push) Successful in 5m59s
to d2c63fb00d
All checks were successful
/ check-format (push) Successful in 9s
/ build (push) Successful in 14s
2026-06-10 14:43:43 -05:00
Compare
lytedev scheduled this pull request to auto merge when all checks succeed 2026-06-10 14:43:47 -05:00
lytedev deleted branch claude-zellij-tab-titles 2026-06-10 14:49:23 -05:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lytedev/nix!573
No description provided.