MCPcopy Index your code
hub / github.com/codeaashu/claude-code / resolveClaudePath

Function resolveClaudePath

src/utils/deepLink/registerProtocol.ts:241–250  ·  view source on GitHub ↗

* Resolve the claude binary path for protocol registration. Prefers the * native installer's stable symlink (~/.local/bin/claude) which survives * auto-updates; falls back to process.execPath when the symlink is absent * (dev builds, non-native installs).

()

Source from the content-addressed store, hash-verified

239 * (dev builds, non-native installs).
240 */
241async function resolveClaudePath(): Promise<string> {
242 const binaryName = process.platform === 'win32' ? 'claude.exe' : 'claude'
243 const stablePath = path.join(getUserBinDir(), binaryName)
244 try {
245 await fs.realpath(stablePath)
246 return stablePath
247 } catch {
248 return process.execPath
249 }
250}
251
252/**
253 * Check whether the OS-level protocol handler is already registered AND

Callers 2

registerProtocolHandlerFunction · 0.85

Calls 1

getUserBinDirFunction · 0.85

Tested by

no test coverage detected