Loading...
Docker statusline configuration for Claude Code CLI. Features real-time health monitoring, color-coded indicators, and container tracking. Production-ready.
#!/bin/bash
# Docker Health Statusline
# Real-time container health monitoring for Claude Code CLI
# Get running containers count
running=$(docker ps -q 2>/dev/null | wc -l | tr -d ' ')
# Get total containers
total=$(docker ps -a -q 2>/dev/null | wc -l | tr -d ' ')
# Get unhealthy containers
unhealthy=$(docker ps --filter health=unhealthy -q 2>/dev/null | wc -l | tr -d ' ')
# Color codes
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Status indicator
if [ "$unhealthy" -gt 0 ]; then
status="${RED}●${NC}"
elif [ "$running" -eq 0 ]; then
status="${YELLOW}○${NC}"
else
status="${GREEN}●${NC}"
fi
# Display statusline
echo -e "${BLUE}🐳${NC} ${status} ${running}/${total}"
~/.claude/statusline.json
~/.claude/statusline.json
%USERPROFILE%\.claude\statusline.json
{
"format": "bash",
"refreshInterval": 2000,
"position": "left",
"colorScheme": "docker-blue"
}
Statusline shows 0/0 containers even when containers are running
Verify Docker daemon is running with 'docker ps'. Check user has permissions to access Docker socket. On Linux, add user to docker group with 'sudo usermod -aG docker $USER' and restart terminal.
Colors not displaying correctly in statusline output
Ensure terminal supports ANSI color codes. Set TERM=xterm-256color in shell profile. Verify colorScheme setting in statusline.json matches terminal capabilities.
Statusline causing performance lag or high CPU usage
Increase refreshInterval to 3000-5000ms in configuration. Reduce docker ps query frequency. Consider caching container count between refresh cycles for better performance.
Health check status not updating or always showing healthy
Confirm containers have HEALTHCHECK defined in Dockerfile or docker-compose.yml. Verify docker version supports health checks (17.05+). Run 'docker inspect CONTAINER' to check health configuration.
Loading reviews...
Join our community of Claude power users. No spam, unsubscribe anytime.
Git-focused statusline showing branch, dirty status, ahead/behind indicators, and stash count alongside Claude session info
Real-time MCP server monitoring statusline showing connected servers, active tools, and performance metrics for Claude Code MCP integration
Clean, performance-optimized statusline with Powerline glyphs showing model, directory, and token count