[BUG] Scheduled tasks in Claude Code Desktop can become stuck indefinitely, with no automatic recovery
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?
A scheduled/automated task got stuck mid-execution multiple times, blocking all subsequent runs of the same task until manually restarted. No automatic timeout or recovery occurred.
Reproductions:
- Session local_6eb3bd6d — task "redaction-pilier-ia" stuck, required manual completion. Automated pipeline failed twice on the same run.
- Session local_63a00752 — task "redaction-conciergerie" stuck for approximately 27 minutes (17:43-18:10 local time) on a pull request whose title ("Ne pas traiter" / "Do not process") appears to have caused the agent to hesitate indefinitely rather than skip or fail cleanly.
What Should Happen?
Scheduled tasks should have a timeout or automatic recovery mechanism so they cannot remain stuck indefinitely without any user-visible error or automatic retry. An automatic timeout should either fail the task cleanly or trigger something equivalent to stop_session after a defined period of inactivity, rather than requiring manual detection and intervention.
Error Messages/Logs
No error was surfaced. The task simply stopped progressing with no error message, no timeout, and no automatic recovery — the stuck state was only noticed manually.
Steps to Reproduce
- Set up several scheduled automation tasks running in parallel (e.g. redaction-branding, redaction-conciergerie, redaction-pilier-ia, controle-qualite-branding).
- Let one of these tasks run against a pull request or input with an ambiguous/unusual title (e.g. "Ne pas traiter" / "Do not process").
- Observe that under this condition, the agent can hesitate indefinitely instead of skipping or failing cleanly, leaving the task stuck with no progress.
- Note that calling stop_session on the stuck session unblocks it, but nothing does this automatically.
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Version 1.52386.3 (41896e)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
This occurs specifically with scheduled/background tasks running unattended (no active user watching the session), which likely explains why the stuck state went unnoticed for an extended period.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗