Detailed Analysis
A developer in the Claude user community has built and open-sourced a lightweight macOS widget that displays real-time Claude session usage and weekly consumption data, addressing a friction point that many power users of Anthropic's Claude Code product encounter. Rather than navigating through multiple layers of the claude.ai interface to monitor usage limits, the widget runs a background script every ten minutes that leverages the user's existing Claude Code authentication token stored in the macOS keychain. The script makes a minimal API call — sending a single word and requesting a single token in return — solely to capture the usage metadata Anthropic attaches to every API response. That metadata is written to a local JSON file (`~/.claude/session-usage.json`), which the widget then reads to render a usage card. The developer notes the approach bills against the Claude subscription rather than pay-as-you-go credits, keeping operational cost negligible.
The article also describes a companion tool called `sleepwork`, a Claude Code plugin that solves a distinct but related problem: scheduling Claude Code agent jobs to run on a local machine without requiring any application to remain open. The core innovation is wrapping Claude's headless CLI (`claude -p`) and delegating job scheduling to `launchd`, macOS's native OS-level scheduler. This allows a user to issue a natural-language command like `/sleepwork scrape all the transcripts from the 8 most recent videos at 2am`, after which the Mac can go to sleep entirely and launchd fires the job on next wake. The workflow includes autonomous steps: converting the user's request into a structured brief, running the full Claude Code agent headlessly against it, self-testing the output, writing a results file, and deleting its own scheduled job upon completion. The developer explains that this fills a genuine gap left by Anthropic's own scheduling primitives — cloud Routines run on Anthropic's servers and lack local file access, while `/loop` and Desktop scheduled tasks all require an open terminal or application window.
The motivations behind both tools illuminate a broader pattern in the Claude power-user ecosystem: official tooling optimizes for the median use case and cloud-first workflows, leaving locally-oriented, automation-heavy users to build their own infrastructure. Anthropic's `/schedule` feature, for instance, intentionally runs on its own servers against fresh clones — a sensible default for safety and reproducibility, but structurally incompatible with workflows that depend on local files, local servers, or machine-specific state. The `sleepwork` approach sidesteps this by treating Claude Code as a headless subprocess rather than an interactive session, a pattern increasingly common among developers who want agentic AI capabilities embedded in traditional Unix-style job scheduling rather than cloud orchestration platforms.
The release reflects the maturation of Claude Code as a platform around which a third-party tooling ecosystem is beginning to form. Claude Code's decision to store authentication credentials in the macOS keychain and expose a stable CLI interface (`claude -p`) has created the surface area necessary for community developers to build integrations that Anthropic itself has not prioritized. The session-usage widget and `sleepwork` plugin are both thin wrappers around existing Anthropic infrastructure — they introduce no new AI capability — but they dramatically lower the friction of operating Claude Code as part of automated, overnight, or unattended workflows. This kind of peripheral tooling tends to be a leading indicator of platform adoption depth, suggesting that at least a segment of Claude Code's user base has moved well beyond interactive use into treating the system as a programmable, schedulable component of larger personal automation stacks.
Read original article →