Skip to content

Windows daemon: multi config-dir + active-plan parity (follow-up to #95) #97

Description

@HermannBjorgvin

🤖 AI Generated:

Follow-up to #95, which added optional multi Claude config-dir polling with active-plan selection to the Linux (bash) and macOS/Linux (Python) daemons. The Windows daemon (daemon/claude_usage_daemon_windows.py) does not yet support it.

Current state

  • The Windows daemon already reads the config file (%LOCALAPPDATA%\Clawdmeter\config) for clock and chime, so the config-file plumbing exists.
  • Token discovery is single-plan: _windows_credential_candidates() resolves ONE token from CLAUDE_CREDENTIALS_PATH / CLAUDE_CONFIG_DIR env overrides or a fixed fallback list.

What to add (mirror #95)

  • Read a config_dirs key (comma-separated list) from the config file; default to the existing single-token behavior when unset (no change for current users).
  • read_token_for(dir) — resolve a token per configured dir (each dir's .credentials.json); keep the current candidate-list behavior for the default/unset case.
  • A PlanSelector equivalent: "active" = the plan whose 5h session % rose most recently (monotonic poll counter, so the choice is sticky; a window reset/drop isn't activity; startup falls back to the highest current %).
  • Poll each configured dir per cycle and send the active plan's payload.

Tests

The Windows daemon has a solid pytest suite (daemon/tests/test_windows_*.py). Add selector + dir-parsing + token-per-dir tests, mirroring daemon/tests/test_macos_multidir.py from #95.

Notes

  • Windows config path differs from Linux/macOS (%LOCALAPPDATA%\Clawdmeter\config vs ~/.config/claude-usage-monitor/config).
  • Installer prompts are tracked separately (see the install-windows.ps1 follow-up).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions