aboutsummaryrefslogtreecommitdiff
path: root/.claude
diff options
context:
space:
mode:
Diffstat (limited to '.claude')
-rw-r--r--.claude/settings.json4
-rwxr-xr-x.claude/statusline-command.sh27
2 files changed, 31 insertions, 0 deletions
diff --git a/.claude/settings.json b/.claude/settings.json
index 2e37bc6..3b8b237 100644
--- a/.claude/settings.json
+++ b/.claude/settings.json
@@ -1,4 +1,8 @@
{
+ "statusLine": {
+ "type": "command",
+ "command": "~/.claude/statusline-command.sh"
+ },
"skillListingBudgetFraction": 0.05,
"attribution": {
"commit": "",
diff --git a/.claude/statusline-command.sh b/.claude/statusline-command.sh
new file mode 100755
index 0000000..3e5e6fb
--- /dev/null
+++ b/.claude/statusline-command.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Claude Code status line — mirrors the zsh prompt from ~/.zshrc
+# PROMPT: [%D %*] $WHO $HOST:${PWD/#$HOME/~} %(?..[%?] )$NEWLINE%#
+# RPROMPT: ${vcs_info_msg_0_} (format: "on %b")
+#
+# Wired via the statusLine entry in .claude/settings.json; make install
+# symlinks this file to ~/.claude/statusline-command.sh on every machine.
+
+input=$(cat)
+
+cwd=$(echo "$input" | jq -r '.cwd')
+# Replace $HOME prefix with ~. The replacement tilde must be escaped:
+# unquoted, bash tilde-expands it straight back to $HOME.
+home="$HOME"
+display_dir="${cwd/#$home/\~}"
+
+# Git branch from cwd (mirrors vcs_info RPROMPT "on %b")
+branch=$(git -C "$cwd" symbolic-ref --short HEAD 2>/dev/null)
+git_part=""
+[ -n "$branch" ] && git_part=" on $branch"
+
+date_part=$(date "+%y-%m-%d %H:%M:%S")
+user_part=$(whoami)
+# uname -n, not hostname: Arch doesn't ship hostname by default (inetutils).
+host_part=$(uname -n)
+
+printf "%s %s %s:%s%s" "[$date_part]" "$user_part" "$host_part" "$display_dir" "$git_part"