[BUG] Self-hosted runner: session waiting on ExitPlanMode approval is idle-released, and the approval prompt is orphaned on resume

Status Open
Reported on v2.1.294
Maintainer reply None cached
Activity 0 comments · opened Oct 8, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

On a self-hosted environment, a session that has called ExitPlanMode and is waiting for the user to approve the plan gets released by --release-idle-session-min. When the user returns and the session resumes on a fresh runner, the pending approval is gone. The ExitPlanMode call comes back with "You are not in plan mode", so the user never gets to approve the plan.

This happened twice in one session, after idle windows of about 5 h and about 1 h. On the second resume the debug log showed:

Plan file missing during resume: .../plans/<name>.md. Attempting recovery.
Plan recovered from file snapshot, 21236 chars

The reference for --release-idle-session-min says a session "still mid-turn, including one holding ... an approval requested from inside a running tool call, doesn't count as idle". A pending ExitPlanMode approval is a tool call waiting on the user, so by that description the session should not have been released.

What Should Happen?

Either:

  • a pending ExitPlanMode approval keeps the session from being released, as other in-tool approvals do; or
  • if it is released, the approval prompt is restored on resume, so the user can still approve or reject the plan.

Error Messages/Logs

ExitPlanMode result on resume: You are not in plan mode

Steps to Reproduce

  1. Run claude self-hosted-runner with --release-idle-session-min 10.
  2. In a session, enter plan mode and let Claude call ExitPlanMode.
  3. Do not respond to the approval prompt for more than 10 minutes.
  4. The runner releases the session.
  5. Send a message to resume it on a fresh runner.
  6. The approval prompt is gone, and the ExitPlanMode call reports "You are not in plan mode".

Claude Model

Opus

Is this a regression?

I don't know

Claude Code Version

2.1.294

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Related: #100474 (resumed session re-enters plan mode despite an explicit --permission-mode).

View original on GitHub ↗