Skip to content

Instantly share code, notes, and snippets.

@nchudleigh
Created January 13, 2026 21:04
Show Gist options
  • Select an option

  • Save nchudleigh/fe8dab7d27d93b99030cd6525d7a6af8 to your computer and use it in GitHub Desktop.

Select an option

Save nchudleigh/fe8dab7d27d93b99030cd6525d7a6af8 to your computer and use it in GitHub Desktop.
Claude Code custom status line - shows model, directory, git branch, diff stats, and time
#!/bin/bash
input=$(cat)
MODEL=$(echo "$input" | jq -r '.model.display_name')
DIR=$(echo "$input" | jq -r '.workspace.current_dir')
# Git info
BRANCH=$(git branch --show-current 2>/dev/null)
GIT_INFO=""
if [ -n "$BRANCH" ]; then
GIT_INFO="$BRANCH"
# Get diff stats (+/-)
STATS=$(git diff --shortstat 2>/dev/null)
if [ -n "$STATS" ]; then
ADDS=$(echo "$STATS" | grep -oE '[0-9]+ insertion' | grep -oE '[0-9]+')
DELS=$(echo "$STATS" | grep -oE '[0-9]+ deletion' | grep -oE '[0-9]+')
[ -n "$ADDS" ] || ADDS="0"
[ -n "$DELS" ] || DELS="0"
[ "$ADDS" != "0" ] || [ "$DELS" != "0" ] && GIT_INFO="$GIT_INFO | +$ADDS/-$DELS"
fi
fi
# Time with am/pm
TIME=$(date +"%I:%M %p")
echo "[$MODEL] ${DIR##*/}${GIT_INFO:+ | $GIT_INFO} | $TIME"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment