The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 12:15 UTC
fix(server): resolve Claude WinGet launchers on Windows (#32138)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Sudharsan committed
Nov 15, 2026 at 10:24 UTC
5ee4fd4f25a5fa009ccf173191eaed507e42e9f6
2 files changed
+20
-3
apps/server/src/provider/Drivers/ClaudeExecutable.test.ts
+13
@@ -9,6 +9,9 @@ const NPM_DIR = "C:\\Users\\dev\\AppData\\Roaming\\npm";
9
const NPM_SHIM = `${NPM_DIR}\\claude.cmd`;
10
const NPM_PACKAGE_EXE = `${NPM_DIR}\\node_modules\\@anthropic-ai\\claude-code\\bin\\claude.exe`;
11
const NPM_PACKAGE_CLI = `${NPM_DIR}\\node_modules\\@anthropic-ai\\claude-code\\cli.js`;
12
+const WINGET_DIR = "C:\\Users\\dev\\AppData\\Local\\Microsoft\\WinGet";
13
+const WINGET_SHIM = `${WINGET_DIR}\\Links\\claude.cmd`;
14
+const WINGET_EXE = `${WINGET_DIR}\\Packages\\Anthropic.ClaudeCode_Microsoft.Winget.Source_8wekyb3d8bbwe\\claude.exe`;
15
16
function withWindowsResolution(input: {
17
readonly resolvedCommand: string | undefined;
@@ -37,6 +40,16 @@ describe("resolveClaudeSdkExecutablePath", () => {
40
}),
41
);
42
43
+ it.effect("follows the WinGet launcher to the package's native binary", () =>
44
+ Effect.gen(function* () {
45
+ expect(
46
+ yield* resolveClaudeSdkExecutablePath("claude", {}).pipe(
47
+ withWindowsResolution({ resolvedCommand: WINGET_SHIM, existingFiles: [WINGET_EXE] }),
48
+ ),
49
+ ).toBe(WINGET_EXE);
50
+ }),
51
+ );
52
+
53
it.effect("follows .bat and .ps1 launcher shims the same way", () =>
54
Effect.gen(function* () {
55
for (const shim of [`${NPM_DIR}\\claude.bat`, `${NPM_DIR}\\claude.ps1`]) {
apps/server/src/provider/Drivers/ClaudeExecutable.ts
+7
-3
@@ -13,10 +13,14 @@ const WINDOWS_SHIM_EXTENSIONS: ReadonlySet<string> = new Set([".cmd", ".bat", ".
13
export const isWindowsClaudeLauncherShimPath = (filePath: string): boolean =>
14
WINDOWS_SHIM_EXTENSIONS.has(NodePath.win32.extname(filePath).toLowerCase());
15
16
-/** New packages provide bin/claude.exe; older packages need a JavaScript runtime for cli.js. */
17
-const NPM_PACKAGE_ENTRY_CANDIDATES = [
16
+/**
17
+ * npm: new packages provide bin/claude.exe; older ones need a JavaScript runtime for cli.js.
18
+ * WinGet: Links\claude.cmd forwards to the package's native executable under ..\Packages.
19
+ */
20
+const PACKAGE_ENTRY_CANDIDATES = [
21
["node_modules", "@anthropic-ai", "claude-code", "bin", "claude.exe"],
22
["node_modules", "@anthropic-ai", "claude-code", "cli.js"],
23
+ ["..", "Packages", "Anthropic.ClaudeCode_Microsoft.Winget.Source_8wekyb3d8bbwe", "claude.exe"],
24
] as const;
25
26
export type ExecutableFileCheck = (filePath: string) => boolean;
@@ -53,7 +57,7 @@ export const resolveClaudeSdkExecutablePath = Effect.fn("resolveClaudeSdkExecuta
57
}
58
59
const shimDirectory = NodePath.win32.dirname(resolved);
56
- for (const entrySegments of NPM_PACKAGE_ENTRY_CANDIDATES) {
60
+ for (const entrySegments of PACKAGE_ENTRY_CANDIDATES) {
61
const candidate = NodePath.win32.join(shimDirectory, ...entrySegments);
62
if (isFile(candidate)) {
63
return candidate;