isRunningWithBun() ? "bun" : "node", // ... pathToClaudeCodeExecutable = join(__dirname2, "cli.js"), // ← claude コマンドの実体 } = {}, }) { // ... const child = spawn( executable, [...executableArgs, pathToClaudeCodeExecutable, ...args], { /* spawn options */ }, ); } TypeScript SDKの内部実装 CLIをサブプロセスとして実行している 7