DEV Community

Cover image for I lost 40 minutes to an AI agent that had already crashed. So I built a nervous system for all of them.
Dipen Dedania
Dipen Dedania

Posted on

I lost 40 minutes to an AI agent that had already crashed. So I built a nervous system for all of them.

I gave Claude Code a gnarly refactor, hit enter, and switched to something else. That's the whole promise of agentic coding, right? Fire and forget.

Forty minutes later I tabbed back to check on it.

It had died in the first ninety seconds.

A transient error, a half-printed stack trace, and then… nothing. The terminal just sat there, cursor blinking, looking exactly like an agent deep in thought. I had spent forty minutes "letting it cook" while it was stone cold.

And here's the part that actually stung: I wasn't even sure which agent I'd left it running in. Claude Code? The Cursor pane? The Codex tab I'd opened that morning? I now have seven of these things installed — Claude Code, Cursor, Copilot, Codex, Kiro, Antigravity, Grok — and checking on them had quietly become a full-time tab-hopping job.

I was paying an alt-tab tax on every single agent run. And the tax kept going up.

So I built the thing I wanted: Agent Pulse — ambient, glanceable awareness of every AI coding agent on your machine, in a floating frosted-glass bubble that lives on your desktop.

Agent Pulse bubbles floating on the desktop


The idea in one sentence

Your agents already emit lifecycle events. Nobody was listening. Agent Pulse listens — and turns them into a single, ambient heartbeat you can see from across the room.

A soft pulsing glow means working. A calm breathing effect means idle. A red shake means your agent just died — so you find out in two seconds, not forty minutes.

That's it. That's the whole pitch. Everything below is the fun part: how it actually works, and the genuinely strange things I found out trying to make seven very different tools speak the same language.


Part 1: Seven tools, seven dialects, one schema

Every one of these agents can tell you what it's doing. The problem is they all do it differently:

  • Claude Code fires PreToolUse, Stop, and friends and can POST them over HTTP.
  • Cursor, Copilot, Codex, Kiro, and Antigravity run shell hooks — they shell out to a script on lifecycle events.
  • Grok's runtime blocks HTTP hooks (SSRF protection), so it needs a command hook writing to a dedicated file.

None of them agree on event names. None agree on payload shape. Some don't even agree on where their config lives.

So the core of Agent Pulse is boring in the best way: a tiny local HTTP bridge on localhost:4242 that ingests everyone's events and normalizes them into one schema:

// The entire vocabulary. Every tool, every event, collapses into this.
type AgentState = "working" | "waiting" | "idle" | "error" | "dead";
Enter fullscreen mode Exit fullscreen mode

PreToolUseworking. Stopidle. A non-zero exit → dead. One-click install writes the right hook into the right config file for each tool (~/.claude/settings.json, ~/.cursor/hooks.json, .kiro/hooks/…, and so on), and one click removes it again. No manual JSON surgery.

The bubbles are just a thin, pretty layer on top: React 19 + Tailwind 4 + Framer Motion, always-on-top, draggable, glassmorphic. The hard part was never the glow. It was getting seven vendors to agree on what "busy" means.


Part 2: The rabbit holes nobody warns you about

This is the section I'd have killed to read before starting. If you're building anything that observes AI agents, save yourself the weeks:

🕳️ Copilot's logs don't contain token counts. At all. VS Code Copilot's hooks give you lifecycle state and sometimes a model name, but no real token usage — not even in the transcript. Every tool that shows you "Copilot tokens" is re-tokenizing the text and estimating (a common heuristic is ~0.25 tokens/char plus a tool-call fudge factor). I went looking for ground truth and found there wasn't any.

🕳️ Codex over-reports if you're naive about it. Codex tokens live in a rollout file as cumulative diffs. If you just sum the tail like a reasonable person would, you overcount by ~5%. You have to read the cumulative-diff structure.

🕳️ Cursor's real usage is behind a cookie you have to reconstruct. The only source of truth for Cursor usage is cursor.com/api/usage-summary — authenticated with a session cookie you rebuild from the access token sitting in Cursor's local state.vscdb.

🕳️ "Learned limits" are a trap. Some tools guess your rate limits from usage history. I decided early: never guess billing. Agent Pulse polls real quota APIs (Anthropic's OAuth usage endpoint, Codex's usage backend, Cursor, Antigravity) — and all cost figures are clearly labeled estimated API list prices, never your actual subscription bill. Trust is the whole product.

The meta-lesson: the ecosystem is wildly inconsistent, and most "analytics" you see are educated guesses wearing a suit. Being honest about that turned out to be a feature.


Part 3: The part that surprised even me

Once you have a reliable signal for "is this agent working or idle," you can build things that felt like sci-fi a year ago.

A self-running backlog. There's a Kanban board where you queue tasks. Define a scheduler window (say, "weeknights 8pm–11pm"), and Agent Pulse feeds queued cards to your agents while you're asleep. Execution tasks run in an isolated git worktree and hand you back an uncommitted diff — with an optional QA gate that runs your tests/lint/typecheck and auto-retries once before flagging the card as blocked. You wake up to a stack of reviewable diffs, not a mess.

Attention that finds you. When an agent sits in the waiting state past a threshold, Agent Pulse escalates: intensifies the bubble, raises an OS notification, and can ping Discord or Slack with the task summary and how long it's been stuck. Your agent needs you? You'll know — even away from your desk.

A local timeline. Every normalized event lands in a local SQLite DB (no telemetry, all on your machine). That gives you a GitHub-style activity heatmap, an hour-of-day rhythm chart ("apparently I pair with agents most at 11pm, cool, cool"), a tool-mix breakdown, and estimated-cost analytics.

None of this needed a new API. It all falls out of listening to signals that were already there.


Why this resonates (and why I think you'll feel it too)

We crossed a line recently and barely noticed. We stopped having one AI assistant and started running a fleet. But our tooling still assumes one agent, one terminal, one tab.

Managing a fleet by alt-tabbing is like monitoring a server farm by SSH-ing into each box every few minutes to run top. At some point you build a dashboard. Agent Pulse is that dashboard — but ambient, so it fades into your peripheral vision until something actually needs you.

  • You don't check on it. It taps you on the shoulder.
  • It's local-first. No account, no telemetry, no cloud. The bridge is loopback-only.
  • It's open source (AGPLv3), cross-platform (Windows / macOS / Linux), and adding a new tool is a documented, welcomed contribution.

Try it (2 minutes)

git clone https://github.com/Dipen-Dedania/agent-pulse.git
cd agent-pulse
npm install
npm run rebuild:native   # for the local SQLite timeline
npm start
Enter fullscreen mode Exit fullscreen mode

Or grab a prebuilt installer from the Releases page — Windows .exe, macOS .dmg, Linux .AppImage.

Then open Settings, click Install hook next to whichever agents you use, and watch the bubbles come alive.


I want to hear from you

Two questions, and I'll reply to every comment:

  1. How many AI coding agents are you running right now? Be honest. I bet it's more than you think.
  2. Which tool should I add support for next? Open a request or drop it below.

If this saved you even one "wait, it crashed 40 minutes ago?!" moment, a ⭐ on the repo is the best thank-you — it's genuinely what decides whether the next person finds it.

Now go check on your agents. One of them is probably lying to you about being busy. 👀

Top comments (0)