Documentation
¶
Overview ¶
clauchy — zero-config Claude Code usage monitor.
Usage:
clauchy # open the TUI dashboard (monochrome, default) clauchy --colorful # open the TUI dashboard with Sky-accented colors clauchy waybar # emit one JSON line for a Waybar custom module clauchy install # add/repair the Waybar module config idempotently clauchy --version # print the build version and exit
The --colorful flag may appear anywhere before or after the mode word. Dashboard mode is the default when no mode word is provided.
The binary is intentionally thin: every domain concern lives in an internal package. main's only job is composition — wiring injected values (HTTP clients, paths, token func, clock) into the domain packages and dispatching to the correct entry point.
Clock seam re-sampling invariant (CRITICAL — §1): the TokenFunc closure and the FetchStats closure both re-sample time.Now() on EVERY call. A captured fixed time would freeze "today" on a long-running dashboard. This is a wiring invariant enforced here by code review, not a unit test.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
cache
Package cache provides a generic, flock-guarded, atomic-write disk cache.
|
Package cache provides a generic, flock-guarded, atomic-write disk cache. |
|
install
Package install idempotently adds the custom/clauchy Waybar module and CSS color block to the user's Waybar configuration files, writes severity-colored SVG icon variants to the data directory, and appends Hyprland window rules so the dashboard panel floats above other windows.
|
Package install idempotently adds the custom/clauchy Waybar module and CSS color block to the user's Waybar configuration files, writes severity-colored SVG icon variants to the data directory, and appends Hyprland window rules so the dashboard panel floats above other windows. |
|
limits
Package limits fetches Claude API usage from the /api/oauth/usage endpoint, caches it in the cache directory (TTL 90s), and tags freshness via an embedded cachedAt timestamp inside the payload.
|
Package limits fetches Claude API usage from the /api/oauth/usage endpoint, caches it in the cache directory (TTL 90s), and tags freshness via an embedded cachedAt timestamp inside the payload. |
|
oauth
Package oauth handles Claude AI credential loading, token refresh, and lossless atomic write-back.
|
Package oauth handles Claude AI credential loading, token refresh, and lossless atomic write-back. |
|
paths
Package paths resolves all filesystem locations used by clauchy from environment variables and the user's home directory.
|
Package paths resolves all filesystem locations used by clauchy from environment variables and the user's home directory. |
|
pricing
Package pricing provides the embedded Claude model rate table, a cost formula, and an optional per-model override loaded from ~/.config/clauchy/pricing.json.
|
Package pricing provides the embedded Claude model rate table, a cost formula, and an optional per-model override loaded from ~/.config/clauchy/pricing.json. |
|
severity
Package severity maps a usage percentage to a severity level.
|
Package severity maps a usage percentage to a severity level. |
|
status
Package status fetches the Claude status page (Atlassian Statuspage) summary, caches it in the cache directory (TTL 180s), and tags freshness via an embedded cachedAt timestamp inside the payload.
|
Package status fetches the Claude status page (Atlassian Statuspage) summary, caches it in the cache directory (TTL 180s), and tags freshness via an embedded cachedAt timestamp inside the payload. |
|
transcript
Package transcript discovers, parses, and aggregates Claude JSONL transcript files into a Stats summary used by the dashboard and waybar output.
|
Package transcript discovers, parses, and aggregates Claude JSONL transcript files into a Stats summary used by the dashboard and waybar output. |
|
ui
|
|
|
dashboard
Package dashboard provides the Bubbletea TUI for Claude Code usage statistics.
|
Package dashboard provides the Bubbletea TUI for Claude Code usage statistics. |
|
theme
Package theme provides the single visual palette shared by both the Waybar renderer and the Bubbletea dashboard.
|
Package theme provides the single visual palette shared by both the Waybar renderer and the Bubbletea dashboard. |
|
waybar
Package waybar builds the JSON payload that Waybar's custom module protocol expects: exactly three keys (text, tooltip, class) with no omitempty.
|
Package waybar builds the JSON payload that Waybar's custom module protocol expects: exactly three keys (text, tooltip, class) with no omitempty. |
