Claude Code routines: offset schedules and a Sume Format run
New Claude Code routine schedules start a few minutes past the hour, and unstarted runs show Failed. Key each Sume Format run to the tick so retries are safe.

A Claude Code routine that kicks off a Sume Format run should derive its Idempotency-Key from the scheduled tick, not from the clock at execution time. Claude Code 2.1.283 made new routine schedules default to a few minutes past the hour, and 2.1.284 shows runs whose cloud session never started as Failed. Both mean the actual run time shifts and some ticks need a retry.
What the changelog says
| Version | Change |
|---|---|
| 2.1.283 | New routine schedules default to a few minutes past the hour |
| 2.1.284 | Routine runs whose cloud session never started now show Failed |
| 2.1.282 | Background Bash limit 30 minutes by default, 2 hours max |
Key by tick
If the key is built from execution time, a re-run of the same tick gets a new key and a second paid run. If it is built from a static string, every tick replays the first (same key and same body return the original). Build it from the schedule name and the intended tick, for example the date and hour. A retry of that tick then returns the original run.
Format runs are created with POST /v1/formats/{handle}/{slug}/runs. You can set output_schema and generation_spend_cap_usd, and a replay returns 200 with idempotency_hit: true.
Do not hold the routine open
Read the run from GET /v1/format-runs/:id/status and /result, or configure communication.webhook_url for format.run.terminal. That event carries status OK or ERROR, an outcome of ok, degraded or error, and a receipt payload. A skipped or canceled run delivers no webhook, so a routine that waits for one needs a timeout and a status read.
- Service-account keys cannot create runs; use a key with
formats:write. - Reading needs
formats:read. - Background Bash is capped, so a poll loop over 2 hours would be killed.
Using hosted MCP instead
A routine can call https://mcp.sume.com/mcp. Use jobs_wait for job ids, 55 seconds per call at most. On wait_slice_expired ask again with the same ids. Never resubmit a paid create.
Sources
Related posts
More in Developers
- Claude structured outputs drop minimum and maxLength; Sume keeps them
Anthropic lists minimum, maxLength and recursion as unsupported in structured outputs. Sume's output_schema accepts the first two; here is what differs.
- Cloud Run concurrency target GA: a Sume webhook receiver sizing
Cloud Run's custom target concurrency and CPU scaling is GA. Size a Sume webhook receiver around the 10 second attempt timeout and 10 retries.
- Cloud Run job delay up to 12 hours: schedule Sume bulk runs
Cloud Run now lets a job start up to 12 hours late (Preview). When that beats a scheduler for Sume bulk runs, and what to keep out of a delayed container.
- Cloud Scheduler retries and a static Idempotency-Key: the replay trap
A fixed Idempotency-Key header on a Cloud Scheduler POST replays the first Sume run forever. Derive the key per tick, or use Sume Actions for schedules.
Written by Sume