claude-code - 💡(How to fix) Fix Client-side soft session ceiling with graceful checkpoint for autonomous/subagent runs

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…

Error Message

The 5-hour session limit is enforced as a hard stop: when the budget is exhausted, Claude Code returns an error and refuses further prompts with no partial completion or graceful degradation. This is especially painful during long autonomous runs (an orchestrator dispatching subagents), which are uninterruptible without Esc killing the run mid-flight and losing in-progress state.

Fix Action

Fix / Workaround

The 5-hour session limit is enforced as a hard stop: when the budget is exhausted, Claude Code returns an error and refuses further prompts with no partial completion or graceful degradation. This is especially painful during long autonomous runs (an orchestrator dispatching subagents), which are uninterruptible without Esc killing the run mid-flight and losing in-progress state. The model itself has no visibility into remaining session budget and cannot run /usage on its own, so it cannot wind down gracefully. External usage monitors can alert the user, but there is no mechanism to translate that awareness into a clean stop — the user can only watch the bar and hope to catch a turn boundary, which doesn't exist during a subagent batch.

Lets the currently-executing subagent/task finish (no mid-edit kill). Blocks any new subagent dispatch or new tool-heavy work. Triggers a graceful wrap-up: commit/summarise in-progress work and write a resume note. Surfaces a clear message that the soft ceiling was hit and real budget remains for the wrap-up.

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)

https://github.com/anthropics/claude-code/issues/12657 similar issue - closed due to no-activity.

Problem Statement

The 5-hour session limit is enforced as a hard stop: when the budget is exhausted, Claude Code returns an error and refuses further prompts with no partial completion or graceful degradation. This is especially painful during long autonomous runs (an orchestrator dispatching subagents), which are uninterruptible without Esc killing the run mid-flight and losing in-progress state. The model itself has no visibility into remaining session budget and cannot run /usage on its own, so it cannot wind down gracefully. External usage monitors can alert the user, but there is no mechanism to translate that awareness into a clean stop — the user can only watch the bar and hope to catch a turn boundary, which doesn't exist during a subagent batch.

Proposed Solution

Proposed Feature A user-configurable soft session ceiling, enforced client-side (where the budget already lives — not by the model), e.g. in settings: softSessionCeiling: 85 // percent of 5-hour window When usage crosses the threshold, instead of continuing toward the hard limit, the client:

Lets the currently-executing subagent/task finish (no mid-edit kill). Blocks any new subagent dispatch or new tool-heavy work. Triggers a graceful wrap-up: commit/summarise in-progress work and write a resume note. Surfaces a clear message that the soft ceiling was hit and real budget remains for the wrap-up.

Keeping enforcement in the client (not exposing the budget to the model) avoids the model trading correctness for token savings, while still solving the real gap: no graceful landing before the hard wall.

Alternative Solutions

more frequent checkpoint commits to make mid-stream failures more recoverable.

Priority

Medium - Would be very helpful

Feature Category

Performance and speed

Use Case Example

  1. Session limit is about to expire.
  2. Subagents are running for 2+ hours
  3. when session limit nearing completion a graceful interrupt is added to allow the agents to gracefully exit, document the progress, commit if needed.

Additional Context

No response

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

claude-code - 💡(How to fix) Fix Client-side soft session ceiling with graceful checkpoint for autonomous/subagent runs