Skip to content

menubar: Claude Code/coding-assistant rate-limit monitoring in the menu bar app #44

Description

@kazukinakai

Problem / outcome

mindbase/apps/menubar-swift already runs as a native macOS menu bar app (MenuBarExtra +
FSEvents) with health monitoring and an auto-collection toggle, but it has no visibility into
AI coding tool usage/rate limits. Users who already have this app running have no single place
to see how close they are to hitting a rate limit across the coding assistants they use.

Evidence and current behavior

  • mindbase/apps/menubar-swift/Sources/MindBaseMenubar/MindBaseMenubar.swift(375 lines)
    implements menu bar residency, health monitoring (URLSession), and an auto-collection toggle.
    No rate-limit/usage/quota display exists (grep -i "rate.limit\|usage\|quota" against this
    file returns zero matches).
  • The app already has a ConversationWatcher (FSEvents) monitoring ~/.claude, ~/.cursor,
    and ~/Library/Application Support/Windsurf — i.e. it already knows where these tools keep
    their local state, which is the natural place to also read rate-limit/usage data from.

Reproduction or baseline

Current: swift build --configuration release && ./.build/release/MindBaseMenubar, then opening
the menu shows only health status and the auto-collection toggle — no usage/rate-limit info.

Expected behavior

  • The menu bar app's menu shows current rate-limit/usage status for the coding assistants it
    already watches (at minimum Claude Code; extensible to others).
  • The data is read from each tool's existing local state (no new login/credential required —
    same local-first philosophy as the rest of the app).
  • If a data source is temporarily unreadable, the app does not crash; it shows a clear
    "unavailable" state for that source instead.

Scope

  • Add rate-limit/usage display to mindbase/apps/menubar-swift.
  • Read rate-limit/usage data from each tool's existing local state files.

Non-goals

  • Any change to how conversations are collected/stored (existing ConversationWatcher behavior
    is unchanged).
  • Cross-tool routing/optimization logic — this Issue is display-only.

Acceptance criteria

  • AC-1: Given the menubar app is running, when the user opens the menu, then Claude Code's
    rate-limit percentage (5h/7d windows) is shown.
  • AC-2: Given a rate-limit data source is temporarily unreadable, when the user opens the
    menu, then the app does not crash and shows an explicit "unavailable" indicator for that
    source instead of stale or fabricated data.
  • AC-3: The existing health-monitoring and auto-collection-toggle behavior is unchanged after
    this change (no regression).

Verification plan

Criterion Verification Expected
AC-1 swift test --package-path mindbase/apps/menubar-swift (new test) exit 0; rate-limit display logic test passes
AC-2 Same, missing-data-source fallback test exit 0; no crash
AC-3 Existing test suite under Tests/MindBaseChatTests (or equivalent) exit 0

Risks, dependencies, rollout

  • No dependency on other Issues; this is additive to the existing app.

Clarifications and assumptions

  • Assumption: the exact source of rate-limit data (which local file/path per tool) is an
    implementation detail left to the implementer; AC-1/AC-2 verify correctness by observed
    behavior rather than by a specific file path.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions