Why does a Claude Code Desktop scheduled task sometimes run hours late or not at all, and why can an unattended run stall?
answer
- app open, machine awake
- sleep skips the run
- one catch-up on wake
- permission mode per task
- Run now, then always allow
basics
~20 sDesktop tasks fire only while the app runs and the computer is awake; a slept-through time is skipped and one catch-up runs on wake for the latest miss. A Manual-mode run stalls on any unapproved tool until someone answers.
solid answer
~40 sDesktop checks the schedule every minute **while the app is open**, and runs only while the computer is awake. If it sleeps through the scheduled time the run is skipped; on wake, Desktop starts **exactly one catch-up run** for the most recent miss within seven days and discards older ones — so a 9am task can run at 11pm. Keep computer awake stops idle sleep, but a closed lid still sleeps. Stalls come from permissions: each task has its own permission mode, plus allow rules from `~/.claude/settings.json`, and in Manual mode a tool without permission waits for approval in the sidebar. Click **Run now** after creating it, choose always allow for each prompt, and later runs auto-approve those tools.
code
markdown · 8 lines---
name: dependency-audit
description: Morning check for outdated or vulnerable dependencies
---
List dependencies with available updates or published advisories.
Only consider changes since yesterday's run.
If it is after 5pm local time, skip the audit and write a one-line
note that the morning run was missed.go deeper
Recall that Desktop tasks need the app open and the machine awake, and that a run may wait for a permission answer.
Explain the skipped-then-one-catch-up rule, the schedule presets, and how a per-task permission mode plus always allow keeps runs moving.
Write prompts that tolerate late catch-up runs, decide when to enable the worktree toggle, and know which tools will always stall a run.
Decide which recurring work may depend on one developer's machine and which belongs in a cloud scheduler with explicit scoping.
## What a Desktop scheduled task is A **Desktop scheduled task** is a local schedule kept by the Claude Code Desktop app. You create one from the **Code** tab: open **Routines**, click **New routine** and choose **Local** (choosing **Cloud** creates a cloud routine instead). You can also describe it in any Desktop session, for example "set up a daily code review that runs every morning at 9am". Each task has: - a **Name** (converted to kebab-case and used as its folder name on disk) and a **Description**; - **Instructions**, with pickers for the **permission mode** and **model**, plus the working **folder** and an optional **worktree** toggle; - a **Schedule** preset — **Manual**, **Hourly**, **Daily**, **Weekdays** or **Weekly** — or any other interval you ask Claude to set. Desktop checks the schedule **every minute while the app is open** and starts a **fresh session** when a task is due, independent of sessions you have open. Each task gets a small deterministic delay of a few minutes to stagger traffic. A run produces a desktop notification and a new session under **Scheduled** in the sidebar. ## Why a run is late or missing | Situation | What happens | | :- | :- | | App closed | Nothing runs | | Computer asleep at the scheduled time | That run is **skipped** | | App starts or computer wakes | **One catch-up run** for the most recent missed time in the last seven days | | Several days missed | Older misses are **discarded** — a daily task that missed six days runs once | | Previous run still in progress, or other scheduled tasks already running | The run is skipped and shows as skipped in history | So a 9am task can run at 11pm if the machine slept all day. **Keep computer awake** (Settings > This computer > System) prevents idle sleep, but **closing the lid still sleeps the machine**. The docs recommend putting guardrails in the prompt itself, for example "only review today's commits; if it's after 5pm, post a summary of what was missed". For work that must run with the machine off, use a cloud routine. ## Why a run stalls Each task has **its own permission mode**, and allow rules from `~/.claude/settings.json` also apply to its sessions. If the task runs in **Manual** mode and reaches a tool it has no permission for, the run **stalls until someone approves**; the session stays open in the sidebar so you can answer later. Nobody is watching a 3am run, so the prompt waits. The documented way out: 1. Click **Run now** right after creating the task. 2. Watch for permission prompts and choose **always allow** for each. 3. Later runs of that task auto-approve the same tools; review or revoke them in the task's **Always allowed** panel. One exception: MCP tools marked as requiring user interaction prompt **on every call** and offer no always-allow option, so a task that calls one stalls every time. ## What the run sees By default a task runs against **whatever state the working directory is in, including uncommitted changes**. Turn on the worktree toggle to give each run its own isolated Git worktree. The run can edit files, run commands, create commits and open pull requests like any session you start yourself. ## Where it lives The task's prompt is stored at `~/.claude/scheduled-tasks/<task-name>/SKILL.md` (under `CLAUDE_CONFIG_DIR` if set), with `name` and `description` in YAML frontmatter and the prompt as the body. Edits take effect on the next run. **Schedule, folder, model and enabled state are not in that file**: change them through the Edit form or by asking Claude. A running task can also change its own schedule or prompt through the `update_scheduled_task` MCP tool. From the detail page you can **Run now**, toggle **Active/Paused**, edit, review history (including why a run was skipped) and delete. ## Common mistakes - Expecting every missed run to be replayed after a long sleep. - Treating Keep computer awake as protection against a closed lid. - Leaving a task in Manual mode without a first supervised **Run now**. - Expecting a clean checkout when the default is the live working directory.
- A Desktop task stalls on every run even after you chose always allow. What could cause it?An MCP tool marked as requiring user interaction prompts on every call and has no always-allow option, so any run that calls it stalls each time. Check the session waiting in the sidebar to see which tool it is, and either drop it from the task or answer it yourself.
- Where is a Desktop task stored, and what can you edit there?In `~/.claude/scheduled-tasks/<task-name>/SKILL.md`: `name` and `description` frontmatter plus the prompt as the body, picked up on the next run. Schedule, folder, model and enabled state are not in the file; change them in the Edit form or by asking Claude.
- History shows a skipped run although the machine was awake. Why?Desktop also skips a run when the previous run of that task is still in progress or other scheduled tasks are already running. Hovering the skipped entry in the task's history shows which reason applied.
- A Desktop task replays every missed run when the laptop wakes up.
- Keep computer awake keeps scheduled tasks running with the lid closed.
- Desktop scheduled tasks ignore allow rules in ~/.claude/settings.json.
- Each Desktop task run starts from a clean checkout by default.
- Desktop tasks need an open CLI session to fire.