* `claude ssh` remote: ANTHROPIC_UNIX_SOCKET routes auth through a -R forwarded * socket to a local proxy, and the launcher sets a handful of placeholder auth * env vars that the remote's ~/.claude settings.env MUST NOT clobber (see * isAnthropicAuthEnabled). Strip them from any settings-sourced
( env: Record<string, string> | undefined, )
| 21 | * isAnthropicAuthEnabled). Strip them from any settings-sourced env object. |
| 22 | */ |
| 23 | function withoutSSHTunnelVars( |
| 24 | env: Record<string, string> | undefined, |
| 25 | ): Record<string, string> { |
| 26 | if (!env || !process.env.ANTHROPIC_UNIX_SOCKET) return env || {} |
| 27 | const { |
| 28 | ANTHROPIC_UNIX_SOCKET: _1, |
| 29 | ANTHROPIC_BASE_URL: _2, |
| 30 | ANTHROPIC_API_KEY: _3, |
| 31 | ANTHROPIC_AUTH_TOKEN: _4, |
| 32 | CLAUDE_CODE_OAUTH_TOKEN: _5, |
| 33 | ...rest |
| 34 | } = env |
| 35 | return rest |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * When the host owns inference routing (sets |