Loading...
Clean, performance-optimized statusline with Powerline glyphs showing model, directory, and token count
#!/usr/bin/env bash
# Minimal Powerline Statusline for Claude Code
# Displays: Model | Directory | Token Count
# Read JSON from stdin
read -r input
# Extract values using jq
model=$(echo "$input" | jq -r '.model // "unknown"')
dir=$(echo "$input" | jq -r '.workspace.path // "~"' | sed "s|$HOME|~|")
tokens=$(echo "$input" | jq -r '.session.totalTokens // 0')
# Powerline separators
SEP="\ue0b0"
# Color codes (256-color palette)
MODEL_BG="\033[48;5;111m" # Light blue background
MODEL_FG="\033[38;5;111m" # Light blue foreground
DIR_BG="\033[48;5;246m" # Gray background
DIR_FG="\033[38;5;246m" # Gray foreground
TOKEN_BG="\033[48;5;214m" # Orange background
TOKEN_FG="\033[38;5;214m" # Orange foreground
RESET="\033[0m"
# Build statusline with Powerline glyphs
echo -e "${MODEL_BG} ${model} ${RESET}${MODEL_FG}${SEP}${RESET} ${DIR_BG} ${dir} ${RESET}${DIR_FG}${SEP}${RESET} ${TOKEN_BG} ${tokens} ${RESET}${TOKEN_FG}${SEP}${RESET}"{
"format": "bash",
"position": "left",
"colorScheme": "powerline-default",
"refreshInterval": 500
}Powerline separators showing as boxes or question marks
Install a Nerd Font (e.g., FiraCode Nerd Font) and configure your terminal to use it. Verify with: echo -e '\ue0b0'
Colors not displaying correctly
Ensure terminal supports 256 colors. Test with: tput colors (should return 256). Set TERM=xterm-256color if needed.
jq command not found error
Install jq: brew install jq (macOS), apt install jq (Linux), or download from https://jqlang.github.io/jq/
tput colors shows 8 but terminal supports 256 colors
Set TERM explicitly: export TERM=xterm-256color. Test: env TERM=xterm-256color tput colors (should show 256). For tmux/screen use TERM=screen-256color.
Powerline separators misaligned or cut off at edges
Install Powerline-patched font from github.com/powerline/fonts. U+E0B0-U+E0B3 require patched fonts. For VS Code, enable GPU acceleration for better rendering.
Loading reviews...