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

Function getDefaultUdsSocketPath

src/utils/udsMessaging.ts:113–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

111 * transparently, but we use the pipe format on Windows for Node.js compat.
112 */
113export function getDefaultUdsSocketPath(): string {
114 if (defaultSocketPath) return defaultSocketPath
115 const nonce = randomBytes(8).toString('hex')
116 if (process.platform === 'win32') {
117 defaultSocketPath = `\\\\.\\pipe\\claude-code-${process.pid}-${nonce}`
118 return defaultSocketPath
119 }
120
121 defaultSocketPath = join(
122 tmpdir(),
123 'cc-socks',
124 `${process.pid}-${nonce}`,
125 'messaging.sock',
126 )
127 assertValidUnixSocketPath(defaultSocketPath)
128 return defaultSocketPath
129}
130
131/**
132 * Returns the socket path of the currently running server, or undefined

Callers 1

Calls 2

toStringMethod · 0.65

Tested by

no test coverage detected