On a Monday a few weeks ago, I set up a job that asked Claude to look at a folder every thirty minutes. The folder is where I export store reviews for the wallpaper app I run as an indie developer. If new reviews had arrived, Claude would summarize them and flag the ones that needed a reply. That was the whole job.
By Thursday evening, the usage bar in settings was far further along than in a normal week. I had actually been chatting less than usual, so I remember a small knot forming in my stomach. When I went back through the logs, I found that Claude was waking up on every run — including the runs where nothing had changed — reading the folder, and politely reporting, "There are no new reviews."
The thing I most want to pass on is this: the cost of a recurring job is set by how many times the AI is woken up, not by how many times it does useful work. And deciding whether it needs to wake up is usually something you can answer without an AI at all.
How to tell whether "check-only" runs are eating your allowance
Around the same time, someone filed a similar report as issue #110395 in the claude-code repository. They had asked Claude Code in the desktop app to set up recurring automations on a third-party agent service, and simple condition checks — "new mail?", "is the process running?" — were built as full AI executions every five to ten minutes. By their account, that came to roughly 580 runs a day at about 40,000 tokens each. Their weekly allowance ran out in 3.83 days, followed by paid overage.
Structurally, my case was the same thing at a smaller scale. These three checks tell you whether check-only runs are the problem:
| Where to look | If check-only runs are the cause | If something else is more likely |
|---|---|---|
| The job's log or run history | Most runs end with "no change" or "nothing new" | Every run produces a real output |
| How usage grows | Proportional to time, with a steady slope even overnight | Spikes only during hours when you are chatting |
| What a single run does | Re-reads the same files or pages from scratch every time | Reads very different amounts from run to run |
If the spikes line up with your own chat sessions, conversation length is the faster suspect. I wrote up how I separate those cases in The day my usage limit ran out before noon, and why it was conversation length, not message count.
Multiply runs per day by tokens per run — and treat the result as a floor
Before rebuilding anything, I put numbers down. The script below takes a run interval and tokens per run, and tells you how much you will spend per day and how many days it takes to empty a weekly allowance. It uses only the standard library.
# estimate_recurring.py — estimate a recurring job's spend before you build it
import argparse
def estimate(interval_min: float, tokens_per_run: int,
weekly_allowance: int, retry_factor: float = 1.0,
active_hours: float = 24.0) -> dict:
runs_per_day = active_hours * 60 / interval_min
tokens_per_day = runs_per_day * tokens_per_run * retry_factor
days_to_empty = weekly_allowance / tokens_per_day if tokens_per_day else float("inf")
return {
"runs_per_day": round(runs_per_day, 1),
"tokens_per_day": int(tokens_per_day),
"days_to_empty": round(days_to_empty, 2),
"fits_in_week": days_to_empty >= 7,
}
if __name__ == "__main__":
p = argparse.ArgumentParser()
p.add_argument("--interval-min", type=float, required=True)
p.add_argument("--tokens-per-run", type=int, required=True)
p.add_argument("--weekly", type=int, required=True, help="weekly allowance in tokens")
p.add_argument("--retry-factor", type=float, default=1.0, help="multiplier for re-runs after failures")
p.add_argument("--active-hours", type=float, default=24.0, help="hours per day the job runs")
a = p.parse_args()
r = estimate(a.interval_min, a.tokens_per_run, a.weekly, a.retry_factor, a.active_hours)
for k, v in r.items():
print(f"{k:>15}: {v}")When I plugged in the numbers from the issue, the result was not what I expected.
# 580 runs/day is roughly every 2.48 minutes; 40k tokens per run; 361.6M weekly
python3 estimate_recurring.py --interval-min 2.48 --tokens-per-run 40000 --weekly 361600000
# runs_per_day: 580.6
# tokens_per_day: 23225806
# days_to_empty: 15.57
# fits_in_week: TrueThe straight multiplication says it would take about fifteen and a half days to run out — in other words, "fits in a week." In reality it took 3.83 days — roughly four times faster. My reading is that re-runs, like the failure loop the reporter mentions repeating 39 times in a row, plus other automations, were stacked on top.
So the line I drew is simple. The multiplication is a floor, not a ceiling. Retries, growing input files, and overlap with other scheduled jobs only push real spend above the estimate. What I check now is whether the job still fits inside a week with --retry-factor 3; if it does not, I don't build it that way.
Move the "should I wake up?" check outside the AI
For the review job, the only change I made was to put one shell step in front of Claude that asks whether any new files exist. If nothing is new, the AI never wakes up.
#!/bin/bash
# review_watch.sh — wake Claude only when there is something new
set -u
DIR="$HOME/reviews/inbox" # where review exports land
STATE="$HOME/.review_watch"; mkdir -p "$STATE"
STAMP="$STATE/last_run" # marks the last time the AI was woken
[ -f "$STAMP" ] || touch -t 197001010000 "$STAMP"
# 1. Condition check (no AI)
NEW=$(find "$DIR" -type f -name '*.csv' -newer "$STAMP" | wc -l)
if [ "$NEW" -eq 0 ]; then
echo "$(date '+%F %T') no new files — skip" >> "$STATE/log.txt"
exit 0
fi
# 2. Only when something is new, wake the AI and hand it just the new files
FILES=$(find "$DIR" -type f -name '*.csv' -newer "$STAMP" | sort)
touch "$STAMP"
claude -p "Summarize only the new reviews in these files and flag any that need a reply: $FILES" \
>> "$STATE/summary.txt"The reason for writing it this way is that "did anything change?" is a question a machine can answer exactly. Comparing modification times, reading an HTTP status, checking whether a process exists, watching a count go up — none of these need Claude's writing ability. What I hand to Claude is only the part that passed the check.
The second change was handing Claude just the new files. Before, every run read the whole folder, so the cost per run grew as reviews piled up. If you shape a job so that a single run doesn't get fatter over time, your estimate stays honest for much longer.
A brake for repeated failures, and a cap on runs per day
Even with the check outside the AI, a job whose AI runs keep failing will keep spending. The 39-run failure loop in the issue is exactly that hole. I replaced the second half of the script with this:
# second half of review_watch.sh (replaces step 2)
FAIL="$STATE/fail_count"; DAY="$STATE/runs_$(date +%F)"
MAX_FAIL=3; MAX_RUNS_PER_DAY=12
[ -f "$STATE/STOP" ] && { echo "$(date '+%F %T') STOP file present" >> "$STATE/log.txt"; exit 0; }
RUNS=$(cat "$DAY" 2>/dev/null || echo 0)
if [ "$RUNS" -ge "$MAX_RUNS_PER_DAY" ]; then
echo "$(date '+%F %T') daily cap reached ($RUNS)" >> "$STATE/log.txt"; exit 0
fi
echo $((RUNS + 1)) > "$DAY"
FILES=$(find "$DIR" -type f -name '*.csv' -newer "$STAMP" | sort)
if claude -p "Summarize only the new reviews in these files: $FILES" >> "$STATE/summary.txt"; then
touch "$STAMP"; echo 0 > "$FAIL"
else
N=$(( $(cat "$FAIL" 2>/dev/null || echo 0) + 1 )); echo "$N" > "$FAIL"
if [ "$N" -ge "$MAX_FAIL" ]; then
touch "$STATE/STOP" # never wake the AI again until a human removes this
echo "$(date '+%F %T') stopped after $N failures" >> "$STATE/log.txt"
fi
fiThree things matter here. A failed run does not advance the last_run marker, so the next run retries the same new files. After three consecutive failures, a STOP file appears and the job stays stopped until a person deletes it. And the daily cap means that, whatever surprise comes along, that day's spend has a ceiling.
A brake you never notice is only half a brake. My habit is to glance at the last line of log.txt once, first thing in the morning. For me, one fixed place to look has lasted longer than adding more notifications.
Three questions I ask before letting Claude build a recurring job
More people who don't write code are asking Claude to "do this every morning for me." Even then, asking Claude to answer three questions before it builds anything has prevented a lot of trouble for me:
- How many times a day will this run, and on how many of those runs does the AI actually need to write something?
- How much does each run read — files, pages, messages — and does that grow over time?
- If it keeps failing, after how many failures does it stop, and where will I find out that it stopped?
I no longer accept a design that has no answer to the third question. Claude tries hard to do what it is asked, but it won't necessarily volunteer the runs you could skip.
If you've already run out
If your allowance ran out mid-week, pause the job before you investigate. Every minute you spend digging while it keeps running is more usage.
- Pause the recurring job (in its schedule settings, or comment out the line with
crontab -e). - Check the usage view in settings and confirm the slope has flattened.
- If you have extra usage turned on (paying for usage beyond your plan's limit), check whether it is enabled and what monthly cap it has. The exact label may differ by plan and over time.
- Count the share of check-only runs in your log, and re-run the estimator with the real run count.
If you run scheduled jobs on an API key and want a real spending ceiling built into the system, I go deeper into detecting daily token overruns and halting automatically in Keeping a hard budget cap on Claude API in production. It takes the STOP-file idea here and turns it into something sturdier.
As a next step, pick one recurring job you already have running and feed its runs per day and tokens per run into the estimator. The gap between "times the AI was woken" and "times the AI was needed" is exactly the room you have to cut.