feat: Claude Status widget with incident history strip - #553
Open
JimmySpivey wants to merge 1 commit into
Open
Conversation
Adds a claude-status widget showing the current Claude/Anthropic service
status from status.claude.com ("ok" for the none indicator, otherwise the
indicator word). An optional 48-hour incident-history strip (toggled with
'h' in the editor) renders eight six-hour buckets colored by the worst
incident overlapping each bucket: green none, yellow minor, orange major,
red critical; impact-none incidents are ignored.
Status and incident responses are cached on disk for ~5 minutes with a
30-second failure backoff, mirroring the usage-fetch/prefetch
architecture; on network failure the widget serves stale data or degrades
to "?" without breaking the status line.
The history strip embeds its own per-bucket foreground codes, so the
custom-command preserve-colors handling in the renderer is generalized
into an optional Widget.preservesRenderedColors() hook (backed by a
widgetPreservesColors() helper) that both widgets now implement. Bar
colors reset only the foreground so powerline backgrounds survive.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A new
claude-statuswidget showing live Claude/Anthropic service health from status.claude.com, with an optional incident-history strip./api/v2/status.json—ok/minor/major/critical/maintenance, severity-colored; degrades to?on fetch/parse failure without breaking the line.hin the editor): the past 48h as 8 six-hour buckets, one▮each, colored by the worst incident whosecreated_at → resolved_atwindow overlaps the bucket (green none / yellow minor / orange major / red critical). Built from/api/v2/incidents.json, which is only fetched when some item has history enabled.How
src/utils/claude-service-status.ts) modeled on the existing usage prefetch: async prefetch wired next to usage prefetch inccstatusline.ts, disk cache in~/.cache/ccstatusline/with 5-min TTL, 30s failure backoff, stale-cache fallback, HTTPS_PROXY support, zod-validated parsing.custom-command. Generalized it into an optionalpreservesRenderedColors()on the Widget interface (implemented by CustomCommand — behavior unchanged — and ClaudeStatus in history mode). Bars reset foreground only (ESC[39m) so powerline backgrounds survive.#ff8700otherwise.colorLevel: 0emits plain text.Testing
bun run lintandbun run buildpass;bun test1891 pass with the same single pre-existing flake (global-command-resolution) that fails on pristine main.🤖 Generated with Claude Code