claude-code - 💡(How to fix) Fix [BUG] Remote control disconnects after c.2 hours despite continous interactions [2 comments, 3 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#50767Fetched 2026-04-20 12:13:36
View on GitHub
Comments
2
Participants
3
Timeline
7
Reactions
0
Timeline (top)
labeled ×4commented ×2unlabeled ×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?

After roughly 2 hours of continuous messages to the claude app on my phone connected to a CLI session on my mac book pro with caffeinate -dis the session disconnects automatically with no way of recovering connection without touching the mac

What Should Happen?

It either not disconnect automatically or give me an option to reboot the connection on the iphone app without touching the mac

Error Messages/Logs

Steps to Reproduce

Chat for 2+ hours on the app without touching the mac. It happenes every time. It happened at least 10 times.

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

No response

Claude Code Version

v2.1.113

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

No response

extent analysis

TL;DR

The issue can be mitigated by investigating the idle timeout settings in the Claude Code configuration or the Anthropics API to prevent automatic disconnection after 2 hours of inactivity.

Guidance

  • Investigate the caffeinate command usage to ensure it is correctly configured to prevent the Mac from sleeping or disconnecting the session.
  • Review the Claude Code documentation for any settings related to idle timeouts or session persistence to see if there are any configurable options to extend or disable the timeout.
  • Check the Anthropics API documentation for any similar settings or parameters that could be adjusted to prevent automatic disconnection.
  • Consider implementing a keep-alive mechanism, such as sending periodic messages or pings, to maintain the connection and prevent it from timing out.

Example

No code example is provided as the issue does not specify any specific code or configuration that needs to be modified.

Notes

The solution may depend on the specific configuration and implementation of the Claude Code and Anthropics API, which are not fully detailed in the issue. Further investigation into the documentation and settings of these systems is necessary to determine the best course of action.

Recommendation

Apply workaround: Implement a keep-alive mechanism or adjust idle timeout settings to prevent automatic disconnection, as upgrading to a fixed version is not implied in the issue.

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