CronCreate durable:true silently dropped — returns "Session-only" and never writes scheduled_tasks.json

Status Open
Maintainer reply None cached
Activity 7 comments · opened Apr 19, 2026

Summary

The CronCreate tool accepts a durable: true parameter but does not honor it. Every call — regardless of the flag — returns the session-only branch and no .claude/scheduled_tasks.json is written. Scheduled tasks die when the session ends.

Environment

  • Claude Code CLI
  • Model: claude-opus-4-7
  • macOS Darwin 21.6.0
  • Observed: 2026-04-18

Expected

Per the tool schema:

durable: true = persist to .claude/scheduled_tasks.json and survive restarts. false (default) = in-memory only, dies when this Claude session ends.

Calling CronCreate with durable: true should:

  1. Write the job to .claude/scheduled_tasks.json
  2. Return a success message that does not say "Session-only"
  3. Survive Claude exit → relaunch

Actual

Reproducer:

CronCreate(
  cron="7 3 31 12 *",
  prompt="DURABLE_FLAG_TEST — safe to delete",
  durable=true,
  recurring=false
)

Returns:

Scheduled one-shot task 875bb1c1 (7 3 31 12 *).
Session-only (not written to disk, dies when Claude exits).
It will fire once then auto-delete.

After the call:

$ ls .claude/scheduled_tasks.json
ls: scheduled_tasks.json: No such file or directory

Only the stale lock file exists:

$ cat .claude/scheduled_tasks.lock
{"sessionId":"ebbe5346-69fc-448c-825c-171144f58c15","pid":670,"acquiredAt":1776386918582}

Impact

Users following the "always-on EA agent" pattern (persistent tmux + scheduled automations) cannot rely on CronCreate for anything surviving session restart. Seven automations registered with durable: true the day prior (2026-04-17) were silently session-only and stopped firing overnight.

Workaround

Bypass CronCreate entirely — use macOS crontab + a dispatcher script that tmux send-keys the prompt into a long-lived Claude REPL session. Works but requires infrastructure the durable flag should have provided natively.

Additional notes

  • The CronList tool also returns no record of durable jobs, even in the session that created them.
  • If the durable path is gated on some setting (e.g. enableDurableScheduling), that gate is undocumented in the tool schema — the schema says the flag alone controls behavior.
  • Request: either fix durable persistence, or update the tool schema to make clear the flag is a no-op in the current build.

View original on GitHub ↗

7 Comments

github-actions[bot] · 4 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/40228

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

0xbrainkid · 4 months ago

If durable: true is accepted but the tool still silently takes the session-only path, then the product is violating one of the most important promises an automation surface can make: persistence semantics.

This is worse than a simple missing feature because the interface appears to support durability already. The user is not asking for an unsupported mode, they are explicitly selecting it, and the system accepts the request while behaving as if the flag were false.

That creates a dangerous mismatch between declared intent and actual persistence:

  • operator thinks the task will survive restarts
  • runtime keeps it in-memory only
  • no durable file is written
  • failure is discovered only after the session ends

In other words, it is a silent durability downgrade.

At minimum, if the durable path is unavailable or failing, the tool should reject the request clearly instead of returning a success-shaped session-only result. Accepting durable: true and then quietly discarding the persistence guarantee undermines trust in the tool contract itself.

This is the same broader pattern we keep seeing in Claude Code issues lately: hidden control-plane behavior that diverges from the visible surface. If a flag changes semantics, the runtime has to honor it or fail loudly.

mtnovak2-dev · 4 months ago

Confirming this on macOS Darwin 25.3.0, Claude Code 2.1.114 (CLI) and 2.1.111 (desktop Cowork) — same exact symptom as OP.

State after ~14h of Cowork session + recent CronCreate calls:

$ ls ~/.claude/scheduled_tasks*
/Users/<me>/.claude/scheduled_tasks.lock
# scheduled_tasks.json absent

$ cat ~/.claude/scheduled_tasks.lock
{"sessionId":"bde4a992-…","pid":1566,"acquiredAt":1776955679151}

Lock is written, data file never is. CronList from a freshly-restarted CLI session returns No scheduled jobs — confirming nothing was rehydrated.

Downstream impact worth flagging: users building autonomous agent systems (scheduled briefings, inbox processors, etc.) silently lose all their crons on any restart. I've had to build an external launchd-based detector to alert when expected fires don't happen — purely because there's no trustworthy signal from Claude Code itself that a cron was dropped.

Happy to provide full repro / logs if useful.

etadward · 3 months ago

Confirming this still reproduces on Linux (Ubuntu/WSL2) Claude Code 2.1.133, 2026-05-08. Same symptom set:

  1. CronCreate(durable: true, ...) → response still hard-codes "Session-only (not written to disk, dies when Claude exits)"
  2. ~/.claude/scheduled_tasks.json never created (only scheduled_tasks.lock left over)
  3. Additional: CronList output explicitly tags the job [session-only] — so the metadata layer also treats durable=true as ignored, not just the response wording

Impact in my workflow: had to dual-route a one-shot verification cron via OS crontab + a relay script as a backup, because there's no way to trust a durable: true Claude cron will survive /clear, auto-compact subprocess restarts, or laptop suspend.

Workaround for anyone hitting this: drop down to the OS scheduler (crontab -e) and have the script self-delete its own crontab line on completion. Slightly more setup, but actually persistent.

tjbaker · 3 months ago

+1 — still repros on Claude Code 2.1.145 (macOS Darwin 25.4.0). CronCreate with durable: true returns the success message "Session-only (not written to disk, dies when Claude exits)" and ~/.claude/scheduled_tasks.json is never created (only the .lock file exists).

nolanlove · 3 months ago

Confirming this is still reproducing on macOS 26.4.1 as of 2026-05-23 — bumping for visibility.

Claude Code REPL launched from Claude Desktop, CLAUDE_AGENT_SDK_VERSION=0.3.149. Called CronCreate(cron="<expr>", recurring=true, durable=true, prompt="<...>"). The response confirmed the schedule but tagged the result as:

Scheduled recurring job <id> (Every minute). Session-only (not written to disk, dies when Claude exits). Auto-expires after 7 days.

~/.claude/scheduled_tasks.json does not exist. The downgrade is silent — durable: true is accepted by the schema but ignored by the implementation.

jj-peace · 2 months ago

Adding that this is still broken on Claude 1.12603.1 (3df4fd) 2026-06-11T16:57:36.000Z