Skip to content

Studio: plotkeeper detects your Claude plan #1061

In review

Description

@danielrispler

Parent

#1056

What to build

plotkeeper detects the plan ("The plan"). plotkeeper statusline saves only the 5-hour and weekly percentages and their reset times, in one file in the data folder, replaced on each call. /usage is read through claude -p only right before and after a run Daniel started (at most once per run and once in 10 minutes) and on a Detect again command, never on a timer or on page open. No rate_limits reads as an API key, weekly rows with no session row as Ultra, and Pro or Max is guessed from the first three runs' change against the engine's factor. Detection writes plan with confirmed: false and never over a confirmed plan. Under the spec's fallback (the trial found /usage unusable), detection and Detect again read only the status-line file. The command to confirm or change the plan is on the wire; the Settings row is the next ticket.

Acceptance criteria

  • server/tests/statusline.rs gains rows with and without rate_limits; only the four numbers are saved
  • A table test of the /usage parser over the fixtures: the trial's captured ones, plus hand-written Ultra, no-rate_limits and null-report ones from the documented shape
  • Tests that detection never overwrites a confirmed plan and never starts a claude call on page open
  • server/tests/wire.rs covers the new command's reply

Reading

Touches

  • Files: server/src/statusline.rs, new server/src/plan.rs, server/src/settings.rs, server/src/runner.rs, server/src/api.rs, ui/types.ts, server/tests/statusline.rs, server/tests/fixtures/usage/, server/tests/wire.rs
  • Session: auto mode, with blocked commands (a real /usage read to check by hand)
  • Route: strong · effort high — persistence (a new file, a settings write) and a trust boundary (parsing the CLI's output)

Activity

  1. added
    ready-for-agent
    on Dec 2, 2026
  2. danielrispler commented on Dec 2, 2026

    @danielrispler
    OwnerAuthor

    Built on the integration branch issue-1056-run-cost, PR #1071 (closes on merge).

    Route outcome: strong·high claude/opus → pass | 36m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions