Loading...
Soothing Catppuccin Mocha theme statusline with 26 pastel colors, Powerline separators, and modular segments for Git, model info, and token tracking.
#!/usr/bin/env bash
# Catppuccin Mocha Theme Statusline for Claude Code
# Official Catppuccin Mocha color palette (26 colors)
# https://github.com/catppuccin/catppuccin
# Read JSON from stdin
read -r input
# Extract values
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')
git_branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null || echo "")
# Catppuccin Mocha Palette (256-color approximations)
# Base colors
BASE="\033[48;5;235m" # #1e1e2e
MANTLE="\033[48;5;234m" # #181825
CRUST="\033[48;5;233m" # #11111b
# Text colors
TEXT="\033[38;5;205m" # #cdd6f4
SUBTEXT1="\033[38;5;189m" # #bac2de
SUBTEXT0="\033[38;5;146m" # #a6adc8
# Accent colors
LAVENDER="\033[48;5;183m" # #b4befe
BLUE="\033[48;5;117m" # #89b4fa
SAPPHIRE="\033[48;5;116m" # #74c7ec
SKY="\033[48;5;153m" # #89dceb
TEAL="\033[48;5;152m" # #94e2d5
GREEN="\033[48;5;151m" # #a6e3a1
YELLOW="\033[48;5;229m" # #f9e2af
PEACH="\033[48;5;216m" # #fab387
MARRON="\033[48;5;217m" # #eba0ac
RED="\033[48;5;210m" # #f38ba8
MAUVE="\033[48;5;183m" # #cba6f7
PINK="\033[48;5;218m" # #f5c2e7
FLAMINGO="\033[48;5;217m" # #f2cdcd
ROSEWATER="\033[48;5;224m"# #f5e0dc
# Foreground versions
LAVENDER_FG="\033[38;5;183m"
BLUE_FG="\033[38;5;117m"
SAPPHIRE_FG="\033[38;5;116m"
TEAL_FG="\033[38;5;152m"
PEACH_FG="\033[38;5;216m"
RESET="\033[0m"
SEP="\ue0b0" # Powerline separator
# Build statusline
statusline=""
# Model segment (Lavender)
statusline+="${LAVENDER}${RESET}${TEXT} ${model} ${RESET}"
statusline+="${LAVENDER_FG}${SEP}${RESET}"
# Directory segment (Blue)
statusline+=" ${BLUE}${RESET}${TEXT} ${dir} ${RESET}"
statusline+="${BLUE_FG}${SEP}${RESET}"
# Git branch segment (Teal) - only if in git repo
if [ -n "$git_branch" ]; then
statusline+=" ${TEAL}${RESET}${TEXT} ${git_branch} ${RESET}"
statusline+="${TEAL_FG}${SEP}${RESET}"
fi
# Token count segment (Peach)
statusline+=" ${PEACH}${RESET}${TEXT} ${tokens} ${RESET}"
statusline+="${PEACH_FG}${SEP}${RESET}"
echo -e "$statusline"{
"format": "bash",
"position": "left",
"colorScheme": "catppuccin-mocha",
"refreshInterval": 500
}Colors look washed out or incorrect compared to official palette
Verify terminal supports 256 colors with 'tput colors' (should return 256). Enable true color if available: export COLORTERM=truecolor. Check terminal theme doesn't override ANSI colors.
Nerd Font icons showing as boxes or missing glyphs
Install Catppuccin-compatible Nerd Font from nerdfonts.com. Recommended: JetBrains Mono Nerd Font, FiraCode Nerd Font. Configure terminal to use installed font in preferences.
Git branch not displaying even when in repository
Check Git installed: git --version. Verify you're in Git repo: git status. Ensure script has permission to execute git commands. Test manually: git rev-parse --abbrev-ref HEAD
Powerline separators misaligned or overlapping text
Verify Nerd Font properly installed with Powerline glyphs (U+E0B0-U+E0B3). Test separator: echo -e '\ue0b0'. Disable font ligatures if enabled. Increase terminal line spacing if needed.
Statusline disappears or flickers on refresh
Increase refreshInterval to 1000ms in configuration. Check script permissions: chmod +x statusline.sh. Verify jq installed: jq --version. Test script manually with sample JSON input.
Loading reviews...