Schedule Claude Code's 5-hour window around your workday
Short version
- Claude Pro and Max plans have a 5-hour session limit and a weekly limit, shared between Claude Code and the Claude apps.
- The session starts with your first message and resets 5 hours later, so you choose when it resets by choosing when it starts.
- For a workday longer than 5 hours, start the first window at end of workday minus 5 hours per window needed. For 09:00–17:00 that's 07:00, which puts a fresh window at 12:00.
- Automate it with a cron job, or with TokenKick, which checks the window first and runs this calculation for you.
How Claude Code's limits work
Anthropic's help center says Pro and Max plans include a five-hour session limit and a weekly limit, and that these limits are shared across Claude and Claude Code. Chatting in the Claude app uses the same session as your coding.
- Check where you stand: run
/usageinside Claude Code. It shows the current session and weekly usage with their reset times. - When the session starts: with your first message after a reset. Anthropic doesn't document the exact rule; in
/usage, the session's reset time is set 5 hours after the first message. - API keys are different. If Claude Code runs on an API key instead of a subscription, you pay per token and these windows don't apply.
The timing rule
You want the windows to line up with the hours you actually work. The rule:
- If your workday is 5 hours or shorter, start the window when you start work. One window covers it.
- If it's longer, count the windows you need: workday length ÷ 5, rounded up.
- Start the first one at end of workday − (windows × 5 hours). The last window then ends exactly when you stop.
First message at 09:00
Window started at 07:00
Green: usable window · Hatched: limit reached, waiting · Dashed outline: 09:00–17:00 workday · Example assumes you hit the limit at 11:30.
| Workday | Windows | Start first window | Fresh windows at |
|---|---|---|---|
| 09:00–13:00 | 1 | 09:00 | 09:00 |
| 09:00–17:00 | 2 | 07:00 | 07:00, 12:00 |
| 10:00–18:00 | 2 | 08:00 | 08:00, 13:00 |
| 08:00–20:00 | 3 | 05:00 | 05:00, 10:00, 15:00 |
Two things to keep in mind:
- It only pays off if you hit the session limit. The early window spends its first hours idle by design. If you rarely run out before the reset, starting early changes nothing.
- Later windows also need a first message. After the 12:00 reset, the next window starts when you (or a tool) send something. If you're at lunch until 13:00, it runs 13:00–18:00, which still covers the afternoon.
Option 1: a cron job
Claude Code's print mode sends one prompt and exits. Use the small Haiku model, no tools, and no saved session, so the request is as light as possible:
# crontab -e · weekdays at 07:00. Cron has a minimal PATH: use the full path from `which claude`.
0 7 * * 1-5 /path/to/claude -p --model haiku --tools "" --no-session-persistence "Reply with OK"
Its limits:
- It fires on the clock whether or not a session is already running, and doesn't check that one started.
- On a Mac, cron jobs don't run during sleep. A
launchdjob runs the missed time on wake, which may already be too late. - You recalculate the start time yourself whenever your hours change, and you need one job per account.
Claude Code also has cloud routines (/schedule) that run prompts on Anthropic's servers. We haven't verified whether a routine run starts your interactive session window, so check /usage after one before relying on it.
Option 2: TokenKick
TokenKick is a free, open-source CLI that does this with checks around it. You give it your working hours, and it works out the start time, sends the kick only when the window is actually fresh, and logs what it did.
pipx install tokenkick
tk setup # finds Claude Code (and Codex) logins already on this machine
tk status --refresh # current windows, reset times, and account labels
tk auto enable "<label>" # asks you to type ENABLE to confirm first
tk schedule set --account "<label>" --weekdays 09:00-17:00 --weekends 10:00-14:00
tk schedule show # shows your schedules and planned kicks
tk daemon --background # keeps checking; needs the machine awake
tk calendar --ics > resets.ics # optional: upcoming resets for your calendar
For Claude Code specifically, TokenKick:
- sends each kick with the Haiku alias, low effort, thinking off, and built-in tools and MCP servers disabled;
- confirms the new reset time with
/usageinstead of assuming the request worked; - doesn't run
/usagesilently in the background, and backs off when it's rate-limited; - keeps automation off for new accounts until you opt in, and records every kick in
tk history.
Limits and honest caveats
- A kick spends a little quota. It's a real request, kept as small as possible.
- Your weekly limit doesn't change. Scheduling moves when sessions reset; it doesn't add capacity.
- Provider terms. Anthropic may treat automated requests differently from manual use. Automation is opt-in per account, and it's your call.
- The machine has to be on. A sleeping laptop can't start a window at 07:00. Use an always-on Mac mini, home server, or VPS for reliable coverage.
- Limits change. Anthropic adjusts session and weekly limits from time to time;
/usageis the source of truth.
Sources
- Anthropic: Use Claude Code with your Pro or Max plan (checked 13 October 2026)
- Claude Code CLI reference:
-p,--model,--tools - TokenKick provider notes: how Claude Code windows are read and verified