Skip to content

A modular statusline for Claude Code CLI - real-time context usage, rate limits, costs, git status, and 20+ customizable modules

License

Notifications You must be signed in to change notification settings

pstuart/Barista

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Barista β˜•

Serving up fresh stats for your Claude Code sessions.

A feature-rich, modular statusline for Claude Code CLI that brews real-time development information including context usage, rate limits, costs, and more.

Barista Version Shell Script License

Barista Demo

What's New in v1.3.0 πŸ†•

  • Enhanced Color Themes - 5 distinct visual themes that actually look different:
    • default - Standard emoji (πŸŸ’πŸŸ‘πŸŸ πŸ”΄)
    • minimal - Subtle geometric shapes (β—¦ ◐ β†’ βŽ‡)
    • vibrant - Bold heart colors (πŸ’šπŸ’›πŸ§‘β€οΈ)
    • monochrome - Pure ASCII ([OK] [~~] [!!] [XX])
    • nerd - Nerd Font icons (requires Nerd Font)
  • Improved Spacing - Status indicators now have proper spacing in normal/verbose modes
  • Smart Compact Mode - Separator padding and status spacing automatically removed in compact mode
  • Fixed Installer Preview - Preview now shows actual sample data instead of just icons

v1.2.0

  • Memory Optimizations - Fixed unbounded history file growth, added file size caps
  • Interactive Update Check - Installer now prompts to check for updates on startup with version display
  • 4-Level Rate Limit Colors - Visual indicators at 50%/75%/95% thresholds (πŸŸ’β†’πŸŸ‘β†’πŸŸ β†’πŸ”΄)
  • Monorepo Performance - Git module now limits output to prevent memory spikes in large repos

v1.1.0

  • Auto-Update Checking - Barista checks GitHub for updates and can self-update
  • Interactive Installer - Arrow key navigation with space to toggle selections
  • Customizable Separators - Choose from pipe, arrow, bullet, and more
  • Color Themes - Default, minimal, vibrant, or monochrome
  • Display Modes - Normal, compact, or verbose output
  • Live Preview - See your statusline before installing
  • Bash 3.2 Compatible - Works with macOS default bash (no brew required)

What's On The Menu β˜•

Core Modules (The House Blend)

Module What It Serves
directory Current working directory name
context Visual progress bar showing context usage with auto-compact warnings
git Branch name, dirty status, staged/modified/untracked indicators
project Auto-detects Node.js, Nuxt, Next.js, Vite, Rust, Go, Python, Swift, and more
model Current Claude model and output style
cost Session cost with burn rate ($/hour) and tokens per minute (TPM)
rate-limits Real-time 5-hour and 7-day rate limit tracking with projections
time Current date and time
battery Battery percentage (macOS)

System Modules (The Espresso Shots)

Module What It Serves
cpu CPU usage percentage
memory RAM usage
disk Disk space usage
network IP address and network info
uptime System uptime
load System load average
temperature CPU temperature (requires osx-cpu-temp)
brightness Screen brightness
processes Process count

Dev Tools (The Specialty Drinks)

Module What It Serves
docker Docker container status
node Node.js version
weather Current weather via wttr.in
timezone Multiple timezone clocks

Fresh Brew Sample

πŸ“ myproject | πŸ“Š β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ 75%πŸ”΄ (10kβ†’βš‘) | 🌿 main [●+] πŸ“ 3 | ⚑ Nuxt πŸš€ | πŸ€– Claude Opus 4.5 | πŸ’° $2.50 @$5.00/h | 5h:45%🟒 7d:78%🟠 | πŸ“… 01/12 πŸ• 04:30 PM | πŸ”‹ 85%

With different separators:

πŸ“ myproject β€Ί πŸ“Š β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘ 50%🟒 β€Ί 🌿 main β€Ί πŸ€– Opus    # Arrow style
πŸ“ myproject β€’ πŸ“Š β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘ 50%🟒 β€’ 🌿 main β€’ πŸ€– Opus    # Bullet style
DIR: myproject | CTX: ####---- 50%[OK] | GIT: main      # ASCII mode

Temperature Gauge

Context Usage (3-level):

Indicator Usage Status
🟒 Below 60% Smooth sipping
🟑 60-75% Getting warm
πŸ”΄ Above 75% Boiling over

Rate Limits (4-level):

Indicator Usage Status
🟒 Below 50% Plenty of headroom
🟑 50-75% Moderate usage
🟠 75-95% High usage
πŸ”΄ Above 95% Critical, near limit

Requirements

  • Claude Code CLI - Installation Guide
  • Bash 3.2+ - Works with macOS default bash
  • jq - JSON processor (required)
  • bc - Basic calculator (usually pre-installed)
  • macOS - For battery and OAuth keychain access (Linux support partial)
# Install dependencies on macOS
brew install jq

Installation

Quick Brew

# Clone the repo
git clone https://github.com/pstuart/Barista.git
cd Barista

# Run the installer
./install.sh

The interactive installer features:

  • Arrow key navigation - Use ↑/↓ to move, Space to toggle, Enter to confirm
  • Module categories - Core, System, Dev Tools, and Extra modules
  • Display customization - Icons, separators, colors, and themes
  • Live preview - See your statusline before installing
  • Automatic backup - Your previous statusline is saved

Installer Options

# Installation
./install.sh                 # Interactive installation with keyboard navigation
./install.sh --defaults      # Install with core modules, no prompts
./install.sh --minimal       # Quick install with minimal modules
./install.sh --force         # Same as --defaults, no confirmation

# Display options
./install.sh --no-emoji      # Install without emojis (ASCII mode)
./install.sh --no-color      # Install without colors

# Updates
./install.sh --check-update  # Check if a newer version is available
./install.sh --update        # Download and install the latest version
./install.sh --version       # Show current version

# Other
./install.sh --uninstall     # Uninstall and restore previous statusline
./install.sh --help          # Show all options

Staying Up to Date

Barista automatically checks for updates when you run the installer. You can also manually check:

./install.sh --check-update   # Check for updates
./install.sh --update         # Update to latest version

Manual Brew

  1. Copy barista to your Claude directory:

    cp -r barista ~/.claude/barista
    chmod +x ~/.claude/barista/barista.sh
  2. Configure Claude Code settings:

    Edit ~/.claude/settings.json:

    {
      "statusLine": {
        "type": "command",
        "command": "~/.claude/barista/barista.sh"
      }
    }
  3. Restart Claude Code to taste your fresh statusline.

Customization

Interactive Display Preferences

The installer lets you customize:

Setting Options
Icon Style Emoji icons or ASCII text
Status Indicators πŸŸ’πŸŸ‘πŸ”΄ Emoji, ●●● Dots, or [OK][WARN] ASCII
Progress Bars β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ Blocks, β–“β–“β–“β–‘β–‘ Shaded, ●●●○○ Circles, #### Hash
Separators | Pipe, β•‘ Double, β€Ί Arrow, β€’ Bullet, : Colon
Color Themes Default, Minimal, Vibrant, Monochrome
Display Mode Normal, Compact, Verbose

Configuration Files

Edit barista.conf or create ~/.claude/barista.conf for user overrides.

Per-Directory Overrides

Create .barista.conf in any project directory to customize the statusline for that project:

# ~/myproject/.barista.conf
# Minimal statusline for this large monorepo
DISPLAY_MODE="compact"
MODULE_WEATHER="false"
MODULE_ORDER="directory,context,git,model"

Configuration is loaded in order of precedence:

  1. Built-in defaults
  2. ~/.claude/barista/barista.conf
  3. ~/.claude/barista.conf (user overrides)
  4. .barista.conf (per-directory overrides)

Full Configuration Options

# =============================================================================
# GLOBAL SETTINGS
# =============================================================================

SEPARATOR=" | "           # Section separator (or " β€Ί ", " β€’ ", etc.)
DISPLAY_MODE="normal"     # "normal", "compact", "verbose"
COLOR_THEME="default"     # "default", "minimal", "vibrant", "monochrome"
USE_ICONS="true"          # Enable emoji icons
STATUS_STYLE="emoji"      # "emoji", "ascii", "dots"

# Progress bar customization
PROGRESS_BAR_WIDTH=8
PROGRESS_BAR_FILLED="β–ˆ"   # Or "β–“", "●", "#"
PROGRESS_BAR_EMPTY="β–‘"    # Or "β–‘", "β—‹", "-"

# =============================================================================
# MODULE ENABLE/DISABLE
# =============================================================================

# Core modules (on by default)
MODULE_DIRECTORY="true"
MODULE_CONTEXT="true"
MODULE_GIT="true"
MODULE_PROJECT="true"
MODULE_MODEL="true"
MODULE_COST="true"
MODULE_RATE_LIMITS="true"
MODULE_TIME="true"
MODULE_BATTERY="true"

# System modules (off by default)
MODULE_CPU="false"
MODULE_MEMORY="false"
MODULE_DISK="false"
MODULE_NETWORK="false"
MODULE_LOAD="false"

# =============================================================================
# RATE LIMIT SETTINGS (v1.2.0+)
# =============================================================================

RATE_SHOW_USAGE_STATUS="true"   # Show 4-level color indicators
RATE_LOW_THRESHOLD=50           # Green/yellow boundary
RATE_MEDIUM_THRESHOLD=75        # Yellow/orange boundary
RATE_HIGH_THRESHOLD=95          # Orange/red boundary

# Custom order
MODULE_ORDER="directory,context,git,project,model,cost,rate-limits,time,battery"

Preset Recipes

Espresso (Minimal):

DISPLAY_MODE="compact"
SEPARATOR=" β€Ί "
MODULE_ORDER="directory,context,git,model"

Americano (Developer):

MODULE_CPU="true"
MODULE_MEMORY="true"
MODULE_DOCKER="true"
MODULE_ORDER="directory,git,docker,cpu,memory,model,cost,rate-limits,battery"

Decaf (ASCII-only):

USE_ICONS="false"
STATUS_STYLE="ascii"
SEPARATOR=" | "
PROGRESS_BAR_FILLED="#"
PROGRESS_BAR_EMPTY="-"

Monochrome (Minimal colors):

COLOR_THEME="monochrome"
STATUS_STYLE="dots"
SEPARATOR=" β€’ "

The Menu (Architecture)

~/.claude/barista/
β”œβ”€β”€ barista.sh          # Main entry point
β”œβ”€β”€ barista.conf        # Configuration file
β”œβ”€β”€ VERSION             # Version tracking
└── modules/
    β”œβ”€β”€ utils.sh        # Shared utility functions
    β”œβ”€β”€ directory.sh    # Directory module
    β”œβ”€β”€ context.sh      # Context window module
    β”œβ”€β”€ git.sh          # Git module
    β”œβ”€β”€ project.sh      # Project detection module
    β”œβ”€β”€ model.sh        # Model info module
    β”œβ”€β”€ cost.sh         # Cost & TPM module
    β”œβ”€β”€ rate-limits.sh  # Rate limits module
    β”œβ”€β”€ time.sh         # Date/time module
    β”œβ”€β”€ battery.sh      # Battery module
    └── ...             # Additional modules

Crafting Custom Modules

Create a new file in modules/ following this recipe:

# =============================================================================
# My Custom Module - Description
# =============================================================================

module_mycustom() {
    local input="$1"  # JSON input from Claude Code
    # Your logic here
    echo "🎯 My Output"
}

Then add to barista.conf:

MODULE_MYCUSTOM="true"
MODULE_ORDER="...,mycustom,..."

Troubleshooting

Rate limits show "--"

  • Ensure you're using Claude Code with a Pro/Team subscription
  • Check you're on macOS with credentials stored in Keychain
  • Verify you're logged in (claude login)

Modules not loading

  • Check file permissions: chmod +x barista.sh
  • Verify module files exist in modules/ directory
  • Enable debug mode: DEBUG_MODE="true"

Arrow keys not working in installer

  • Make sure you're running in a proper terminal (not a script)
  • Try a different terminal emulator if issues persist

Testing manually

echo '{"workspace":{"current_dir":"'$PWD'"},"model":{"display_name":"Test"},"output_style":{"name":"default"},"context_window":{"context_window_size":200000,"current_usage":{"input_tokens":10000}}}' | ~/.claude/barista/barista.sh

Uninstall

./install.sh --uninstall

This will offer to restore your previous statusline if one was backed up.

Credits

License

MIT License - See LICENSE for details.

Author

Patrick D. Stuart


Enjoy your fresh brew! β˜•

Barista v1.3.0 - Because your Claude Code deserves a great statusline.

About

A modular statusline for Claude Code CLI - real-time context usage, rate limits, costs, git status, and 20+ customizable modules

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages