ScheduleWakeup with a slash-command prompt re-enters that slash command on an already-completed task
Resolved 💬 3 comments Opened Apr 20, 2026 by mzhaom Closed Jun 2, 2026
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:
- 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. - 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 theScheduleWakeupdescription ("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:
ScheduleWakeup'spromptfield 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>>.
ScheduleWakeuplayered on top ofrun_in_backgroundis double-booked waiting. The background Bash already emits a completion notification when the polled condition is met. AddingScheduleWakeupon top is redundant and, because of issue (1), actively harmful when the originating turn was a one-shot slash command. TheScheduleWakeupdescription warns against polling via chained sleeps but doesn't warn against pairing withrun_in_backgroundfor the same signal.
Reproduction
All steps after (1) are agent-initiated tool calls, not user input:
- (User) Invoke
/plan <args>, approve the plan, start executing in auto mode. - (Agent) Kick off a long poll via
Bash(run_in_background: true). - (Agent) Also call
ScheduleWakeup(prompt: "/plan <args>", delaySeconds: 240)following the tool's "pass the same input verbatim" guidance. - Let the background task complete first.
- When the wakeup fires, plan mode re-engages with a
system-remindersaying "Re-entering Plan Mode" on a task that is already done.
Suggested fixes
Either or both:
- Add a
<<resume>>sentinel forScheduleWakeup.promptthat fires a bare continuation, no slash-command replay — parallel to the existing<<autonomous-loop-dynamic>>sentinel. - Update the
ScheduleWakeuptool description to explicitly call out: don't pair withrun_in_backgroundfor 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.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗