From: Jakub Czajka Date: Mon, 6 Jul 2026 08:37:59 +0000 (+0200) Subject: [ai] Add status-line hook showing worktree session in prompt. X-Git-Url: https://git.ekhem.eu.org/?a=commitdiff_plain;h=9d21e4a625f04fe8342f1832821d069f9f154480;p=guix.git [ai] Add status-line hook showing worktree session in prompt. 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. --- diff --git a/.claude/hooks/status-line b/.claude/hooks/status-line new file mode 100755 index 0000000..3475173 --- /dev/null +++ b/.claude/hooks/status-line @@ -0,0 +1,12 @@ +#!/bin/sh +# Copyright (c) 2026 Jakub Czajka +# 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 diff --git a/.claude/settings.json b/.claude/settings.json index dc5acb1..2c30fb5 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -3,6 +3,10 @@ "GUIX_BIN": "/run/current-system/profile/bin", "PROFILE": "nonfree" }, + "statusLine": { + "type": "command", + "command": "${CLAUDE_PROJECT_DIR}/.claude/hooks/status-line" + }, "hooks": { "PreToolUse": [ {