claude-status-line-go

module
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2026 License: MIT

README ΒΆ

claude-status-line-go

Go CLI tool that reads Claude Code JSON from stdin and prints a formatted status line.

Output Format

🧠 Opus 4.8Β·1M β”‚ πŸ“ payments-api β”‚ 🌿 feature/calendar ●3
🟑5h β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘ 83% β†Ί22m β”‚ CTX β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘ 68% β”‚ I420k O77k ⚑2.3M β”‚ 7d 74% β”‚ $7.92

Installation

Using go install
go install github.com/williamokano/claude-status-line-go/cmd/claude-status-line-go@latest
From Source
git clone https://github.com/williamokano/claude-status-line-go.git
cd claude-status-line-go
make build

Usage

As Claude Code Status Line

Add to your Claude Code settings (~/.claude/settings.json or project .claude/settings.json):

{
  "statusLine": {
    "type": "command",
    "command": "claude-status-line-go"
  }
}
Standalone
echo '{"model":...}' | claude-status-line-go

CLI Flags

Flag Description
-h, --help Print usage information
-v, --version Print version
--no-color Disable ANSI color output
--completion bash|zsh|fish Print shell completion script

Environment Variables

Variable Default Description
CSL_SHOW_COST true Show session cost
CSL_SHOW_WEEKLY true Show weekly usage
CSL_SHOW_TOKENS true Show token counts
CSL_SHOW_GIT true Show git branch
CSL_SHOW_GIT_DIRTY true Show dirty file count
CSL_BAR_SIZE 10 Progress bar width
CSL_LIMIT_WARN 60 Rate limit warning threshold (%)
CSL_LIMIT_CRIT 85 Rate limit critical threshold (%)
CSL_CTX_WARN 60 Context warning threshold (%)
CSL_CTX_CRIT 85 Context critical threshold (%)
CSL_WEEKLY_SHOW_AT 60 Show weekly when >= this %
CSL_FORMAT β€” Custom output format template
NO_COLOR β€” Set to any value to disable ANSI colors

Configuration File

Create ~/.config/claude-status-line-go/claude-status-line.yaml:

show_cost: true
show_weekly: true
show_tokens: true
show_git: true
show_git_dirty: true
bar_size: 10
limit_warn: 60
limit_crit: 85
ctx_warn: 60
ctx_crit: 85
weekly_show_at: 60

Custom Output Format

Use the CSL_FORMAT env var or format config field to customize the output. Available placeholders:

Placeholder Description
{model} Model name as reported by Claude Code (e.g. Opus 4.8, Sonnet 5)
{ctx_size} Context window size (200k, 1M)
{project} Project folder name
{branch} Git branch name
{dirty} Dirty file count (●3)
{limit_bar} Rate limit progress bar
{limit_pct} Rate limit percentage
{limit_color} Rate limit color ANSI code
{limit_reset} Time until rate limit reset
{ctx_bar} Context progress bar
{ctx_pct} Context percentage
{ctx_color} Context color ANSI code
{tokens_in} Input tokens (42k, 2.3M)
{tokens_out} Output tokens
{tokens_cache} Cache tokens
{cost} Session cost
{weekly_pct} Weekly usage percentage
{reset}, {dim}, {bold} ANSI format codes
{red}, {green}, {yellow} ANSI color codes
{blue}, {magenta}, {cyan}, {white} ANSI color codes

Example:

format: "{cyan}🧠 {model}Β·{ctx_size}{reset} {dim}β”‚ πŸ“ {project}{reset} {dim}β”‚ 🌿 {branch}{reset}{dirty}"

Shell Completions

eval "$(claude-status-line-go --completion bash)"  # Bash
eval "$(claude-status-line-go --completion zsh)"   # Zsh
claude-status-line-go --completion fish | source    # Fish

Development

make build   # Build the binary
make test    # Run tests
make lint    # Lint code
make clean   # Clean artifacts

Directories ΒΆ

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL