Session idle timeout disconnects during long-running background tasks
Problem
Claude Code sessions disconnect after a period of idle input, even when background tasks are actively running. This forces users to babysit sessions during long-running workflows instead of kicking off work and walking away.
Reproduction
- Start a Claude Code session
- Kick off a long-running background task (e.g.,
run_in_background: trueon a 15-30 minute build) - Walk away from the computer
- Return to find the session disconnected — background task results lost
Real-World Workflow This Breaks
User: "Build iOS app, submit to TestFlight, then deploy backend to staging"
Claude: Starts EAS local build (15-30 min) in background
...user walks away...
...session disconnects after idle timeout...
...build finishes but no one is there to run the submit step...
This is especially painful for:
- EAS/Xcode local builds (15-45 minutes)
- Waiting on CI/CD pipelines to complete before next step
- Docker builds on remote servers (5-15 minutes)
- Multi-step deployment workflows where each step depends on the previous
- Cursor Agent dispatches that take 5-20 minutes to complete
Expected Behavior
At minimum, one of:
- No idle timeout while background tasks are running — if Claude Code initiated a background task, keep the session alive until it completes
- Persistent background task results — if the session does disconnect, the results should be available when the user reconnects or starts a new session
- Configurable idle timeout — let users set their own timeout (or disable it) for long-running workflows
- Session resume — ability to reconnect to a previous session and pick up where it left off, including pending background task results
Environment
- macOS Darwin 25.3.0 (MacBookPro16,1)
- Claude Code CLI
- Workflows involve: EAS builds, Docker remote builds, GitHub Actions monitoring, Cursor Agent CLI dispatches
Workaround
Currently the only workaround is to chain everything into a standalone shell script that runs outside Claude Code, which defeats the purpose of the orchestration capabilities.
Impact
This is a significant workflow blocker for developers who use Claude Code as an orchestration layer for multi-step, long-running development tasks. The whole value proposition of background tasks is diminished if you have to keep actively interacting with the session to prevent disconnection.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗