{"id":50758582,"url":"https://github.com/sj817/claude-code-plugin-hud","last_synced_at":"2026-06-11T07:32:03.660Z","repository":{"id":362419787,"uuid":"1258977956","full_name":"sj817/claude-code-plugin-hud","owner":"sj817","description":"一个清爽极简的 Claude Code 状态栏插件/A minimal and refreshing statusline for Claude Code.","archived":false,"fork":false,"pushed_at":"2026-06-04T05:42:45.000Z","size":3033,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-04T07:03:19.070Z","etag":null,"topics":["claude","claude-code","claude-code-hud","claude-code-plugin","hud"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/sj817.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-06-04T04:58:29.000Z","updated_at":"2026-06-04T06:29:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sj817/claude-code-plugin-hud","commit_stats":null,"previous_names":["sj817/claude-code-plugin-hud"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/sj817/claude-code-plugin-hud","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sj817%2Fclaude-code-plugin-hud","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sj817%2Fclaude-code-plugin-hud/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sj817%2Fclaude-code-plugin-hud/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sj817%2Fclaude-code-plugin-hud/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sj817","download_url":"https://codeload.github.com/sj817/claude-code-plugin-hud/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sj817%2Fclaude-code-plugin-hud/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34188272,"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-06-11T02:00:06.485Z","response_time":57,"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":["claude","claude-code","claude-code-hud","claude-code-plugin","hud"],"created_at":"2026-06-11T07:32:02.938Z","updated_at":"2026-06-11T07:32:03.656Z","avatar_url":"https://github.com/sj817.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# claude-code-plugin-hud\n\nA two-line statusline for [Claude Code](https://code.claude.com/docs/en/statusline), written in Rust. Shows your model, context window, cost, git branch, and rate limits.\n\nEnglish · [简体中文](./README.zh-CN.md)\n\n![demo](./demo.png)\n\n## Install\n\n### Plugin\n\n```text\n/plugin marketplace add sj817/claude-code-plugin-hud\n/plugin install claude-code-plugin-hud\n/reload-plugins\n/claude-code-plugin-hud:setup\n```\n\n`/reload-plugins` activates the freshly installed command (or restart Claude Code). `/claude-code-plugin-hud:setup` then picks the prebuilt binary for your OS and writes the `statusLine` entry into your `settings.json`. The HUD appears on your next message.\n\nPlugins cannot set `statusLine` directly, so a command does it. Plugin commands are namespaced, hence the `claude-code-plugin-hud:` prefix.\n\n### Script\n\nNo plugin needed. This downloads only the binary for your platform and writes the `statusLine` for you (any existing `settings.json` is backed up first):\n\n```bash\n# macOS / Linux\ncurl -fsSL https://raw.githubusercontent.com/sj817/claude-code-plugin-hud/main/scripts/install.sh | bash\n```\n\n```powershell\n# Windows\nirm https://raw.githubusercontent.com/sj817/claude-code-plugin-hud/main/scripts/install.ps1 | iex\n```\n\nIt installs to `~/.claude/statusline/`; re-run any time to update. The log follows your system language (Chinese or English). Optional overrides: `CLAUDE_HUD_VERSION` pins a release (e.g. `v0.1.6`), `CLAUDE_HUD_LANG` forces the language (`zh` / `en`).\n\n## Anatomy\n\n```text\n███░░░░░ 397k/1M(40%) | +2318 -922 | 💰 $27.62 | ⏱ 3h4m | 🌿 main*    v2.1.161 ⚡high(Opus 4.8)\nQuota: 5h 25% 57m · 7d 38% 2d10h | 🎉Cache: 396k/397k(99%) | 📁 D:/Github/claude-code-plugin-hud\n```\n\n### Line 1\n\n| Segment | Example | Meaning |\n| --- | --- | --- |\n| Context bar | `███░░░░░ 397k/1M(40%)` | Context window used / total. The single progress bar. Green below 70%, yellow below 90%, red at 90%+. |\n| Lines changed | `+2318 -922` | Lines added / removed this session. |\n| Cost | `💰 $27.62` | Session cost in USD. |\n| Duration | `⏱ 3h4m` | Wall-clock time since the session started. |\n| Branch | `🌿 main*` | Git branch. A trailing `*` marks a dirty working tree. |\n| Version · effort(model) | `v2.1.161 ⚡high(Opus 4.8)` | Right-aligned: Claude Code version, reasoning effort, model. |\n\n### Line 2\n\n| Segment | Example | Meaning |\n| --- | --- | --- |\n| Rate limits | `Quota: 5h 25% 57m · 7d 38% 2d10h` | Plan-quota usage per window, with reset countdown. Line 2's focal point: the `%` is colored in four 25% bands — green `\u003c25`, yellow `\u003c50`, orange `\u003c75`, red `≥75`. |\n| Cache | `🎉Cache: 396k/397k(99%)` | Prompt-cache read / total, with hit rate. |\n| Folder | `📁 D:/Github/...` | Working directory, trimmed from the front when long (never below the final component). |\n\nNotes:\n\n- Height is always two lines. Segments never wrap; the lowest-priority ones drop when a line exceeds `$COLUMNS`.\n- Missing data is omitted, not padded. Rate limits are absent before the first API response; the cache breakdown is null right after `/compact`.\n- Colors stay on the standard 16-color ANSI palette, plus a pink `Cache:` label, a soft-gold folder, and an orange band in the quota scale. The `(%)` on the bar and cache are left plain.\n- Permission mode (auto/plan) is not shown: it is not present in the statusline JSON.\n\n## Configuration\n\nThe only setting is `CLAUDE_HUD_ONELINE`. Set it to `1` (or `true`) to render line 1 only, which keeps Claude Code's mode row visible below the prompt:\n\n```text\nCLAUDE_HUD_ONELINE=1\n```\n\nThe HUD also collapses to one line when `$LINES` is below 10. `$COLUMNS` and `$LINES` come from Claude Code v2.1.153+; width falls back to 80 when absent.\n\n## Manual setup\n\nTo skip `:setup`, point `statusLine` at the binary directly:\n\n```jsonc\n// ~/.claude/settings.json\n{\n  \"statusLine\": {\n    \"type\": \"command\",\n    \"command\": \"/absolute/path/to/claude-hud\",\n    \"padding\": 2\n  }\n}\n```\n\nOn Windows, write the path with forward slashes. On Claude Code older than v2.1.153 (no `$COLUMNS`), read the width from the tty with an `stty` shim:\n\n```jsonc\n\"command\": \"cols=$(stty size \u003c/dev/tty 2\u003e/dev/null | awk '{print $2}'); export COLUMNS=${cols:-120}; exec /absolute/path/to/claude-hud\"\n```\n\n## Build from source\n\n```bash\ncargo build --release        # -\u003e target/release/claude-hud\n```\n\nTest with mock input:\n\n```bash\necho '{\"model\":{\"display_name\":\"Opus 4.8 (1M context)\"},\"context_window\":{\"used_percentage\":25,\"total_input_tokens\":50000,\"context_window_size\":200000},\"session_id\":\"x\"}' \\\n  | COLUMNS=120 ./target/release/claude-hud\n```\n\nCross-compile every shipped target into `dist/\u003ctriple\u003e/`:\n\n```bash\nscripts/build-all.sh\n```\n\nThe binary is small (roughly 290 KB to 545 KB depending on platform) and has no runtime dependencies. Shipped targets: Windows x64 and arm64, macOS x64 and arm64, Linux glibc x64 and arm64, Linux musl x64 and arm64.\n\n## Releases\n\nPush a `v*` tag. CI builds every target, commits the binaries into `dist/`, and publishes a GitHub Release:\n\n```bash\ngit tag v0.1.0 \u0026\u0026 git push origin v0.1.0\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsj817%2Fclaude-code-plugin-hud","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsj817%2Fclaude-code-plugin-hud","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsj817%2Fclaude-code-plugin-hud/lists"}