Remote sessions let you start Claude Code on any machine — a server, your workstation, a cloud VM — and then interact with it from a web browser or the Claude mobile app. The session runs entirely in your terminal; the browser or phone is just a remote input/output interface.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/VineeTagarwal-code/claude-code/llms.txt
Use this file to discover all available pages before exploring further.
How it works
When you start Claude Code with--remote, it creates a session on claude.ai and establishes a bidirectional bridge. Messages you type on your phone or in the browser are forwarded to the running Claude Code process. Responses stream back in real time.
The session URL follows the pattern:
Starting a remote session
Launch Claude Code in remote mode
Add the Claude Code authenticates with
--remote flag when starting Claude Code:claude.ai, creates a new session, and displays a QR code along with the session URL.Get the session URL
After startup, run The command shows:
/session to display the QR code and URL at any time:- A text-art QR code that links to your session URL
- The URL in plain text for copying:
Open in browser: https://claude.ai/code/<session-id>
/session only works when Claude Code was started with --remote. If you run it outside of remote mode, you will see: “Not in remote mode. Start with claude --remote to use this command.”Connect from your device
Scan the QR code with your phone’s camera or open the URL in any browser. You will land on the claude.ai interface connected to your running session.From here you can send messages, view responses, and use the full conversation interface — all backed by the Claude Code process running in your terminal.
Connecting the Claude mobile app
The/mobile command shows QR codes for downloading the Claude mobile app:
- iOS:
https://apps.apple.com/app/claude-by-anthropic/id6473753684 - Android:
https://play.google.com/store/apps/details?id=com.anthropic.claude
/session to get the session URL, then navigate to it in the app’s browser.
The /desktop command
The/desktop command initiates a handoff to the Claude desktop application. Use this to transfer a session from the terminal interface to the desktop app for a richer experience.
Commands available in remote mode
When Claude Code is running in remote mode, the set of available slash commands is restricted to those that are safe to use without a local filesystem, IDE connection, or shell execution context:| Command | Description |
|---|---|
/session | Show QR code and URL for the current remote session |
/mobile | Show QR codes for the Claude mobile app |
/exit | Exit Claude Code |
/clear | Clear the conversation |
/help | Show available commands |
/theme | Change the terminal color theme |
/color | Change the agent response color |
/vim | Toggle vim keybindings |
/cost | Show session cost so far |
/usage | Show token usage |
/copy | Copy the last message |
/btw | Add a note to the conversation |
/feedback | Send feedback |
/plan | Toggle plan mode |
/keybindings | Manage keybindings |
/statusline | Toggle the status line |
/stickers | Stickers |
/ide, /memory, /mcp, /plugin, and others — are not available during a remote session.
Commands that work over the bridge
When commands arrive from the mobile or web client over the Remote Control bridge, an additional set oflocal-type commands is permitted. These produce text output that streams back to the remote client:
| Command | Description |
|---|---|
/compact | Shrink context |
/clear | Wipe transcript |
/cost | Show session cost |
/summary | Summarize conversation |
/release-notes | Show changelog |
/files | List tracked files |
prompt (skills and plugin commands that expand to text sent to the model) are always safe over the bridge.
Security
Session tokens
Each remote session is identified by a session ID embedded in the URL. The session ID is tied to your claude.ai authentication — only your logged-in account can access it. Session IDs follow the formatsession_<uuid> in production. Staging sessions contain _staging_ in the ID, and local development sessions contain _local_.
Trusted device tokens
The bridge uses trusted device tokens to authorize reconnection without re-authentication. These tokens are stored locally and exchanged during the bridge handshake.Bridge protocol
The bridge uses a CCR v2 transport (Server-Sent Events or WebSocket depending on the server endpoint). The session connects via:POST /v1/code/sessions— creates the session and returns a session ID.POST /v1/code/sessions/{id}/bridge— exchanges an OAuth token for a short-lived worker JWT.- The worker JWT is used to maintain the SSE/WebSocket connection.