Displays the current worktree session ID or branch name in the
Claude Code status line, making it visible at a glance whether
the session is running in an isolated worktree or on main.
--- /dev/null
+#!/bin/sh
+# Copyright (c) 2026 Jakub Czajka <jakub@ekhem.eu.org>
+# License: GPL-3.0 or later.
+#
+# status-line - Display current session/worktree in the Claude Code prompt.
+
+if echo "$PWD" | grep -q '/worktrees/'; then
+ echo "🌿 $CLAUDE_CODE_SESSION_ID"
+else
+ branch=$(git -C "$PWD" branch --show-current 2>/dev/null)
+ [ -n "$branch" ] && echo "🌿 $branch"
+fi
"GUIX_BIN": "/run/current-system/profile/bin",
"PROFILE": "nonfree"
},
+ "statusLine": {
+ "type": "command",
+ "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/status-line"
+ },
"hooks": {
"PreToolUse": [
{