{"id":50665986,"url":"https://github.com/haunchen/claude-code-statusline","last_synced_at":"2026-06-08T06:05:52.474Z","repository":{"id":348193448,"uuid":"1196799562","full_name":"haunchen/claude-code-statusline","owner":"haunchen","description":"Peak/off-peak aware statusline for Claude Code — shows context usage, session cost, and rate   limits at a glance.","archived":false,"fork":false,"pushed_at":"2026-05-08T14:03:45.000Z","size":33,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-08T16:10:41.147Z","etag":null,"topics":["anthropic","claude","claude-code","cli","cross-platform","developer-tools","nodejs","rate-limit","statusline"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/haunchen.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-03-31T03:46:55.000Z","updated_at":"2026-05-08T14:05:38.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/haunchen/claude-code-statusline","commit_stats":null,"previous_names":["haunchen/claude-code-statusline"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/haunchen/claude-code-statusline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haunchen%2Fclaude-code-statusline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haunchen%2Fclaude-code-statusline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haunchen%2Fclaude-code-statusline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haunchen%2Fclaude-code-statusline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haunchen","download_url":"https://codeload.github.com/haunchen/claude-code-statusline/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haunchen%2Fclaude-code-statusline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34050267,"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-08T02:00:07.615Z","response_time":111,"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":["anthropic","claude","claude-code","cli","cross-platform","developer-tools","nodejs","rate-limit","statusline"],"created_at":"2026-06-08T06:05:32.722Z","updated_at":"2026-06-08T06:05:52.464Z","avatar_url":"https://github.com/haunchen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Claude Code Statusline\n\n[English](README.md) | [繁體中文](README_zh-TW.md)\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-blue)\n![Node.js](https://img.shields.io/badge/node.js-%3E%3D14-brightgreen)\n\n\u003e [!WARNING]\n\u003e **Deprecation notice (2026-05-06)** — Anthropic [removed the peak hours limit reduction](https://www.anthropic.com/news/higher-limits-spacex) on Claude Code for Pro and Max plans and doubled the 5-hour rate limits. The peak/off-peak indicator is no longer informative for most users; the rest of the statusline (context, cost, rate limits) still works. This repo is kept for historical reference and is no longer actively maintained.\n\nA cross-platform statusline for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) that displays peak/off-peak hour awareness, context window usage, session cost, and rate limits — all in one glance. Zero configuration required.\n\n![Off-peak statusline showing green OFF-PEAK indicator with model, context, cost and rate limit info](screenshots/off-peak.png)\n![Peak statusline showing red PEAK indicator with countdown timer](screenshots/peak.png)\n\n## Why?\n\nDuring peak hours, Claude Code burns through your 5-hour session limit faster. This statusline lets you see at a glance whether you're in peak or off-peak hours, how much of your rate limit you've used, and when it resets — so you can plan your usage accordingly.\n\n## Background\n\nIn March 2026, Anthropic [announced](https://x.com/trq212/status/2037254607001559305) adjustments to Claude's 5-hour session limits during peak hours:\n\n\u003e \"During weekdays between 5am–11am PT / 1pm–7pm GMT, you'll move through your 5-hour session limits faster than before.\"\n\u003e — Thariq Shihipar, Anthropic\n\nAbout 7% of users are affected. Weekly limits remain unchanged. Weekends are entirely off-peak.\n\nSee also: [Claude March 2026 Usage Promotion](https://support.claude.com/en/articles/14063676-claude-march-2026-usage-promotion) (expired)\n\n### Peak hours by timezone\n\n| Timezone | Peak hours (weekdays only) |\n|----------|---------------------------|\n| PT (UTC-8) | 05:00 – 11:00 |\n| ET (UTC-5) | 08:00 – 14:00 |\n| GMT (UTC+0) | 13:00 – 19:00 |\n| CET (UTC+1) | 14:00 – 20:00 |\n| IST (UTC+5.5) | 18:30 – 00:30+1 |\n| CST (UTC+8) | 21:00 – 03:00+1 |\n| JST/KST (UTC+9) | 22:00 – 04:00+1 |\n\nWeekends are **all-day off-peak** regardless of timezone.\n\n\u003e For users in Asia (UTC+8/+9), normal working hours (9am–6pm) are entirely off-peak. Peak hours fall late at night when most people are asleep.\n\n## Features\n\n- **Peak/off-peak indicator** — real-time status with countdown timer during peak hours\n- **Context window usage** — percentage with color coding (green → yellow → red)\n- **Session cost** — running total in USD\n- **5-hour rate limit** — usage percentage with reset countdown\n- **7-day rate limit** — usage percentage\n- **Zero configuration** — auto-detects peak hours via UTC, works in any timezone\n- **Cross-platform** — single Node.js script runs on Windows, macOS, and Linux\n\n## Prerequisites\n\n- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI\n- [Node.js](https://nodejs.org/) (any recent version)\n\nNode.js was chosen over bash specifically for cross-platform compatibility — the same script runs identically on Windows, macOS, and Linux without modification.\n\n## Quick Start\n\n### Option 1: Installer\n\n**macOS / Linux:**\n\n```bash\ngit clone https://github.com/haunchen/claude-code-statusline.git\ncd claude-code-statusline\nbash install.sh\n```\n\n**Windows (PowerShell):**\n\n```powershell\ngit clone https://github.com/haunchen/claude-code-statusline.git\ncd claude-code-statusline\npowershell -ExecutionPolicy Bypass -File install.ps1\n```\n\nThe installer will:\n1. Check that Node.js is installed\n2. Ask where to install the script (default: `~/.claude/`)\n3. Back up your existing `~/.claude/settings.json`\n4. Add the statusLine configuration\n\n### Option 2: Manual setup\n\n1. Clone this repo anywhere on your machine\n2. Add to `~/.claude/settings.json`:\n\n```json\n{\n  \"statusLine\": {\n    \"type\": \"command\",\n    \"command\": \"node /path/to/claude-code-statusline/statusline.js\",\n    \"padding\": 0\n  }\n}\n```\n\n3. Restart Claude Code\n\n### Option 3: Let Claude Code do it\n\nRun `/statusline` inside Claude Code and paste this prompt:\n\n\u003e Show peak/off-peak hours for Claude Code based on my timezone. During peak hours (weekdays 5am-11am PT), show \"PEAK\" in red with a countdown. During off-peak, show \"OFF-PEAK\" in green. Weekends are always off-peak. Also show: model name, context usage %, session cost, 5-hour rate limit % with reset countdown, and 7-day rate limit %. Color-code percentages green/yellow/red at 60%/80% thresholds.\n\n## Customization\n\n### Use a simpler version\n\nCheck the `examples/` folder:\n\n| File | What it shows |\n|------|---------------|\n| `examples/minimal.js` | Peak/off-peak + model name only |\n| `examples/with-rate-limits.js` | Peak/off-peak + model + rate limits |\n| `statusline.js` | Everything (peak, context, cost, rate limits) |\n\n## How it works\n\nClaude Code runs the statusline script after each assistant message. It pipes a JSON object to stdin containing session data:\n\n```json\n{\n  \"model\": { \"display_name\": \"Opus\" },\n  \"context_window\": {\n    \"context_window_size\": 200000,\n    \"used_percentage\": 8,\n    \"current_usage\": { \"input_tokens\": 15000, \"cache_read_input_tokens\": 2000, \"...\" : \"...\" }\n  },\n  \"cost\": { \"total_cost_usd\": 0.0123 },\n  \"rate_limits\": {\n    \"five_hour\": { \"used_percentage\": 23.5, \"resets_at\": 1738425600 },\n    \"seven_day\": { \"used_percentage\": 41.2, \"resets_at\": 1738857600 }\n  }\n}\n```\n\nThe script reads this JSON, determines peak/off-peak status, and prints the formatted statusline to stdout.\n\n### Peak detection logic\n\nSince Anthropic defines peak hours as \"1pm–7pm GMT\", the script checks directly against UTC — no timezone conversion or configuration needed:\n\n```javascript\nconst utcHour = new Date().getUTCHours();\nconst isPeak = !isWeekend \u0026\u0026 utcHour \u003e= 13 \u0026\u0026 utcHour \u003c 19;\n```\n\nWeekday/weekend is checked in PT (UTC-8) since Anthropic defines \"weekday\" by Pacific Time. This avoids edge cases at local midnight where the local day may differ from the PT day.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaunchen%2Fclaude-code-statusline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaunchen%2Fclaude-code-statusline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaunchen%2Fclaude-code-statusline/lists"}