Files
werkregie/doc/prs/2026-10-13-PR#60-phone-session-links.md
claude-code bcf45a9964
werkator build succeeded after 01:26
A Desktop session opens in the Claude app on a phone (#60)
Co-authored-by: claude-code <claude-code@javagil.de>
2026-10-13 11:33:03 +02:00

96 lines
4.4 KiB
Markdown

# PR#60: A Desktop Session Opens in the Claude App on a Phone
> **WARNING:** This document describes only the change applied in this PR.
> It may already be outdated once the next PR is merged.
> Historic PR documentation is not maintained along with new PRs; treat it as a snapshot.
## Problem
Since PR#30, a Claude Code session of Claude Desktop links to `claude://code/continue?session=local_…`,
and the Claude logo of the connections links to `claude://code/needs-input`.
A phone does not know the scheme `claude:`, so the page shows these rows and the logo there without a link.
A Desktop session with Remote Control has an address on claude.ai, e.g. `https://claude.ai/code/session_01…`.
Opened in Chrome on Android, this address opens the session in the Claude app; a manual check confirmed it.
Claude Desktop keeps these addresses in `bridgeSessionIds` of the session file
and appends each new one, as its log "Remote control enabled" shows.
## Non-Goals
- No change on the desktop: there the links stay `claude://`.
- No link on a phone for a session without Remote Control, or for a terminal session.
- No check whether Remote Control of the session is still on; claude.ai shows that itself.
## Specification
### Feature: a phone opens Claude Code in the Claude app
#### Scenario#60.01: a session with Remote Control links to claude.ai on a phone
&hellip; so that the user continues a waiting session on the phone.
- **Given** a Desktop session whose session file holds the `bridgeSessionIds` `session_A` and `session_B`
- **When** the page renders the session on a phone
- **Then** the session links to `https://claude.ai/code/session_B`
##### Verified by
- [ClaudeCodeSourceTest: a Desktop session with Remote Control has the address of its last one on claude.ai](../../dashboard/src/test/kotlin/de/hoennig/werkregie/dashboard/sources/ClaudeCodeSourceTest.kt)
- manual check in the browser as an Android phone, see "Solution"
#### Scenario#60.02: the desktop keeps Claude Desktop
&hellip; so that a session on the desktop still opens in Claude Desktop.
- **Given** the same Desktop session
- **When** the page renders the session on the desktop
- **Then** the session links to `claude://code/continue?session=local_…`
##### Verified by
- [ClaudeCodeSourceTest: a Desktop session links into Claude Desktop, a terminal session does not](../../dashboard/src/test/kotlin/de/hoennig/werkregie/dashboard/sources/ClaudeCodeSourceTest.kt)
- manual check in the browser, see "Solution"
#### Scenario#60.03: a session without Remote Control has no link on a phone
&hellip; so that a tap does not lead nowhere.
- **Given** a Desktop session without `bridgeSessionIds`
- **When** the page renders the session on a phone
- **Then** the session has no link
##### Verified by
- [ClaudeCodeSourceTest: a Desktop session without Remote Control has no address on claude.ai](../../dashboard/src/test/kotlin/de/hoennig/werkregie/dashboard/sources/ClaudeCodeSourceTest.kt)
#### Scenario#60.04: the Claude logo opens the Claude Code sessions on a phone
&hellip; so that the user finds a waiting session also without a row.
- **Given** the connections with the Claude logo
- **When** the user taps the logo on a phone
- **Then** the page opens `https://claude.ai/code`
##### Verified by
- manual check in the browser as an Android phone, see "Solution"
## Solution
- `Item` gets `phoneUrl`: where a phone opens an item whose `url` is an app of the desktop.
- `ClaudeCodeSource` sets it for a Desktop session to `https://claude.ai/code/` and the last of its `bridgeSessionIds`;
an ID that does not have the form `session_…` gives no address.
- On a phone, the page takes `phoneUrl` instead of a `claude:` link; without it, the row has no link as before.
- On a phone, the Claude logo of the connections opens `https://claude.ai/code`.
- A relay passes `phoneUrl` on with the item; an older server ignores it.
- The page has no tests; a local check with the live sessions on think in the browser pane showed:
as an Android phone (Pixel 8, 375 px), the logo links to `https://claude.ai/code` and each session to its `session_…`;
as a desktop, the links stay `claude://`.
- Version 0.37.0.
## Open Questions
- [x] The first or the last of several `bridgeSessionIds`?
The last: Claude Desktop appends a new one each time Remote Control starts for the session;
its log showed the dates in this order for a session with 8 of them.