Dashboard disk-usage card #8

Closed
opened 2026-04-16 22:44:59 +00:00 by claude-desktop · 0 comments
Collaborator

User story

As ops, I want the dashboard to show how much disk and how many entries the cache and session store occupy, so that growth is visible at a glance and a runaway accumulation surfaces before it fills the disk.

Acceptance criteria

Backend endpoint (src/main.ts)

  • GET /storage returns JSON:
    {
      "cache_clones": { "count": <n>, "bytes": <n> },
      "worktrees":    { "count": <n>, "bytes": <n> },
      "sessions":     { "count": <n>, "bytes": <n> }
    }
    
  • Sizes computed by recursive directory walk (Bun has no native du; small helper is fine)
  • Endpoint is cheap to call (≤500 ms at the expected scale of ~50 worktrees) — if it grows past that, cache the result for 60s

Frontend (src/dashboard.html)

  • New card "Storage" rendering the three counts + human-formatted sizes (KB/MB/GB)
  • Refreshes every 60s alongside the rest of the dashboard
  • Visual style matches existing cards (CSS custom properties already defined)

Tests

  • Backend unit test for the size walk (tempdir with known content)
  • No frontend tests required (manual verify)

Out of scope

  • Per-agent breakdown (could land in a v0.3 follow-up if the headline number isn't enough)
  • Alerting / thresholds (separate concern)

References

  • Discussion: chat history, "Phase 3 — housekeeping"

Dependencies

  • Blocked by: #5 (paths must exist to be meaningful; sessions count is 0 until #6 but the card still renders)
  • Blocks: none (observability leaf)
  • Branch off: issue-5-runagent-integration
  • Full graph: #10
## User story As **ops**, I want the dashboard to show how much disk and how many entries the cache and session store occupy, so that growth is visible at a glance and a runaway accumulation surfaces before it fills the disk. ## Acceptance criteria ### Backend endpoint (`src/main.ts`) - [ ] `GET /storage` returns JSON: ```json { "cache_clones": { "count": <n>, "bytes": <n> }, "worktrees": { "count": <n>, "bytes": <n> }, "sessions": { "count": <n>, "bytes": <n> } } ``` - [ ] Sizes computed by recursive directory walk (Bun has no native `du`; small helper is fine) - [ ] Endpoint is cheap to call (≤500 ms at the expected scale of ~50 worktrees) — if it grows past that, cache the result for 60s ### Frontend (`src/dashboard.html`) - [ ] New card "Storage" rendering the three counts + human-formatted sizes (KB/MB/GB) - [ ] Refreshes every 60s alongside the rest of the dashboard - [ ] Visual style matches existing cards (CSS custom properties already defined) ### Tests - [ ] Backend unit test for the size walk (tempdir with known content) - [ ] No frontend tests required (manual verify) ## Out of scope - Per-agent breakdown (could land in a v0.3 follow-up if the headline number isn't enough) - Alerting / thresholds (separate concern) ## References - Discussion: chat history, "Phase 3 — housekeeping" ## Dependencies - **Blocked by:** #5 (paths must exist to be meaningful; sessions count is 0 until #6 but the card still renders) - **Blocks:** none (observability leaf) - **Branch off:** `issue-5-runagent-integration` - **Full graph:** #10
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks#8
No description provided.