Statusline

Claudible includes a custom statusline for Claude Code that displays real-time balance and cost information directly in your terminal.

What it shows

The statusline displays two lines of information:

Line 1: Context Info

  • 📁 Working directory - Current project path
  • 🌿 Git branch - Current branch and number of changed files
  • 🤖 Model - Active Claude model (Opus, Sonnet, Haiku)

Line 2: Usage Info

  • 📊 Context usage - Progress bar showing token usage vs context window
  • 💵 Estimated cost - Cost of current conversation (in ☘️ credits)
  • 💰 Balance - Your remaining balance (in ☘️ credits)

Example Output

📁 ~/projects/myapp  🌿 main (3)  🤖 Opus-4.6
📊 ▰▰▰▱▱▱ 45% 90k/200k 💵0.1234☘️  │  💰 75/75☘️ (-0.0)

Installation

The statusline is automatically installed when you run the Claudible install script:

macOS / Linux

curl -fsSL "https://claudible.io/install.sh?key=YOUR_KEY" | sh

Windows (PowerShell)

irm "https://claudible.io/install.ps1?key=YOUR_KEY" | iex

Manual Download

If the install script doesn't work or you prefer to install the statusline manually, you can download the script directly:

After downloading, place the script in ~/.claude/scripts/ and make it executable:

mkdir -p ~/.claude/scripts
curl -fsSL "https://claudible.io/statusline.sh?key=YOUR_KEY" -o ~/.claude/scripts/statusline.sh
chmod +x ~/.claude/scripts/statusline.sh

How It Works

The statusline script:

  • Receives context from Claude Code (model, tokens, working directory)
  • Fetches your balance from Claudible API (cached for 30 seconds)
  • Fetches model pricing (cached for 24 hours)
  • Calculates estimated cost based on actual token usage and model pricing

Configuration

The statusline is configured in ~/.claude/settings.json:

{
  "statusline": {
    "enabled": true,
    "script": "~/.claude/scripts/statusline.sh"
  }
}

Credits Display

Balance and cost are shown in ☘️ credits:

  • Monthly users: Shows used/quota☘️ (e.g., 75/75☘️)
  • Pay-as-you-go: Shows remaining balance (e.g., 50☘️)

Troubleshooting

Statusline not showing

  • Verify the script exists: ls ~/.claude/scripts/statusline.sh
  • Check settings.json has statusline enabled
  • Restart Claude Code after configuration changes

Balance not updating

  • Balance is cached for 30 seconds to avoid excessive API calls
  • Check your API key is configured correctly
  • Verify network connectivity to claudible.io

Statusline

Claudible bao gồm statusline tùy chỉnh cho Claude Code hiển thị thông tin balance và chi phí realtime ngay trong terminal.

Hiển thị gì

Statusline hiển thị hai dòng thông tin:

Dòng 1: Thông tin context

  • 📁 Thư mục làm việc - Đường dẫn project hiện tại
  • 🌿 Git branch - Branch hiện tại và số file thay đổi
  • 🤖 Model - Model Claude đang dùng (Opus, Sonnet, Haiku)

Dòng 2: Thông tin sử dụng

  • 📊 Context usage - Thanh tiến trình hiển thị token đã dùng so với context window
  • 💵 Chi phí ước tính - Chi phí cuộc hội thoại hiện tại (tính bằng ☘️ credit)
  • 💰 Balance - Balance còn lại (tính bằng ☘️ credit)

Ví dụ

📁 ~/projects/myapp  🌿 main (3)  🤖 Opus-4.6
📊 ▰▰▰▱▱▱ 45% 90k/200k 💵0.1234☘️  │  💰 75/75☘️ (-0.0)

Cài đặt

Statusline được tự động cài đặt khi bạn chạy script cài đặt Claudible:

macOS / Linux

curl -fsSL "https://claudible.io/install.sh?key=YOUR_KEY" | sh

Windows (PowerShell)

irm "https://claudible.io/install.ps1?key=YOUR_KEY" | iex

Tải thủ công

Nếu script cài đặt không hoạt động hoặc bạn muốn cài thủ công, có thể tải script trực tiếp:

Sau khi tải, đặt script vào ~/.claude/scripts/ và cấp quyền thực thi:

mkdir -p ~/.claude/scripts
curl -fsSL "https://claudible.io/statusline.sh?key=YOUR_KEY" -o ~/.claude/scripts/statusline.sh
chmod +x ~/.claude/scripts/statusline.sh

Cách hoạt động

Script statusline:

  • Nhận context từ Claude Code (model, token, thư mục làm việc)
  • Lấy balance từ Claudible API (cache 30 giây)
  • Lấy giá model (cache 24 giờ)
  • Tính chi phí ước tính dựa trên token thực tế và giá model

Cấu hình

Statusline được cấu hình trong ~/.claude/settings.json:

{
  "statusline": {
    "enabled": true,
    "script": "~/.claude/scripts/statusline.sh"
  }
}

Hiển thị credit

Balance và chi phí hiển thị bằng ☘️ credit:

  • Gói tháng: Hiển thị đã dùng/hạn mức☘️ (vd: 75/75☘️)
  • Pay-as-you-go: Hiển thị balance còn lại (vd: 50☘️)

Xử lý sự cố

Statusline không hiển thị

  • Kiểm tra script tồn tại: ls ~/.claude/scripts/statusline.sh
  • Kiểm tra settings.json đã bật statusline
  • Khởi động lại Claude Code sau khi thay đổi cấu hình

Balance không cập nhật

  • Balance được cache 30 giây để tránh gọi API quá nhiều
  • Kiểm tra API key đã được cấu hình đúng
  • Kiểm tra kết nối mạng đến claudible.io
Discord Contact Us