From de0c5ecf0add78987b58f42c0cbce8f72a3f639e Mon Sep 17 00:00:00 2001 From: Paul O'Reilly Date: Wed, 9 Sep 2026 11:54:18 +1200 Subject: [PATCH] feat(status): mirror topic into tmux status bar set-topic.sh now renames the tmux session to the project part of the topic and stores the full topic in @claude_topic when run inside tmux. Pairs with ~/.tmux.conf status-right showing #{@claude_topic}. Claude-Session: https://claude.ai/code/session_01Xt2b3uQtakYGhH5Y653vwd --- scripts/set-topic.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/set-topic.sh b/scripts/set-topic.sh index 5ad4c1e..cacc150 100755 --- a/scripts/set-topic.sh +++ b/scripts/set-topic.sh @@ -11,6 +11,16 @@ TOPIC="$*" HASH=$(echo -n "$CWD" | md5sum | cut -d' ' -f1) SESSION_FILE="/tmp/claude-session-id-$HASH" +# If running inside tmux, mirror the topic into the tmux status bar: +# session name = project part (before ':'), @claude_topic = full topic. +if [[ -n "${TMUX:-}" ]]; then + PROJECT="${TOPIC%%:*}" + # tmux session names may not contain ':' or '.' + PROJECT=$(echo "$PROJECT" | tr ':.' '--' | cut -c1-30) + tmux rename-session "$PROJECT" 2>/dev/null || true + tmux set -q @claude_topic "$TOPIC" 2>/dev/null || true +fi + if [[ ! -f "$SESSION_FILE" ]]; then # Session ID file doesn't exist yet — the statusline hook hasn't run. # Write the topic to a pending file so statusline.sh can pick it up