MCPcopy
hub / github.com/claude-code-best/claude-code / openCurrentSessionInDesktop

Function openCurrentSessionInDesktop

src/utils/desktopDeepLink.ts:206–236  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

204 * Returns an object with success status and any error message.
205 */
206export async function openCurrentSessionInDesktop(): Promise<{
207 success: boolean
208 error?: string
209 deepLinkUrl?: string
210}> {
211 const sessionId = getSessionId()
212
213 // Check if Desktop is installed
214 const installed = await isDesktopInstalled()
215 if (!installed) {
216 return {
217 success: false,
218 error:
219 'Claude Desktop is not installed. Install it from https://claude.ai/download',
220 }
221 }
222
223 // Build and open the deep link
224 const deepLinkUrl = buildDesktopDeepLink(sessionId)
225 const opened = await openDeepLink(deepLinkUrl)
226
227 if (!opened) {
228 return {
229 success: false,
230 error: 'Failed to open Claude Desktop. Please try opening it manually.',
231 deepLinkUrl,
232 }
233 }
234
235 return { success: true, deepLinkUrl }
236}

Callers 1

performHandoffFunction · 0.85

Calls 4

getSessionIdFunction · 0.85
isDesktopInstalledFunction · 0.85
buildDesktopDeepLinkFunction · 0.85
openDeepLinkFunction · 0.85

Tested by

no test coverage detected