Custom Status Bar for Claude Code: Real-Time VPS Monitoring
Developers juggling Claude Code across multiple servers often waste time switching contexts to check infrastructure status. The fix? A custom status bar that shows key session metrics and VPS monitoring right in the editor—no context switching required.
System Architecture
The monitoring system uses two main parts: a background daemon for polling servers and a client script for displaying data. The vps-poller.sh daemon runs SSH queries to your servers every 30 seconds, grabbing four essential metrics:
- RAM usage
- CPU load
- Disk space usage
- System uptime
Data gets cached as JSON files in /tmp/, so the statusline.sh client script can pull the latest info instantly without extra network calls. This keeps Claude Code's interface snappy.
Key architecture benefits:
- Low network overhead thanks to caching
- Zero display lag
- Modular design: run the daemon independently
- Handles multiple servers at once
Auto-Focus on the Active Server
Working with multiple VPS instances? The biggest hassle is figuring out which server's in play right now. This system fixes it by auto-analyzing Claude Code logs.
The script scans the last 20 KB of session transcript, using two strategies to spot the active server:
- Detects SSH commands (
ssh,scp,sftp) and matches IP addresses to your pre-configured server list - Fallback search for MCP server names if you're using Model Context Protocol exclusively
How it looks in action:
# Working with 'main' server via SSH
▶ main●(R:42% D:55%) new● sec●
# Switching to 'sec' via MCP
main● new● ▶ sec●(R:61% D:70%)
# 'new' server under heavy load (always highlighted)
▶ main●(R:42% D:55%) new◉(R:92%) sec●
Status indicators include:
- ● — all good
- ◉ — high load (RAM > 85% or disk > 90%)
- ✗ — server unreachable
- ↻ — recently rebooted
- ▶ — currently active server
Claude API Integration and Cost Tracking
The status bar hooks into the Claude API to show real-time usage limits and session cost estimates. It auto-detects your account type:
- Claude Max subscribers see theoretical session costs
- API users get actual spend
Claude API metrics displayed:
- Active model — current model (e.g., Opus 4.6)
- Context fill — progress bar with color coding (green → yellow → red)
- Quota remaining — percentage used for 5-hour (H) and weekly (W) limits
- Session cost — estimated API spend
API data caches for 2 minutes to cut load, pulling OAuth tokens from your system's credential store.
Installation and Setup
Setup is streamlined for quick deployment, best done via Claude Code itself.
Quick install via Claude Code:
Clone https://github.com/CreatmanCEO/claude-statusline and run install.sh --ru
Manual install for power users:
git clone https://github.com/CreatmanCEO/claude-statusline.git ~/claude-statusline
bash ~/claude-statusline/install.sh --ru
VPS monitoring config:
- Add servers to
~/.claude/statusline.conf - Set
SHOW_VPS=remote - List servers in
VPS_SERVERS - Start the daemon:
~/claude-statusline/vps-poller.sh start
Platform notes:
- Linux/macOS: full feature support
- Windows: install only via Claude Code (skip PowerShell)
- Needs bash and jq pre-installed for JSON handling
Key Features
• Instant VPS monitoring — server status without tool-switching
• Auto-focus — detects active server from Claude Code logs
• Claude API integration — real-time limits and session cost
• Lightweight — pure bash + jq, no Node.js or heavy runtimes
• Cross-platform — Linux, macOS, Windows (with limits)
Compatibility Fixes
Development and testing squashed major issues:
Windows permissions:
chmodfails in PowerShell- Fix: Claude Code-only install instructions
OAuth token storage:
- Windows:
.credentials.json - Unix:
.credentials - Fix: Script checks both
Nested JSON quotes:
echomangled JSON- Fix: Switched to
printfwith proper escaping
Windows bash path:
command -v bashreturns paths with spaces- Fix: Direct
bashcall, no path check
All fixes landed within a day of launch—open-source speed in action.
Advanced Features and Customization
Tailor the status bar to your workflow with multiple display modes.
Customizable segments:
- Git info: current branch and change status
- Code stats: lines added/removed this session
- Session timer: time spent working
- System tools: MCP and other protocol support
Performance tweaks:
- Tiny footprint: daemon uses <1% CPU
- Smart caching: updates only on changes
- Lazy loading: skips unused modules
The project evolves with community input. Upcoming: more monitoring protocols, UI tweaks, and dev tool integrations.
— Editorial Team
No comments yet.