{"id":50444312,"url":"https://github.com/dotcommander/statusline","last_synced_at":"2026-05-31T20:32:09.051Z","repository":{"id":351867910,"uuid":"1198832490","full_name":"dotcommander/statusline","owner":"dotcommander","description":"Two-line ANSI status bar for Claude Code — project context, git branch, model, context window health, recent prompts, Tokyo Night palette","archived":false,"fork":false,"pushed_at":"2026-05-04T09:54:07.000Z","size":88,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-04T11:37:04.090Z","etag":null,"topics":["ansi","bubbletea","claude-code","cli","go","statusbar","terminal","tokyo-night"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotcommander.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-01T19:58:30.000Z","updated_at":"2026-05-04T09:54:11.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/dotcommander/statusline","commit_stats":null,"previous_names":["dotcommander/statusline"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/dotcommander/statusline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotcommander%2Fstatusline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotcommander%2Fstatusline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotcommander%2Fstatusline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotcommander%2Fstatusline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotcommander","download_url":"https://codeload.github.com/dotcommander/statusline/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotcommander%2Fstatusline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33748607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansi","bubbletea","claude-code","cli","go","statusbar","terminal","tokyo-night"],"created_at":"2026-05-31T20:32:04.238Z","updated_at":"2026-05-31T20:32:09.039Z","avatar_url":"https://github.com/dotcommander.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# statusline\n\nA two-line ANSI status bar for [Claude Code](https://docs.anthropic.com/en/docs/claude-code). Displays project context, git branch, model name, context window health, and recent prompts -- color-coded with a Tokyo Night palette.\n\n```\n● statusline › + add per-token style overrides › /dc:cpt\n  cc 1.0.33 › dc:1.6.1 › claude opus 4.6 › ctx:42k › go 1.26 ›  main\n```\n\nLine 1 collapses from the right when the terminal is too narrow. Line 2 stays fixed.\n\n## Install\n\n```bash\ngo install github.com/dotcommander/statusline@latest\n```\n\nOr build from source:\n\n```bash\ngit clone https://github.com/dotcommander/statusline.git\ncd statusline\ngo build -o statusline . \u0026\u0026 ln -sf \"$(pwd)/statusline\" ~/go/bin/statusline\n```\n\n## Setup\n\nThe `setup` subcommand configures Claude Code's `settings.json` to use statusline. It detects the binary in `~/go/bin`, falls back to `PATH`, or builds from source if needed.\n\n```bash\nstatusline setup                # configure global settings (~/.claude/settings.json)\nstatusline setup --local        # configure project-local settings (.claude/settings.json)\n```\n\nIdempotent -- running it again when already configured reports \"no changes needed.\"\n\n## Tokens\n\nEach piece of information in the status bar is a **token** -- a named placeholder you arrange in `line1` and `line2`.\n\n```\n● statusline › + add error handling › ctx:42k\n  cc 1.0.33 › claude sonnet 4.6 › ctx:42k › go 1.26 ›  feat/tokens\n```\n\n| Token | Shows | Notes |\n|-------|-------|-------|\n| `[dir]` | cwd basename, lowercased | Blue (#7aa2f7) |\n| `[git]` | branch name | Green = clean, red = dirty. Hidden outside git repos. |\n| `[project]` | detected stack + version | Go, Rust, Python, Node (React/Next/Svelte/Vue/Astro), PHP (Laravel/Symfony) |\n| `[model]` | active model name, lowercased | Opus = paleOrange, Sonnet/Haiku = orange, others = muted |\n| `[ctx]` | `ctx:42k` token usage | Green, yellow (\u003c=25% remaining), red (\u003c=10%). Hidden at session start. Shows `ctx:1.2M !!!` when full. |\n| `[label]` | `cc 1.0.33` Claude Code version | Always visible |\n| `[dc]` | `dc:1.6.1` dotcommander version | Hidden if dotcommander isn't installed |\n| `[prompts]` | Up to N recent user prompts | Icons: `\u003e` general, `\u003e\u003e` slash cmd, `?` question, `+` create, `x` fix |\n\n\u003e Line 1 drops tokens from the right when the terminal is too narrow. Put your most important tokens first.\n\n## Configuration\n\nConfig file: `~/.config/statusline/config.yaml` (override with `STATUSLINE_CONFIG`).\n\nRun `statusline config` to edit interactively, or edit the file directly.\n\n### Layout\n\n```yaml\nline1: \"[dir] [prompts]\"\nline2: \"[label] [dc] [model] [ctx] [project] [git]\"\nseparator: \" \u003e \"\ndot: \"\u003e\"\n```\n\n`separator` appears between every token. `dot` is the leading bullet on line 1.\n\n### Prompts\n\n```yaml\nprompts:\n  max: 3           # number of recent prompts to show\n  newest_words: 4  # word count for the most recent prompt\n  older_words: 3   # word count for older prompts\n  cache_ttl: 0     # seconds; 0 = disabled; recommended: 5\n```\n\nPrompt slots collapse individually -- oldest drops first when space is tight. Set `cache_ttl: 5` to avoid re-reading the transcript on every render.\n\n### Context window\n\n```yaml\ncontext:\n  warning_pct: 25   # remaining % -\u003e yellow dot and ctx token\n  critical_pct: 10  # remaining % -\u003e red dot and ctx token\n  alert_pct: 30     # remaining % -\u003e entire bar turns red\n```\n\nWhen context remaining falls below `alert_pct`, the entire status bar renders in red regardless of individual token colors.\n\n### Per-token overrides\n\n```yaml\ntokens:\n  git:\n    max_length: 24        # truncates branch name with \"...\"\n    style: \"bold\"\n  model:\n    style: \"italic #ff9e64\"\n  dir:\n    style: \"bold #7aa2f7\"\n```\n\nThe `style` field accepts keywords, hex colors, or both combined. Setting it replaces all default colors for that token.\n\n**Style syntax:**\n\n| Value | Effect |\n|-------|--------|\n| `\"bold\"` | Bold text |\n| `\"italic\"` | Italic text |\n| `\"underline\"` | Underline |\n| `\"dim\"` | Dimmed |\n| `\"strikethrough\"` | Strikethrough |\n| `\"#f7768e\"` | Hex color |\n| `\"bold italic #f7768e\"` | Combined -- space-separated |\n\n## Layout Examples\n\n### Minimal -- project + git only\n\n```yaml\nline1: \"[dir]\"\nline2: \"[label] [model] [ctx] [project] [git]\"\n```\n\n### Prompt-heavy -- full breadcrumb trail\n\n```yaml\nline1: \"[dir] [prompts]\"\nline2: \"[label] [dc] [model] [ctx] [project] [git]\"\nseparator: \" \u003e \"\nprompts:\n  max: 5\n  newest_words: 6\n  older_words: 3\n```\n\n### Context-focused -- ctx on line 1\n\n```yaml\nline1: \"[ctx] [prompts]\"\nline2: \"[label] [model] [project] [git]\"\n```\n\n### Model + dir on line 1\n\n```yaml\nline1: \"[dir] [model] [ctx]\"\nline2: \"[label] [dc] [project] [git]\"\n```\n\n## statusline config\n\n`statusline config` opens a full-screen TUI for editing your config without touching YAML. Five tabs: **Layout**, **Appearance**, **Prompts**, **Context**, and **Tokens**. Press `s` to save, `q` to quit.\n\n```bash\nstatusline config\n```\n\n## Environment Variables\n\n| Variable | Description |\n|----------|-------------|\n| `STATUSLINE_CONFIG` | Override config file path |\n| `CLAUDE_CODE_MAX_OUTPUT_TOKENS` | Max output tokens for context % calculation |\n| `CLAUDE_STATUSLINE_ENABLE_PROMPTS` | Set to `0` to hide the prompt trail |\n| `COLUMNS` | Override terminal width detection |\n\n## How It Works\n\nClaude Code pipes a JSON payload to stdin containing model info, context window stats, session ID, and transcript path. `statusline` reads this, detects the project type from the working directory, runs `git status` (with a 1s timeout), tails the transcript for recent prompts, and renders a two-line ANSI-colored status bar to stdout.\n\nThe rendering pipeline:\n\n1. **input.go** -- reads JSON from stdin\n2. **config.go** -- loads config, parses token templates\n3. **project.go** -- detects language stack from directory markers\n4. **dc.go** -- detects dotcommander version\n5. **internal/gitutil/** -- runs `git status --porcelain=v2 --branch`, parses branch + file counts\n6. **tokens.go** -- computes context window health from token usage\n7. **prompts.go** -- tails transcript JSONL, extracts user prompts, classifies with icons\n8. **theme.go** -- Tokyo Night palette (normal + alert mode)\n9. **style.go** -- per-token style overrides\n10. **main.go** -- orchestrates rendering: builds deferred slot builders, collapses line 1, outputs two ANSI lines\n\nPanic recovery ensures Claude Code never sees a crash -- the fallback output is a dot and \"cc\".\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotcommander%2Fstatusline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotcommander%2Fstatusline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotcommander%2Fstatusline/lists"}