/remote-control disconnect throws "Cannot read properties of undefined (reading 'session_url')"
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
- Claude Code: 2.1.220
- OS: macOS 26.5.2 (Build 25F84), arm64
- Install method: npm via mise
What's Wrong?
Running /remote-control and then disconnecting throws:
Remote Control failed to disconnect: Cannot read properties of undefined (reading 'session_url')
The error occurs in the disconnect flow. Connecting works fine — only disconnecting is broken.
Steps to Reproduce
- Run
/remote-controlto start a remote control session - Attempt to disconnect the session (e.g., click disconnect in the UI or use the disconnect action)
- Error appears:
Remote Control failed to disconnect: Cannot read properties of undefined (reading 'session_url')
Expected Behavior
The session disconnects cleanly without error.
Actual Behavior
An uncaught TypeError is thrown because session_url is being read from an undefined object in the disconnect path. The session does not disconnect cleanly.
Additional Context
Prior changelogs mention /remote-control fixes, suggesting this area has seen recent churn. The connect path works correctly; the regression appears isolated to the disconnect handler.
What Should Happen?
The /remote-control session disconnects cleanly without throwing a JavaScript TypeError. The disconnect handler should guard against undefined before accessing session_url.
Error Messages/Logs
Remote Control failed to disconnect: Cannot read properties of undefined (reading 'session_url')
Steps to Reproduce
- Open Claude Code (version 2.1.220) on macOS 26.5.2 arm64
- Run the
/remote-controlslash command to start a remote control session - Once the session is active, attempt to disconnect (click the disconnect button / use the disconnect action in the UI)
- Observe the error:
Remote Control failed to disconnect: Cannot read properties of undefined (reading 'session_url')
Note: Connection/start works correctly. The error is isolated to the disconnect path.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.220 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗