claude-code - 💡(How to fix) Fix [BUG] Scheduled task runs incorrectly marked "Skipped" after previous agent completes normally (Claude code desktop) [1 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#47022Fetched 2026-04-13 05:43:34
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

When a scheduled task fires and the agent completes normally, subsequent scheduled runs are incorrectly marked "Skipped" in the Claude Code desktop GUI, as if the previous agent is still active. The agent had fully exited — no active session existed — yet the concurrency guard continued blocking new runs for multiple hours.

Actual behavior

4 consecutive hourly runs (covering a ~4 hour window) were marked "Skipped" in the desktop GUI. The task had to be manually re-enabled and a new conversation had to be started to clear the false "active session" state.

Environment

Platform: Windows 11 Pro Claude Code: Desktop app Schedule: 0 * * * * (hourly, with jitter)

What Should Happen?

Schedules should not have been skipped.

Error Messages/Logs

Steps to Reproduce

Create a scheduled task with an hourly cron schedule The task runs a Python script via Bash and exits cleanly (exit code 0) The agent completes and the session ends normally Observe subsequent hourly trigger(s) in the desktop GUI Expected behavior

Each hourly trigger fires a new agent, since the previous one has completed.

Does not happen every time. Seems to be more affected by manual runs, since user automatically watching the session run.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.96

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

No response

extent analysis

TL;DR

The issue can be mitigated by investigating the concurrency guard mechanism in the Claude Code desktop GUI to ensure it correctly detects when an agent has fully exited.

Guidance

  • Review the Claude Code documentation to understand how the concurrency guard works and its expected behavior when an agent completes normally.
  • Verify that the Python script run by the scheduled task is properly exiting with a zero exit code, indicating successful completion.
  • Investigate if there are any edge cases or race conditions in the scheduling mechanism that could lead to the concurrency guard being stuck in a blocking state.
  • Consider adding logging or debugging statements to the scheduled task or the Claude Code desktop GUI to gain more insight into the state of the concurrency guard and the scheduling process.

Example

No specific code example can be provided without more information on the implementation details of the Claude Code desktop GUI and the scheduled task.

Notes

The issue seems to be intermittent and may be influenced by manual runs and user interaction, which could indicate a complex interaction between the scheduling mechanism, the concurrency guard, and user behavior.

Recommendation

Apply workaround: Implement additional logging or debugging to understand the behavior of the concurrency guard and scheduling mechanism, as the root cause of the issue is not immediately clear and may require further investigation to resolve.

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