AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Nov 8, 2026, 06:00 JST

PowerShell script auto-spends unused Claude Code, Codex, Antigravity quotas

Send on LINE
PowerShell script auto-spends unused Claude Code, Codex, Antigravity quotas

3 Key Points

  1. What happened

    A developer published a PowerShell script that Windows Task Scheduler runs hourly, reading the weekly usage of Claude Code, Codex, and two Antigravity buckets without spending tokens, then launching unattended AI work on any quota tracking below a pace line.

  2. Why it matters

    It offers a cheap way to wring more value from subscription AI plans whose unused weekly quota otherwise resets, while keeping the user's own access safe because their usage feeds back into the same tracking.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

Context & Analysis

The author's motivation was personal: weeks where Claude's usage limit reset before it was fully used felt wasteful. The script watches four separate subscription slots — Claude Code, Codex, and Antigravity's Gemini and Claude/GPT buckets — and only wakes an AI on the ones at risk of going unused.

The first design tried to forecast end-of-week usage from the current average, but the author found that self-testing inflated the pace and that Antigravity's weekly window begins at first use, making early forecasts unreliable. The fix replaced prediction with a simple pace line: run work when usage sits below a target proportional to the week's elapsed time, wait when it sits above. This also protects the human user's own access, since their usage counts toward the same percentage.

A second lesson was that AI agents told to fill a time slot stopped after a minute or two. Switching to a count-based instruction (at least three deliverables) and restarting from a progress file when they finish early made them work much closer to the allotted time. The author also added guardrails against prompt injection and irreversible actions, noting that acceptEdits was found in testing to allow rm -rf.

FAQ
How does the script read usage without spending tokens?
For Claude Code it parses the JSON output of 'claude -p /usage --output-format json'; for Codex it reads rate_limits left in session log files; for Antigravity it parses the groups and buckets from 'agy -p /usage --output-format json'.
Why did the author abandon predicting weekend usage from pace?
Predictions jumped wildly within minutes because the author's own test runs lifted the average, and Antigravity's weekly window starts when first used, so elapsed time was near zero early on. A fixed pace line based only on current usage and time proved stable.
What safety limits stop unattended AI from spending money or making irreversible changes?
The setup withholds browser and PC control, blocks reading credential files, explicitly denies commands like Bash(rm:*), backs up daily, and leaves code execution to Codex because Windows Claude Code has no sandbox.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleHiddenInk: catching prompt injections tucked into PDFs