[BUG] ScheduleWakeup fires within seconds of being called, ignoring the requested delaySeconds
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Context: a long-running local background Bash task (Python script, several minutes of real wall-clock work) kicked off via run_in_background: true
ScheduleWakeup accepts a delaySeconds parameter and returns a confirmation naming a specific future wall-clock time (e.g., "Next wakeup scheduled for 22:09:00 (in 1244s)"). In this session, every call to it was followed by re-invocation within roughly 10-60 seconds — not at the stated time, and not anywhere close to the requested delay.
Observed (concrete timestamps from this session):
Call: ScheduleWakeup(delaySeconds=1200, ...) → tool response: "Next wakeup scheduled for 22:09:00 (in 1244s)".
Immediately following turn, ran date → Tue Jun 23 21:48:30 PDT 2026. (Expected: should not resume until ~22:09:00.)
Next call: ScheduleWakeup(delaySeconds=1200, ...) → "Next wakeup scheduled for 22:10:00 (in 1221s)".
Immediately following turn, ran date → Tue Jun 23 21:49:24 PDT 2026 (54 seconds after the prior check, not ~20 minutes).
Repeated a third time → wakeup reported for 22:10:00 again, next turn's date showed 21:49:44 (20 seconds later).
This pattern repeated across roughly 6-7 consecutive ScheduleWakeup calls in the session, each requesting 270-1200 second delays, each followed by re-invocation in well under a minute.
What Should Happen?
the conversation should not resume until approximately the stated delay has elapsed (or a tracked background task/tool result arrives, per the tool's own documented behavior).
Error Messages/Logs
Steps to Reproduce
Start a long-running background task via Bash with run_in_background: true.
Call ScheduleWakeup with delaySeconds in the 270-1200 range, with a prompt of <<autonomous-loop-dynamic>>.
Observe the tool's own confirmation message (states a specific future clock time).
On the next turn, run a shell date command and compare to the stated wake time.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.71 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Environment: Claude Code running as the VSCode native extension
Workaround used: abandoned ScheduleWakeup and called TaskOutput directly on the background task's ID with block: true and a long timeout (580000ms). This worked correctly — it genuinely blocked for the real remaining duration (tens of minutes) until the background task actually finished, with exit code and full output returned correctly on completion.
Impact: Low in this specific case, since I cross-checked real progress via the filesystem on every wake (rather than trusting elapsed time), so no incorrect action was taken. But the discrepancy between the tool's stated wake time and actual behavior could mislead an agent that doesn't independently verify progress, and it burns extra turns/cache-misses re-checking state far more often than intended. Worth noting: I have no visibility into why this happened (could be a scheduling bug, or the harness re-invoking me for some unrelated/untracked reason while a ScheduleWakeup timer sat pending) — flagging the observed symptom precisely rather than guessing at root cause.