Loading...
Comprehensive multi-line statusline displaying detailed session information across two lines with organized sections and visual separators
#!/usr/bin/env bash
# Multi-Line Statusline for Claude Code
# Displays comprehensive session info across two lines
# Read JSON from stdin
read -r input
# Extract all available data
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')
cost=$(echo "$input" | jq -r '.session.estimatedCost // 0' | awk '{printf "%.3f", $0}')
memory=$(echo "$input" | jq -r '.system.memoryUsage // 0' | awk '{printf "%.1f", $0/1024/1024}')
# Get git info if in repo
workdir=$(echo "$input" | jq -r '.workspace.path // "."')
cd "$workdir" 2>/dev/null || cd .
if git rev-parse --git-dir > /dev/null 2>&1; then
branch=$(git symbolic-ref --short HEAD 2>/dev/null || echo "(detached)")
if [ -z "$(git status --porcelain)" ]; then
git_status="\033[32m ✓\033[0m"
else
git_status="\033[33m ✗\033[0m"
fi
git_display=" ${branch}${git_status}"
else
git_display=""
fi
# Box drawing and separators
SEP="\ue0b0"
VSEP="│"
TOP_LEFT="┌"
BOT_LEFT="└"
# Color scheme
RESET="\033[0m"
MODEL_C="\033[38;5;111m" # Blue
DIR_C="\033[38;5;214m" # Orange
TOKEN_C="\033[38;5;76m" # Green
COST_C="\033[38;5;220m" # Yellow
MEM_C="\033[38;5;139m" # Purple
# Build top line: Model | Directory | Git
top_line="${TOP_LEFT}${RESET} ${MODEL_C}${model}${RESET} ${VSEP} ${DIR_C}${dir}${RESET}${git_display}"
# Build bottom line: Tokens | Cost | Memory
bottom_line="${BOT_LEFT}${RESET} ${TOKEN_C} ${tokens:,} tokens${RESET} ${VSEP} ${COST_C}\$${cost}${RESET}"
if [ "$memory" != "0.0" ]; then
bottom_line="${bottom_line} ${VSEP} ${MEM_C}${memory} MB${RESET}"
fi
# Output both lines
echo -e "$top_line"
echo -e "$bottom_line"
{
"format": "bash",
"position": "left",
"colorScheme": "multi-line-dashboard",
"refreshInterval": 1000
}Box drawing characters showing as garbage or question marks
Ensure terminal has UTF-8 encoding enabled. Set: export LANG=en_US.UTF-8. Test with: echo '┌│└'
Second line overwriting first line or display corruption
Terminal may not support multi-line statuslines properly. Check Claude Code configuration for multi-line support or use single-line statusline instead.
Memory usage always showing 0.0 MB
Memory monitoring may not be available in your Claude Code version. This field is optional - statusline works without it.
Lines not aligned or wrapped incorrectly
Terminal window may be too narrow. Resize to at least 80 characters wide or simplify displayed information.
Loading reviews...