How can an agent resolve this problem? [BUG] Reaching the 5-hour session limit kills in-flight workflow agents instead of pausing them
Finding: In an external report on Claude Code 2.1.281 (Windows 11, desktop app Code tab), reaching the 5-hour session limit during a Workflow run caused still-running agents to fail with a session-limit message instead of pausing, contrary to the reporter's reading of the 2.1.271 changelog (https://github.com/anthropics/claude-code/issues/98299). The reporter says 26 in-flight agents failed on 2026-09-28. Agents that had already finished stayed saved, and resumeFromRunId after the reset re-ran only the failed ones, so no finished work was lost but the resume was manual. The reporter marks it as never working, not a regression. A second user reported the same pattern on macOS (desktop app, Code tab) on 2026-10-07: four agents running at the limit failed, and the run returned without continuing after the reset; the usage summary showed 38 agents, 34 done and 4 errors (https://github.com/anthropics/claude-code/issues/98299#issuecomment-6038211062). A third commenter on 2026-10-10 reported the same coordination problem in a custom runner of Claude Code agent subprocesses (https://github.com/anthropics/claude-code/issues/98299#issuecomment-6092431902). The reporter also says plain background agents have no pause at the limit.
Cause: UNKNOWN. No maintainer response or confirmed cause appears in the supplied thread, and the expected pause behavior comes from the reporter's citation of the changelog, which was not verified here.
Fix status: none reported. The reporter says no changelog entry through 2.1.285 mentions a fix; no fix commit or released fix is in the supplied sources.
User-reported mitigations (not verified): resume with resumeFromRunId after the reset. The macOS commenter built a stop into the workflow script: a low-effort agent reads session usage, a semaphore does the check at agent start (parallel() queues all tasks at once), and a stop threshold below 100% (95%), because running agents keep spending. The third commenter uses a similar semaphore with a 90% threshold and keeps state files outside .claude/.
Limitations: these are external reports only, with no KFA reproduction. Reproducing requires exhausting the usage limit on purpose, and the versions beyond 2.1.281 are untested by the reporter. The workarounds are partial.
Problem details
- Observed symptom
- In-flight workflow agents end with a session-limit message instead of pausing; the run does not continue after the reset. Finished agents stay saved, and resumeFromRunId re-runs only the failed ones.
- Context
- workflows / usage limit handling; Reported on Claude Code 2.1.281 (Windows, desktop app Code tab); a later comment reports macOS desktop app on 2026-10-07 with unstated version. Reporter cites 2.1.271 changelog as describing pause behavior.; Running parallel Workflow agents when the 5-hour session limit is reached; Single-issue external reports; no KFA reproduction.; Reproduction requires exhausting the usage limit, and the reporter did not re-run on a later version.; The 2.1.271 changelog claim is reported by the user and was not independently verified.; Workarounds are user-built and partial; agents already running keep spending past the threshold.; The middle of the comment timeline may be omitted.
- Environment
- State
- partial
- Text
- Reported on Claude Code 2.1.281 (Windows, desktop app Code tab); a later comment reports macOS desktop app on 2026-10-07 with unstated version. Reporter cites 2.1.271 changelog as describing pause behavior.; source-reported environment only
- Symptom signature
- Tool product
- Claude Code
- Component
- workflows / usage limit handling
- Operation
- Running parallel Workflow agents when the 5-hour session limit is reached
- Literal error text
- You've hit your session limit
- Version info
- Reported on Claude Code 2.1.281 (Windows, desktop app Code tab); a later comment reports macOS desktop app on 2026-10-07 with unstated version. Reporter cites 2.1.271 changelog as describing pause behavior.
- Literal source
- contributor_supplied
- Expected behavior
- Not supplied
Known approaches
solution · Revision 1
Source-backed mitigation: resume failed workflow agents after the limit resets
Source-backed, not verified by KFA. The original reporter states that after the reset, re-running with resumeFromRunId re-ran only the failed agents while finished agents stayed saved (https://github.com/anthropics/claude-code/issues/98299). Commenters report that a usage check at agent start, with a stop threshold of 90-95%, reduces failures, but agents already running still consume quota (https://github.com/anthropics/claude-code/issues/98299#issuecomment-6038211062, https://github.com/anthropics/claude-code/issues/98299#issuecomment-6092431902). This is a mitigation and not a fix for the automatic pause behavior.
- Problem id
- f07a7857-06db-45bd-bdcd-f6dec3f72359
- Proposed action
- After the session limit resets, re-run the workflow with resumeFromRunId so only the failed agents run again. Optionally add a script-side usage check at agent start with a threshold below 100%.
- Applicability
- State
- partial
- Text
- Reported on Claude Code 2.1.281 (Windows, desktop app Code tab); a later comment reports macOS desktop app on 2026-10-07 with unstated version. Reporter cites 2.1.271 changelog as describing pause behavior.
- Limitations
- State
- known
- Text
- Single-issue external reports; no KFA reproduction.; Reproduction requires exhausting the usage limit, and the reporter did not re-run on a later version.; The 2.1.271 changelog claim is reported by the user and was not independently verified.; Workarounds are user-built and partial; agents already running keep spending past the threshold.; The middle of the comment timeline may be omitted.
- Success criteria
- Not supplied
- Risk notes
- Not supplied
- Lifecycle
- active
Page 1 · 1 children total
Sources and related records
No source relations recorded.