MCPcopy Index your code
hub / github.com/anniebuildz/freshquota

github.com/anniebuildz/freshquota @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
43 symbols 168 edges 12 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Fresh Your Quota

Optimize your Claude Code 5-hour rolling window quota by automatically triggering the window at the best time — even while your Mac is asleep.

How it works

Claude Code subscribers have a usage quota that resets every 5 hours from first use. If you start using Claude at 9 AM, your quota resets at 2 PM. But if you could trigger that window at 7 AM (before you wake up), the reset would happen at noon — right in the middle of your productive hours.

freshquota analyzes your usage patterns, finds the optimal trigger time, and wakes your Mac to activate the window automatically.

Requirements

  • macOS (uses launchd + pmset for scheduling)
  • Node.js >= 18
  • Claude Code CLI installed and authenticated
  • sudo access (one-time, for pmset wake scheduling)

Install

npm install -g github:anniebuildz/freshquota

Usage

1. Analyze your usage patterns

freshquota analyze

Shows your hourly usage distribution and recommends an anchor time. Confirm to save.

To set manually:

freshquota analyze --anchor 07:30

2. Activate scheduling

freshquota install

Registers the launchd job and schedules the first pmset wake. Requires sudo for pmset.

3. Check status

freshquota status

4. Manual trigger

freshquota trigger

5. Health check

freshquota doctor

Verifies the scheduling chain is intact and repairs if needed.

6. Uninstall

freshquota uninstall

How scheduling works

  1. pmset schedule wake wakes your Mac at the anchor time (works with lid closed)
  2. launchd detects the wake and runs freshquota run
  3. The tool checks if the window is already active — if so, skips
  4. Otherwise, sends a minimal Claude CLI request to activate the window
  5. Schedules tomorrow's pmset wake
  6. Mac goes back to sleep

License

MIT

Core symbols most depended-on inside this repo

readState
called by 12
src/state.mjs
writeState
called by 11
src/state.mjs
isWindowActive
called by 8
src/trigger.mjs
findOptimalAnchor
called by 7
src/analyzer.mjs
notifyTriggerResult
called by 6
src/notifier.mjs
formatAnchor
called by 6
src/analyzer.mjs
parseHistory
called by 5
src/analyzer.mjs
filterRecent
called by 4
src/analyzer.mjs

Shape

Function 43

Languages

TypeScript100%

Modules by API surface

src/analyzer.mjs14 symbols
src/cli.mjs10 symbols
src/scheduler.mjs8 symbols
src/trigger.mjs5 symbols
src/state.mjs3 symbols
src/notifier.mjs2 symbols
test/analyzer.test.mjs1 symbols

For agents

$ claude mcp add freshquota \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact