Skip to content

Instantly share code, notes, and snippets.

@SelrahcD
Last active November 20, 2025 13:11
Show Gist options
  • Select an option

  • Save SelrahcD/71cbc0637525b04bdce17fbe36d812ac to your computer and use it in GitHub Desktop.

Select an option

Save SelrahcD/71cbc0637525b04bdce17fbe36d812ac to your computer and use it in GitHub Desktop.
Claude Code Status Line - robbyrussell Theme

Claude Code Status Line - robbyrussell Theme

A beautiful status line for Claude Code that mimics the popular robbyrussell Oh My Zsh theme.

Features

  • πŸ€– Robot emoji prefix
  • Bold green arrow (➜)
  • Cyan directory name
  • Git branch information with bold blue prefix and red branch name
  • Exact color matching to robbyrussell theme

Preview

When in a git repository:

πŸ€– ➜ project git:(main)

When not in a git repository:

πŸ€– ➜ project

Installation

Quick Install (One-Liner)

curl -fsSL https://gist.githubusercontent.com/Selrahcd/71cbc0637525b04bdce17fbe36d812ac/raw/install.sh | bash

Manual Installation

  1. Create the .claude directory if it doesn't exist:
mkdir -p ~/.claude
  1. Download the status line script:
curl -o ~/.claude/statusline.sh https://gist.githubusercontent.com/Selrahcd/71cbc0637525b04bdce17fbe36d812ac/raw/statusline.sh
chmod +x ~/.claude/statusline.sh
  1. Update your Claude Code settings:

Open ~/.claude/settings.json and add or update the statusLine configuration:

{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh",
    "padding": 0
  }
}

If you don't have a settings.json file yet, create it with:

cat > ~/.claude/settings.json << 'EOF'
{
  "statusLine": {
    "type": "command",
    "command": "~/.claude/statusline.sh",
    "padding": 0
  }
}
EOF

Requirements

  • jq - JSON processor (used to parse Claude Code's JSON input)
  • git - For displaying branch information

Install jq if you don't have it:

macOS:

brew install jq

Linux (Debian/Ubuntu):

sudo apt-get install jq

Linux (Fedora):

sudo dnf install jq

Customization

You can customize the colors by editing ~/.claude/statusline.sh. The color codes used are:

  • \033[1;32m - Bold Green (arrow)
  • \033[0;36m - Cyan (directory)
  • \033[1;34m - Bold Blue (git prefix)
  • \033[0;31m - Red (branch name)
  • \033[0;33m - Yellow (not currently used)
  • \033[0;35m - Magenta (not currently used)

Uninstallation

To remove the status line:

  1. Delete the script:
rm ~/.claude/statusline.sh
  1. Remove or comment out the statusLine configuration in ~/.claude/settings.json

License

MIT

Credits

Inspired by the robbyrussell Oh My Zsh theme

#!/bin/bash
set -e
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
RESET='\033[0m'
echo -e "${BLUE}Claude Code Status Line Installer${RESET}"
echo "=================================="
echo ""
# Check for jq
if ! command -v jq &> /dev/null; then
echo -e "${YELLOW}Warning: jq is not installed.${RESET}"
echo "The status line requires jq to parse JSON."
echo ""
echo "Install it with:"
echo " macOS: brew install jq"
echo " Ubuntu: sudo apt-get install jq"
echo " Fedora: sudo dnf install jq"
echo ""
read -p "Continue anyway? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
exit 1
fi
fi
# Create .claude directory
echo -e "${GREEN}Creating ~/.claude directory...${RESET}"
mkdir -p ~/.claude
# Download statusline.sh
echo -e "${GREEN}Downloading statusline.sh...${RESET}"
curl -fsSL "https://gist.githubusercontent.com/Selrahcd/71cbc0637525b04bdce17fbe36d812ac/raw/statusline.sh" -o ~/.claude/statusline.sh
# Make it executable
chmod +x ~/.claude/statusline.sh
echo -e "${GREEN}βœ“ Status line script installed${RESET}"
# Handle settings.json
SETTINGS_FILE=~/.claude/settings.json
if [ -f "$SETTINGS_FILE" ]; then
echo -e "${YELLOW}Found existing settings.json${RESET}"
# Check if statusLine already exists
if grep -q '"statusLine"' "$SETTINGS_FILE"; then
echo -e "${YELLOW}statusLine configuration already exists in settings.json${RESET}"
echo "Current configuration will be replaced."
read -p "Continue? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo -e "${BLUE}Status line script installed but settings.json not updated.${RESET}"
echo "You can manually add this to your settings.json:"
echo ""
echo ' "statusLine": {'
echo ' "type": "command",'
echo ' "command": "~/.claude/statusline.sh",'
echo ' "padding": 0'
echo ' }'
exit 0
fi
# Remove existing statusLine config
TMP_FILE=$(mktemp)
jq 'del(.statusLine)' "$SETTINGS_FILE" > "$TMP_FILE"
mv "$TMP_FILE" "$SETTINGS_FILE"
fi
# Add new statusLine config
echo -e "${GREEN}Updating settings.json...${RESET}"
TMP_FILE=$(mktemp)
jq '. + {"statusLine": {"type": "command", "command": "~/.claude/statusline.sh", "padding": 0}}' "$SETTINGS_FILE" > "$TMP_FILE"
mv "$TMP_FILE" "$SETTINGS_FILE"
else
echo -e "${GREEN}Creating settings.json...${RESET}"
cat > "$SETTINGS_FILE" << 'EOF'
{
"statusLine": {
"type": "command",
"command": "~/.claude/statusline.sh",
"padding": 0
}
}
EOF
fi
echo ""
echo -e "${GREEN}βœ“ Installation complete!${RESET}"
echo ""
echo "Restart Claude Code to see your new status line."
echo ""
echo "Preview:"
echo " πŸ€– ➜ project git:(main)"
echo ""
echo "To customize colors, edit: ~/.claude/statusline.sh"
#!/bin/bash
# Read JSON input from stdin
input=$(cat)
# ANSI color codes (exact robbyrussell theme colors)
BOLD_GREEN='\033[1;32m'
CYAN='\033[0;36m'
BOLD_BLUE='\033[1;34m'
RED='\033[0;31m'
YELLOW='\033[0;33m'
MAGENTA='\033[0;35m'
RESET='\033[0m'
# Extract current directory from JSON
current_dir=$(echo "$input" | jq -r '.workspace.current_dir // ""')
dir=$(basename "$current_dir")
# Get git branch
branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
# Format: ➜ directory git:(branch)
# Colors match robbyrussell: bold green arrow, cyan directory, bold blue git prefix with red branch
if [ -n "$branch" ]; then
echo -e "πŸ€– ${BOLD_GREEN}➜${RESET} ${CYAN}${dir}${RESET} ${BOLD_BLUE}git:(${RED}${branch}${BOLD_BLUE})${RESET}"
else
echo -e "πŸ€– ${BOLD_GREEN}➜${RESET} ${CYAN}${dir}${RESET}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment