Loading...
Oh-My-Zsh robbyrussell theme replica with iconic arrow prompt, Git status indicators, and directory path for seamless Claude Code shell integration.
#!/usr/bin/env bash
# Oh-My-Zsh Robbyrussell Theme Replica for Claude Code
# Classic robbyrussell prompt: ➜ directory git:(branch) ✗
# Read JSON from stdin
read -r input
# Extract values
dir=$(echo "$input" | jq -r '.workspace.path // "~"' | sed "s|$HOME|~|" | xargs basename)
model=$(echo "$input" | jq -r '.model // "unknown"')
# Git status
git_branch=""
git_dirty=""
if git rev-parse --git-dir > /dev/null 2>&1; then
git_branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
# Check for uncommitted changes
if ! git diff --quiet 2>/dev/null || ! git diff --cached --quiet 2>/dev/null; then
git_dirty="✗"
fi
fi
# Colors (robbyrussell classic palette)
CYAN="\033[38;5;51m" # Cyan for arrow and directory
GREEN="\033[38;5;82m" # Green for clean git
YELLOW="\033[38;5;226m" # Yellow for dirty git
RED="\033[38;5;196m" # Red for dirty indicator
RESET="\033[0m"
# Build prompt (robbyrussell style)
prompt="${CYAN}➜${RESET} "
prompt+="${CYAN}${dir}${RESET} "
if [ -n "$git_branch" ]; then
if [ -n "$git_dirty" ]; then
prompt+="${YELLOW}git:(${git_branch})${RESET} ${RED}${git_dirty}${RESET} "
else
prompt+="${GREEN}git:(${git_branch})${RESET} "
fi
fi
# Add model info (Claude Code specific)
prompt+="${CYAN}[${model}]${RESET}"
echo -e "$prompt"{
"format": "bash",
"position": "left",
"colorScheme": "oh-my-zsh-robbyrussell",
"refreshInterval": 500
}Arrow character (➜) showing as box or question mark
Ensure terminal uses UTF-8 encoding. Check: locale | grep UTF-8. Set if needed: export LANG=en_US.UTF-8. Verify font supports Unicode arrows (U+279C).
Git status always showing dirty (✗) even with clean repo
Check Git status manually: git status. Verify git diff commands work: git diff --quiet && echo clean. Ensure .gitignore not excluding modified files. Clear Git cache: git rm -r --cached . && git add .
Directory showing full path instead of basename only
Verify basename command available: which basename. Check sed command working: echo ~/foo/bar | sed 's|'$HOME'|~|' | xargs basename (should show 'bar'). Test jq extraction: jq -r .workspace.path.
Colors incorrect or showing different shades than Oh-My-Zsh
Oh-My-Zsh uses 256-color codes. Verify terminal: tput colors (should be 256). Compare: echo -e '\033[38;5;51mCyan\033[0m' with zsh prompt. Adjust color codes if terminal palette differs.
Git branch not detected despite being in repository
Check Git installed and in PATH: git --version. Verify in repo: git rev-parse --git-dir. Ensure script can execute git: which git. Test branch detection: git rev-parse --abbrev-ref HEAD
Loading reviews...