[BUG] Claude Code Cron Bug: Deleted cron jobs continue firing in infinite loop

Resolved 💬 3 comments Opened Apr 16, 2026 by amanek-solace Closed Apr 19, 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?

Claude Code Cron Bug: Deleted cron jobs continue firing in infinite loop

Summary

Cron jobs created via CronCreate fire continuously in a rapid loop (every few seconds) instead of at their scheduled time. After deletion via CronDelete, the jobs continue firing indefinitely within the same session. The only workaround is to restart the Claude Code session.

Environment

  • Claude Code version: <= 2.1.92
  • Platform: macOS Darwin 23.5.0
  • Shell: zsh
  • Model: Claude Opus 4.6 (1M context)
  • Interface: Claude Code CLI (VS Code extension)

Steps to Reproduce

  1. Create two recurring durable cron jobs:

``
CronCreate: cron="57 8 * * 1-5" prompt="/my-custom-skill" durable=true recurring=true
CronCreate: cron="27 16 * * 1-5" prompt="/my-custom-skill" durable=true recurring=true
``
These are scheduled for weekdays at 8:57 AM and 4:27 PM.

  1. Leave the session open. The jobs begin firing correctly at first.
  1. Over time (observed over multiple days, April 6-13), the jobs start firing continuously in a rapid loop — every few seconds — instead of once at the scheduled time.
  1. The skill /my-custom-skill was invoked dozens of times within minutes, all for the same time slot, with no pause between invocations.
  1. Attempt to stop by deleting both jobs:

``
CronDelete: id="<job-id-1>"
CronDelete: id="<job-id-2>"
`
Both return
Cancelled job <id>.`

  1. Verify deletion:

``
CronList → "No scheduled jobs."
`
Also confirmed
.claude/scheduled_tasks.json contains {"tasks": []}`.

  1. Jobs continue firing despite deletion and empty task list. The skill kept being invoked repeatedly.

Expected Behavior

  • Cron jobs should fire once at each scheduled time (8:57 AM and 4:27 PM on weekdays)
  • After CronDelete, jobs should immediately stop firing
  • No queued invocations should persist after deletion

Actual Behavior

  • Jobs fire continuously in a rapid loop (every few seconds, not at scheduled intervals)
  • After CronDelete + confirmation of empty task list, jobs continue firing indefinitely
  • Over 100+ invocations occurred in a single session for the same time slot
  • The only way to stop the loop was to restart the Claude Code session (/quit)

Impact

  • Context window exhaustion: Each invocation consumes context, eventually forcing conversation compaction
  • Unusable session: The user cannot interact with Claude normally while the loop is running — every response is interrupted by another cron invocation
  • No way to stop: Deletion via CronDelete does not stop the loop within the current session
  • Resource waste: Dozens of redundant API calls to external services (in this case, mitigated by caching the result)

Timeline

| Date | Observation |
|------|-------------|
| April 6, 2026 | Cron jobs created (two durable recurring jobs) |
| April 6-12 | Jobs appeared to fire correctly (reports generated for each day) |
| April 13 | Jobs began firing in rapid loop — dozens of invocations within minutes |
| April 13 | Both jobs deleted via CronDelete, confirmed empty |
| April 13 | Jobs continued firing despite deletion — 100+ invocations total |
| April 13 | Session restart required to stop the loop |
| April 14 | No morning report was generated (jobs were deleted, no session running) |

Workaround

  1. Delete the cron jobs via CronDelete
  2. Restart the Claude Code session (/quit and reopen)
  3. Recreate the cron jobs in the new session

Additional Notes

  • The cron jobs were created as durable: true and persisted to .claude/scheduled_tasks.json
  • The skill being invoked is a custom read-only orchestrator that calls external APIs — the bug is entirely in the cron scheduler, not the skill
  • The rapid-fire loop suggests the scheduler is not tracking "last fired" state and re-evaluates the cron expression on every tick, finding it still matches and firing again immediately
  • The post-deletion persistence suggests fired events are queued in-memory and the queue is not flushed on delete

What Should Happen?

Expected Behavior

  • Cron jobs should fire once at each scheduled time (8:57 AM and 4:27 PM on weekdays)
  • After CronDelete, jobs should immediately stop firing
  • No queued invocations should persist after deletion

Error Messages/Logs

Steps to Reproduce

Expected Behavior

  • Cron jobs should fire once at each scheduled time (8:57 AM and 4:27 PM on weekdays)
  • After CronDelete, jobs should immediately stop firing
  • No queued invocations should persist after deletion

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

<= 2.1.92

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗