How to get three Claude/Codex usage windows in a working day
The 5-hour rolling window is widely misunderstood. Here is the schedule, the trick, and a tiny script that makes it real.
If you use Claude Code or Codex daily and feel like you keep running out of capacity halfway through the afternoon, the issue is almost always the same: you are working with one rolling window when you could be working with three.
This is not a quota hack. It is a scheduling tactic. The mechanics are public; most people just never reason about them carefully.
The mechanic
Both Claude Code and Codex CLI run on a 5-hour rolling usage window, not a fixed daily reset. The window starts the moment you make your first API call and expires exactly five hours later. As soon as it expires, the next call you make starts a fresh window.
Two consequences fall out of that:
- The clock starts when you start, not at midnight. If you fire your first prompt at 09:00, your window expires at 14:00 — right when you would otherwise be picking up steam after lunch.
- You can chain windows back-to-back across a day. Three full 5-hour windows fit inside a working day if you place the boundaries deliberately.
The opportunity is in the scheduling, not the tool.
The schedule
If you want three windows in a working day, you need the first window to start before you do.
| Window | Starts | Ends | Useful for |
|---|---|---|---|
| 1 | ~06:00 | ~11:00 | Tail end overlaps with start of your day |
| 2 | ~11:00 | ~16:00 | Core working hours |
| 3 | ~16:00 | ~21:00 | End of day, evening passes |
Window 1 is the trick. You do not need to be awake — you just need a single API call to land before you start work, so that by the time you are at your desk the window is already partway through.
The script
The way to land that first call without setting an alarm is to schedule it.
A minimal version, suitable for keeping in your ~/bin/:
#!/usr/bin/env bash
# wake_and_start.sh — fire a tiny ping to Claude and Codex at a target time.
# Usage: wake_and_start.sh [HH:MM] (default 06:05)
set -euo pipefail
TARGET="${1:-06:05}"
NOW_EPOCH="$(date +%s)"
TARGET_EPOCH="$(date -j -f '%H:%M' "$TARGET" +%s 2>/dev/null \
|| date -d "today $TARGET" +%s)"
# If target is earlier than now, schedule for tomorrow.
if [ "$TARGET_EPOCH" -le "$NOW_EPOCH" ]; then
TARGET_EPOCH=$(( TARGET_EPOCH + 86400 ))
fi
SECS=$(( TARGET_EPOCH - NOW_EPOCH ))
# Keep the machine awake until the timer fires.
caffeinate -di -t "$SECS" &
CAF_PID=$!
sleep "$SECS"
# Fire both pings in parallel; log separately so failures are obvious.
( claude -p "ping" >/tmp/wake-claude.log 2>&1 ) &
( codex exec --skip-git-repo-check "ping" >/tmp/wake-codex.log 2>&1 ) &
wait
kill "$CAF_PID" 2>/dev/null || true
Run it before bed:
wake_and_start.sh # default 06:05
wake_and_start.sh 05:30 # earlier
caffeinate -di keeps the Mac awake (display can sleep, idle sleep blocked) for exactly the wait. As soon as the prompt fires, both windows are open. By the time you are at the keyboard, you are already mid-window 1.
Why this matters more than it looks
Once both windows are aligned, your day stops fragmenting. You lose the dead patch around lunch where the morning window has expired and you are waiting for capacity to come back. You lose the late-afternoon scramble where you are trying to squeeze the last useful work out of a window that started at 11:00.
Aligned windows also make multi-model workflows easier. If you use both tools — for example, Codex as a second opinion against Claude — you want them to refresh together, not on offset clocks.
When it does not work
Two cases:
- You are on a paid Anthropic API plan paying per-token. Then you do not have a 5-hour window at all; you have a budget. The trick does nothing for you.
- Your machine sleeps anyway.
caffeinate -diblocks idle sleep, but a closed lid on a MacBook still triggers clamshell sleep. Plug it in, leave it open, or use a more aggressivecaffeinatemode.
Otherwise: it is a one-time setup that pays out every working day.
The takeaway
The five-hour window is not a constraint to work around — it is a clock to set deliberately. One small overnight ping turns a single fragile window into three useful ones, for both tools, automatically, every day.