claude-code - 💡(How to fix) Fix [FEATURE] scheduled-tasks.json should be stored in ~/.claude/ instead of the session directory [2 comments, 2 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#47797Fetched 2026-04-15 06:42:04
View on GitHub
Comments
2
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
commented ×2labeled ×2

Code Example

{
  "id": "my-task",
  "cronExpression": "*/30 9-20 * * 1-5",
  "enabled": true,
  "model": "claude-sonnet-4-6",
  "cwd": "/path/to/project",
  "permissionMode": "acceptEdits",
  "approvedPermissions": [
    { "toolName": "Bash" },
    { "toolName": "Read" }
  ]
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • This is a single feature request (not multiple features)

Problem Statement

Task configuration for scheduled tasks is currently split across two locations:

  • ~/.claude/scheduled-tasks/{taskId}/SKILL.md — task prompt (persistent, user-managed)
  • ~/Library/Application Support/Claude/claude-code-sessions/{uuid}/{uuid}/scheduled-tasks.json — everything else (session storage, volatile)

The scheduled-tasks.json contains critical configuration that is not recoverable if the session directory is lost:

json { "id": "my-task", "cronExpression": "*/30 9-20 * * 1-5", "enabled": true, "model": "claude-sonnet-4-6", "cwd": "/path/to/project", "permissionMode": "acceptEdits", "approvedPermissions": [ { "toolName": "Bash" }, { "toolName": "Read" } ] } ​

The session directory path contains UUIDs that can change or be deleted when:

  • Claude Desktop is reinstalled
  • A "reset data" operation is performed
  • An auto-update wipes the session directory (related: #43719)

When this happens, only the SKILL.md prompt survives. All scheduling, permission, and runtime settings are lost silently.

Proposed Solution

Store all task configuration alongside SKILL.md in ~/.claude/scheduled-tasks/{taskId}/:

~/.claude/scheduled-tasks/my-task/ SKILL.md ← prompt (already here) task.json ← cronExpression, enabled, model, cwd, permissionMode, approvedPermissions (proposed)

This would make the full task definition:

  • Persistent across app reinstalls and resets
  • Portable between machines (related: #41364)
  • Version-controllable via git
  • User-managed consistently with other Claude Code config

Alternative Solutions

Manually back up scheduled-tasks.json after any configuration change.

Priority

High - Significant impact on productivity

Feature Category

Configuration and settings

Use Case Example

  1. I set up several scheduled tasks with specific cron schedules, models, and "always allow" tool permissions.
  2. Claude Desktop is reinstalled or session data is reset.
  3. The SKILL.md prompts survive, but all scheduling and permission settings are gone with no warning.
  4. Every task must be manually reconfigured from scratch before autonomous execution can resume.

Additional Context

  • Related: #43719 (auto-update deletes Cowork session disk)
  • Related: #41364 (sharing scheduled tasks between CLI and Desktop)
  • Environment: Claude Desktop (macOS), Claude Code 2.1.101

extent analysis

TL;DR

Store all task configuration in a persistent location, such as ~/.claude/scheduled-tasks/{taskId}/task.json, to prevent loss of scheduling and permission settings.

Guidance

  • Consider storing critical configuration, like cronExpression and approvedPermissions, in a file alongside SKILL.md to ensure persistence across app reinstalls and resets.
  • Evaluate the proposed solution of using ~/.claude/scheduled-tasks/{taskId}/task.json to store task configuration, making it portable and version-controllable.
  • As an alternative, implement a manual backup process for scheduled-tasks.json after any configuration changes to mitigate data loss.
  • Review related issues, such as #43719 and #41364, to ensure a comprehensive solution that addresses all aspects of task configuration and settings.

Example

No code snippet is provided as the issue focuses on configuration and storage rather than code implementation.

Notes

The proposed solution aims to address the issue of lost task configuration due to session directory changes or deletions. However, the implementation details and potential edge cases need to be carefully considered to ensure a seamless and reliable solution.

Recommendation

Apply the proposed workaround of storing task configuration in ~/.claude/scheduled-tasks/{taskId}/task.json to prevent data loss and improve productivity. This approach aligns with the goal of making task definitions persistent, portable, and version-controllable.

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…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING