feat: Claude Code Monitor — lanes, pipelines and a merged workspace

Internal SmartGift build of a Claude Code monitoring dashboard.

Lanes: a durable unit of parallel agent work, one per working directory,
tracked across session restarts. Managed lanes are git worktrees the
dashboard provisions and can reset or remove behind a three-check destroy
guard and a counted preflight; adopted lanes are directories you already
own and are never destroyable.

Pipelines: a lane moves through pipeline stages. A stage the agent declares
with evidence renders green; a stage inferred from the tool-event stream
renders dashed amber and never counts as done. Detection is forward-only
within a 30-minute window, and never writes the declared stage.

Workspace: one page at /run with a lane grid, the selected lane's pipeline,
and a full Claude console behind a disclosure.
This commit is contained in:
2026-07-29 17:07:45 +07:00
commit 57dc91585d
783 changed files with 221743 additions and 0 deletions
@@ -0,0 +1,35 @@
---
description: Print the Agent Monitor dashboard URL and how to start/open it
---
Print how to open the Claude Code Agent Monitor dashboard. Do not start anything
or modify data — just print the URL and the relevant commands.
The dashboard URL is:
```
http://localhost:4820
```
Print these in a short block:
- **URL:** `http://localhost:4820`
- **Start (production):** `npm run setup` then `npm start` from the repo root
- **Start (dev, live reload):** `npm run dev` from the repo root
Detect the platform:
```bash
uname -s
```
If the result is `Darwin` (macOS), also suggest opening it directly:
```bash
open http://localhost:4820
```
On Linux suggest `xdg-open http://localhost:4820`; otherwise just tell the user
to open `http://localhost:4820` in a browser.
Keep the output to a few lines — no preamble.
+30
View File
@@ -0,0 +1,30 @@
---
description: Check Agent Monitor reachability and print UP/DOWN with latency
---
Check whether the dashboard API is reachable and report latency.
Run:
```bash
curl -s -o /dev/null -m 5 -w '%{http_code} %{time_total}s' http://localhost:4820/api/stats
```
`%{http_code}` is the HTTP status and `%{time_total}` is the total round-trip
time in seconds.
Print one line:
- If the request succeeds with a 2xx status:
```
✅ UP | http://localhost:4820/api/stats | 200 | 0.042s
```
(use the real status code and the real latency, converting seconds to ms if
clearer, e.g. `42ms`).
- If `curl` exits non-zero (connection refused/timeout) or the status is not 2xx:
```
❌ DOWN | http://localhost:4820/api/stats unreachable — start it with `npm start` (or `npm run dev`) from the repo root
```
Output only the single line — no preamble. Do not modify any data.
+30
View File
@@ -0,0 +1,30 @@
---
description: One-line Agent Monitor health + counts summary from /api/stats
---
Fetch the dashboard stats and print a single-line health summary.
Run:
```bash
curl -s -m 5 http://localhost:4820/api/stats
```
Then print exactly one line summarizing health and key counts from the JSON,
in this shape:
```
✅ UP | 127 sessions | 3 active | 1 agents | 4,892 events | 42 today | 2 ws
```
Pull the numbers from these fields: `total_sessions`, `active_sessions`,
`active_agents`, `total_events`, `events_today`, `ws_connections`.
If the `curl` command fails (non-zero exit, empty body, or unparseable JSON),
print instead:
```
❌ DOWN | dashboard not reachable at http://localhost:4820 — start it with `npm start` from the repo root
```
Do not modify any data. Output only the single summary line — no preamble.