claude-code - 💡(How to fix) Fix ScheduleWakeup with a slash-command prompt re-enters that slash command on an already-completed task

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Why it's a bug (not just operator error)

  1. ScheduleWakeup layered on top of run_in_background is double-booked waiting. The background Bash already emits a completion notification when the polled condition is met. Adding ScheduleWakeup on top is redundant and, because of issue (1), actively harmful when the originating turn was a one-shot slash command. The ScheduleWakeup description warns against polling via chained sleeps but doesn't warn against pairing with run_in_background for the same signal.

Root Cause

  1. ScheduleWakeup layered on top of run_in_background is double-booked waiting. The background Bash already emits a completion notification when the polled condition is met. Adding ScheduleWakeup on top is redundant and, because of issue (1), actively harmful when the originating turn was a one-shot slash command. The ScheduleWakeup description warns against polling via chained sleeps but doesn't warn against pairing with run_in_background for the same signal.
RAW_BUFFERClick to expand / collapse

What happened

User invoked /plan <args> in auto mode. Plan was approved and execution began. While waiting on a long-running step, the agent (me) internally:

  1. Kicked off a long poll via Bash(run_in_background: true) against a GitHub Actions workflow — this tool already emits a completion notification when the background command exits.
  2. Also called ScheduleWakeup(prompt: "/plan <args>", delaySeconds: 240) as a parallel "wake me when enough time passes" mechanism, passing the original /plan <args> string back verbatim per the ScheduleWakeup description ("pass the same /loop input verbatim each turn so the next firing re-enters the skill").

Both tool calls were made by the agent, not by the user.

When the wakeup fired, the runtime re-fed /plan <args> as a fresh user turn. That dropped the agent back into plan mode for a task that was already completed and verified. The system-reminder framed it as "Re-entering Plan Mode" and pointed at the existing plan file, nudging the agent to edit the plan rather than recognize the task was done.

Why it's a bug (not just operator error)

Two separate issues stack:

  1. ScheduleWakeup's prompt field doesn't distinguish "resume this task" from "re-fire this slash command." The tool description tells the agent to pass the originating user input verbatim. For /loop-style dynamic pacing that's fine. For a one-shot command like /plan, passing it verbatim re-triggers the command's side effects (entering plan mode, blocking tool use) on a task that no longer needs planning. There is no sentinel for "just resume me, no slash-command replay" analogous to the existing <<autonomous-loop-dynamic>>.

  2. ScheduleWakeup layered on top of run_in_background is double-booked waiting. The background Bash already emits a completion notification when the polled condition is met. Adding ScheduleWakeup on top is redundant and, because of issue (1), actively harmful when the originating turn was a one-shot slash command. The ScheduleWakeup description warns against polling via chained sleeps but doesn't warn against pairing with run_in_background for the same signal.

Reproduction

All steps after (1) are agent-initiated tool calls, not user input:

  1. (User) Invoke /plan <args>, approve the plan, start executing in auto mode.
  2. (Agent) Kick off a long poll via Bash(run_in_background: true).
  3. (Agent) Also call ScheduleWakeup(prompt: "/plan <args>", delaySeconds: 240) following the tool's "pass the same input verbatim" guidance.
  4. Let the background task complete first.
  5. When the wakeup fires, plan mode re-engages with a system-reminder saying "Re-entering Plan Mode" on a task that is already done.

Suggested fixes

Either or both:

  • Add a <<resume>> sentinel for ScheduleWakeup.prompt that fires a bare continuation, no slash-command replay — parallel to the existing <<autonomous-loop-dynamic>> sentinel.
  • Update the ScheduleWakeup tool description to explicitly call out: don't pair with run_in_background for the same signal, and don't pass one-shot slash commands verbatim — only /loop-style skills are safe to re-fire.

Environment

  • Claude Code CLI, auto mode, Opus 4.7 (claude-opus-4-7)
  • Date observed: 2026-04-20
  • Reproducible from the tool description alone; no private repo context needed.

extent analysis

TL;DR

To fix the issue, update the ScheduleWakeup tool to distinguish between resuming a task and re-firing a slash command, and avoid pairing it with run_in_background for the same signal.

Guidance

  • Consider adding a <<resume>> sentinel for ScheduleWakeup.prompt to fire a bare continuation without replaying the slash command.
  • Update the ScheduleWakeup tool description to warn against pairing with run_in_background for the same signal and against passing one-shot slash commands verbatim.
  • Review the usage of ScheduleWakeup and run_in_background in the code to ensure they are not used together for the same signal.
  • Test the changes with the provided reproduction steps to verify the fix.

Example

No code snippet is provided as the issue is more related to the tool's behavior and description rather than a specific code block.

Notes

The suggested fixes aim to address the two separate issues mentioned: the lack of distinction between resuming a task and re-firing a slash command, and the redundant waiting caused by pairing ScheduleWakeup with run_in_background.

Recommendation

Apply the workaround by updating the ScheduleWakeup tool description and adding a <<resume>> sentinel to distinguish between resuming a task and re-firing a slash command. This will help prevent the issue from occurring and provide a clearer understanding of how to use the ScheduleWakeup tool.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix ScheduleWakeup with a slash-command prompt re-enters that slash command on an already-completed task