#!/bin/sh # Lumbridge status-line bridge for Claude Code. # # Claude Code 2.1.80+ pipes a JSON payload to the configured `statusLine` # command on every turn. That payload carries `rate_limits.five_hour` and # `rate_limits.seven_day` — the real subscription windows, relayed from # rate-limit headers the CLI already received. Reading them here costs nothing # and needs no credential, which is why Lumbridge takes this route rather than # calling the account usage endpoint. # # This wrapper exists so a missing python3 degrades to a printed message # instead of a broken status line. It `exec`s the parser so stdin stays the # payload. # # Install with scripts/install-claude-statusline.sh; uninstall by removing the # statusLine block it adds to settings.json. set -u FEED="${LUMBRIDGE_CLAUDE_FEED:-${XDG_DATA_HOME:-$HOME/.local/share}/lumbridge/claude-rate-limits.jsonl}" HERE=$(dirname "$0") if ! command -v python3 >/dev/null 2>&1; then # No parser available. Say so rather than printing a number we cannot read. echo "lumbridge · python3 not found" exit 0 fi mkdir -p "$(dirname "$FEED")" 2>/dev/null || true exec python3 "$HERE/claude-statusline-bridge.py" "$FEED"