Claude Code's self-paced /loop now ends if an iteration doesn't reschedule
Claude Code 2.1.319 (November 6, 2026) changes what happens when a self-paced /loop iteration forgets to schedule the next one.
What changed
A self-paced loop is one where you give /loop a prompt and no interval, for example /loop check whether CI passed and address any review comments. After each iteration Claude picks a delay between one minute and one hour.
The changelog entry for 2.1.319 reads:
Changed self-paced
/loopto end when a turn finishes without rescheduling, instead of scheduling a fallback wakeup; setCLAUDE_CODE_LOOP_KEEPALIVE=1to keep the old behavior
So an iteration now has two ways to continue and one way to stop. It can schedule the next wakeup, or it can stop the loop on purpose. If it does neither, the loop ends.
What it replaces
The scheduled tasks page describes the earlier behavior. If an iteration ended without either rescheduling or stopping, Claude Code scheduled one fallback wakeup about 20 minutes later. It ended the loop when that iteration didn't reschedule either.
That page was still describing the fallback when this post was written, so it lags the changelog. Treat the changelog as the source for 2.1.319 and later.
Keeping the old behavior
Set the environment variable before you start Claude Code:
CLAUDE_CODE_LOOP_KEEPALIVE=1 claude
The changelog says only that the variable keeps the old behavior. It does not say whether it accepts other values, or whether it can be set in a settings file.
Why you might care
If you run a loop to babysit a PR or a long build, an iteration that finished without scheduling the next one used to get one fallback wakeup. On 2.1.319 and later it ends the loop. Check on a long-running loop before you walk away, or set the variable above.
Loops that stop on purpose are unchanged. The docs say Claude can end a self-paced loop when the task is done by calling the ScheduleWakeup tool with stop: true. Pressing Esc while the loop waits also stops it.
A related hook change
The same release changes when PostToolUse hooks run. The changelog says they now run, with up to 10 seconds to finish, on tool calls that finish after a new message interrupts the turn.
Sources: Claude Code changelog, Run prompts on a schedule.