claude-code - 💡(How to fix) Fix CronCreate: `durable: true` accepted but not persisted to disk [2 comments, 3 participants]

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…
GitHub stats
anthropics/claude-code#55109Fetched 2026-05-01 05:46:02
View on GitHub
Comments
2
Participants
3
Timeline
5
Reactions
0
Author
Timeline (top)
labeled ×3commented ×2

Calling CronCreate with durable: true accepts the parameter, returns a job ID, and confirms the cron expression — but the job is not actually persisted to disk. The success message even reads "Session-only (not written to disk, dies when Claude exits)" despite durable: true being explicitly set, and ~/.claude/scheduled_tasks.json is never created.

This means recurring jobs that are intended to survive across session restarts (which is the documented purpose of durable: true) are silently degraded to in-memory only. Any session/daemon restart loses the cron silently.

Root Cause

We hit this bug three times in one day (2026-04-30) while building a multi-host Claude topology. Every cross-session-task we tried to schedule (12-hour pulse loop, weekly maintenance windows, recurring health-check) silently degraded to in-session-only and died on the first daemon restart. We've migrated everything to systemd timers as a workaround, but CronCreate with durable: true remains unusable for its documented purpose.

Fix Action

Workaround

Use systemd timers (Linux) or launchd plists (macOS) for any cron-like task that must survive daemon restarts. CronCreate is only safe for one-off reminders or short-lived recurring tasks confined to a single agent session.

Code Example

{
  "tool": "CronCreate",
  "params": {
    "cron": "5 5 * * 0",
    "recurring": true,
    "durable": true,
    "prompt": "Weekly maintenance task..."
  }
}

---

Scheduled recurring job <ID> (Every Sunday at 5:05 AM). Session-only (not written to disk, dies when Claude exits). Auto-expires after 7 days.

---

$ ls ~/.claude/scheduled_tasks.json
ls: cannot access '/home/claude/.claude/scheduled_tasks.json': No such file or directory
RAW_BUFFERClick to expand / collapse

Summary

Calling CronCreate with durable: true accepts the parameter, returns a job ID, and confirms the cron expression — but the job is not actually persisted to disk. The success message even reads "Session-only (not written to disk, dies when Claude exits)" despite durable: true being explicitly set, and ~/.claude/scheduled_tasks.json is never created.

This means recurring jobs that are intended to survive across session restarts (which is the documented purpose of durable: true) are silently degraded to in-memory only. Any session/daemon restart loses the cron silently.

Reproduction

In a Claude Code session, call:

{
  "tool": "CronCreate",
  "params": {
    "cron": "5 5 * * 0",
    "recurring": true,
    "durable": true,
    "prompt": "Weekly maintenance task..."
  }
}

Observed return:

Scheduled recurring job <ID> (Every Sunday at 5:05 AM). Session-only (not written to disk, dies when Claude exits). Auto-expires after 7 days.

Then check the file:

$ ls ~/.claude/scheduled_tasks.json
ls: cannot access '/home/claude/.claude/scheduled_tasks.json': No such file or directory

Expected behavior

Either:

  1. durable: true should actually write to ~/.claude/scheduled_tasks.json so the job survives daemon restart (matching the tool's own documented behavior), OR
  2. The success message should not say "Session-only" when durable: true was passed, and the documented behavior in the tool description should match what actually happens.

Actual behavior

durable: true is accepted but ignored. The job behaves identically to durable: false.

Why this matters

We hit this bug three times in one day (2026-04-30) while building a multi-host Claude topology. Every cross-session-task we tried to schedule (12-hour pulse loop, weekly maintenance windows, recurring health-check) silently degraded to in-session-only and died on the first daemon restart. We've migrated everything to systemd timers as a workaround, but CronCreate with durable: true remains unusable for its documented purpose.

Environment

  • Claude Code CLI (multiple sessions across Linux/macOS hosts)
  • Tool: CronCreate (built-in, version per current Claude Code)

Workaround

Use systemd timers (Linux) or launchd plists (macOS) for any cron-like task that must survive daemon restarts. CronCreate is only safe for one-off reminders or short-lived recurring tasks confined to a single agent session.

extent analysis

TL;DR

The CronCreate tool with durable: true is not persisting jobs to disk, rendering it unusable for its intended purpose of surviving session restarts.

Guidance

  • Verify the issue by checking the presence of ~/.claude/scheduled_tasks.json after calling CronCreate with durable: true.
  • Use the provided workaround of employing systemd timers (Linux) or launchd plists (macOS) for tasks that must survive daemon restarts.
  • Review the documentation of CronCreate to ensure it aligns with the actual behavior when durable: true is specified.
  • Test CronCreate with durable: false to confirm if the tool behaves as expected in non-durable mode.

Example

No code snippet is provided as the issue is related to the behavior of the CronCreate tool rather than a code implementation.

Notes

The issue seems to be specific to the CronCreate tool within the Claude Code CLI, and the workaround suggests using external scheduling mechanisms for tasks requiring persistence across sessions.

Recommendation

Apply the workaround by using systemd timers or launchd plists for critical tasks, as the CronCreate tool with durable: true does not currently function as intended.

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…

FAQ

Expected behavior

Either:

  1. durable: true should actually write to ~/.claude/scheduled_tasks.json so the job survives daemon restart (matching the tool's own documented behavior), OR
  2. The success message should not say "Session-only" when durable: true was passed, and the documented behavior in the tool description should match what actually happens.

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 CronCreate: `durable: true` accepted but not persisted to disk [2 comments, 3 participants]