Claude-Pulse: Engineering the AI Terminal's Missing Instrument Cluster

How a reactive status line turned Anthropic's CLI into a high-fidelity cockpit with real-time token tracking and emergency awareness.

8 min read • View on GitHub • More from omriariav

A cross-section of a retro-futuristic jet cockpit with digital dials showing context percentage and token burn.
The modern AI terminal requires instrumentation to prevent context window exhaustion.
Key Takeaways

Flying Blind in the Terminal

Developers using AI assistants in the terminal face a unique psychological toll. The anxiety of the infinite prompt is real. You can be mid-flow on a complex refactor only to be abruptly cut off by a rate limit or a massive billing spike. Standard CLI outputs fail to communicate the burn rate of tokens and context. The system operates as a black box.

Claude-Pulse directly addresses this terminal blindness. It acts as an instrument cluster for Claude Code. By hooking into the official CLI configuration, it transforms a static prompt into a reactive status line. Users finally get a visual progress bar of their context window and precise model tracking right above their cursor.

Coding Under Fire: The Red Alert Daemon

The project's most unique feature was born out of physical necessity. The lead developer integrated national rocket alerts directly into the coding status line. This transforms Pulse from a simple linter into a situational awareness tool.

The system uses a background script called the Red Alert Daemon. It polls the Israeli Home Front Command (Pikud HaOref) API every two seconds. When an alert triggers for a user-configured city, the terminal status line flashes red and plays a native audio warning. It allows developers in conflict zones to balance deep work with life-safety awareness.

The Red Alert Pipeline. Show an "Out-of-Band" architecture. Nodes include Pikud HaOref API connecting to a background red-alert-daemon.sh. The daemon writes to a local state.json file atomically. The claude-pulse CLI loop reads from state.json and outputs to the Terminal UI. Animate a warning signal passing from the API through the daemon to the terminal

The Transcript Tagger: Reverse-Engineering Claude's Logs

Fetching real-time usage data from a cloud API introduces latency and costs tokens. To solve this, Pulse bypasses the network entirely. It uses a log-scraping engine built entirely in Bash and PowerShell.

The script tails Claude Code's internal JSONL transcript files. It parses these logs locally to calculate input tokens, cache creation tokens, and cache read tokens. This approach yields billing-accurate data without relying on external API calls. It reveals a deep understanding of prompt caching architecture.

A mechanical ticker-tape machine translating raw JSON into a clean progress bar.
By scraping local JSONL transcripts, Pulse avoids network latency and API costs while delivering billing-accurate token counts.

The Sidecar Strategy

A status line must have zero latency. If the CLI blocks while waiting for an external API response, the developer experience degrades instantly. Pulse solves this using a sidecar strategy. Heavy external tasks run in background daemons, writing results to atomic local files. The status line simply reads the local file.

The script also employs a resilient fallback logic for model detection. It attempts to parse the high-fidelity transcript first. If that fails, it reads local settings files. If all else fails, it relies on hardcoded defaults. This guarantees the status line never breaks the user's terminal session.

Feature Stock Claude Code Claude Code + Pulse
Quota Visibility Hidden Real-time Progress Bar
Model Transparency Technical ID Friendly Name
External Awareness None Red Alert / PR Status
Cost Tracking Estimated Billing-Accurate

Instrumentation as a Standard

As AI agents execute longer and more complex tasks, the need for visibility grows. The terminal can no longer be a text-only interface. It must evolve into a stateful dashboard. Tools like Claude-Pulse prove that developers demand exactness and transparency over their AI resources.

A split scene showing a developer at a laptop connected by a wire to a spinning radar dish.
Situational awareness is the next frontier for terminal-based AI tools.

The gap between a simple command-line prompt and a fully instrumented cockpit is closing. By combining local log parsing with asynchronous daemons, Pulse models the future of the AI developer environment.


Sources: