[BUG] `/loop` scheduled cron fires at wrong time — offset from session start instead of declared cron minute

Resolved 💬 1 comment Opened Jun 12, 2026 by paolodelia99 Closed Jun 13, 2026

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?

When using /loop to schedule a recurring task, the cron job fires at a wall-clock time that does not match the declared cron expression. The actual fire time appears to be offset from the session start time rather than aligned to the minute specified in the cron expression. Additionally, some expected fires are skipped entirely.

Environment

  • Claude Code version: 2.1.175
  • OS: Windows 11

Steps to Reproduce

  1. Start a Claude Code session at 09:22
  2. Run: /loop 1h Check what's on my TODO list for today ...
  3. Claude schedules the job with cron 7 * * * * (every hour at :07) and reports job ID aa7ca801
  4. Observe when the cron actually fires

Expected Behavior

  • First fire: 10:07 (next :07 after session start)
  • Second fire: 11:07
  • Third fire: 12:07
  • Fires every hour, aligned to minute :07 as declared

<html>
<body>
<!--StartFragment--><!-- obsidian --><h2 data-heading="Actual Behavior">Actual Behavior</h2>

Expected fire time | Actual fire time | Delta
-- | -- | --
10:07 | 10:26 | +19 min
11:07 | 11:26 | +19 min
12:07 | 12:26 | +19 min (2h gap from previous)

<p>The offset (+19 min from declared, +1h04m from session start at 09:22) suggests the scheduler is anchoring to the session start time rather than the cron minute boundary. The skipped fire at 11:07 compounds the issue — tasks relying on the loop cadence can miss a full cycle.</p><!--EndFragment-->
</body>
</html>

What Should Happen?

Session Evidence

Session started: 09:22
CronCreate called: 7 (declared: "Every hour at :07", job aa7ca801)

✻ Running scheduled task (Jun 12 10:26am) ← should be 10:07
✻ Running scheduled task (Jun 12 11:26am) ← should be 11:07
✻ Running scheduled task (Jun 12 12:26pm) ← should be 12:07

Additional Notes

  • The cron is session-only (not durable), so it relies on the in-process scheduler
  • The issue is reproducible across multiple hours in the same session
  • Possibly related to how the in-memory cron engine computes the next-fire-time relative to job creation rather than evaluating the

cron expression against the system clock

Error Messages/Logs

Claude conversation started at 9:22:
● Starting the Todos loop command.

● Skill(loop)
  ⎿  Successfully loaded skill
  ⎿  Read TODOs\... (13 lines)
  ⎿  Read TODOs\... (59 lines)
  ⎿  Read TODOs\... (67 lines)

  Thought for 28s (ctrl+o to expand)

● CronCreate(7 * * * *: Check what's on my TODO list for today and output a list, m…)
  ⎿  Scheduled aa7ca801 (Every hour at :07)

● Todos loop scheduled: every hour at :07 (cron 7 * * * *). Job ID: aa7ca801. It auto-expires after 7 days; cancel sooner with CronDelete("aa7ca801").

  Now running the first check immediately.

● PowerShell(Get-Date -Format "dd/MM/yyyy HH:mm K")
  ⎿  12/06/2026 09:22 +02:00

  Thought for 9s, searched for 1 pattern, read 3 files (ctrl+o to expand)

● Here's the status for today, 12/06/2026:

.....

✻ Crunched for 1m 3s

※ recap: I started the hourly Todos loop (job aa7ca801) that checks your TODO files and moves tasks by status. No tasks needed moving this run — nothing was checked off or re-tagged. Next
  check fires at :07. (disable recaps in /config)


Conversation at 10:27:

✻ Running scheduled task (Jun 12 10:26am)
  ⎿  Read TODOs\In Progress.md (13 lines)
  ⎿  Read TODOs\Todos.md (59 lines)
  ⎿  Read TODOs\Done.md (67 lines)

  Thought for 7s (ctrl+o to expand)

● Checking TODO files for changes to process.

  Read 3 files (ctrl+o to expand)

....

● Done. Here's the summary for 12/06/2026 09:22:

✻ Crunched for 50s

Steps to Reproduce

The loop command is not written directly in the claude code chat but the content of a command is in another markdown file that I give claude as input. The initial prompt is something like the following:

Start the todos loop described in @"path/to/markdown/Claude code Loop commands.md"

the command in the file is the following:

/loop 1h Check what's on my TODO list for today and give me the list of todays tasks, move the checked task in @TODOs/Todos.md and @"TODOs/In Progress.md" to @TODOs/Done.md, move the in (IN PROGRESS) tasks from "Todos.md" to "In Progress.md", move (BACKLOG) task to "Backlog.md"

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.2.175

Platform

Google Vertex AI

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗