|
23 | 23 | [CmdletBinding()] |
24 | 24 | param( |
25 | 25 | [string]$Prompt, |
26 | | - [string]$Model = "claude-opus-4-8" |
| 26 | + [string]$Model # empty => Claude Code's default model |
27 | 27 | ) |
28 | 28 |
|
29 | 29 | $ErrorActionPreference = "Stop" |
30 | 30 |
|
| 31 | +# Only pass --model when one was given, so the default follows the user's Claude Code config. |
| 32 | +$modelArgs = @(if ($Model) { '--model', $Model }) |
| 33 | + |
31 | 34 | # --- Environment we will toggle. Capture originals so we can restore them. ----------------- |
32 | 35 | $cacheVars = @{ |
33 | 36 | "DISABLE_PROMPT_CACHING" = $null # keep caching ON ($null => remove if set in env) |
@@ -183,14 +186,14 @@ function Invoke-ClaudeRun([string]$label, [string]$query) { |
183 | 186 | # --- Turn 1: warm-up (writes the TUI prefix into cache) -------------------------------- |
184 | 187 | Write-Host "WARM-UP: in Claude, type hi and press Enter; wait for the reply, then /exit." -ForegroundColor Yellow |
185 | 188 | Wait-Key " Press any key to start the WARM-UP session..." |
186 | | - Start-Process -FilePath $ClaudeExe -ArgumentList '--model', $Model, '--append-system-prompt', $nonce -WorkingDirectory $WorkingDir -NoNewWindow -Wait |
| 189 | + Start-Process -FilePath $ClaudeExe -ArgumentList ($modelArgs + '--append-system-prompt', $nonce) -WorkingDirectory $WorkingDir -NoNewWindow -Wait |
187 | 190 |
|
188 | 191 | # --- Turn 2: measured (reads the prefix warm; keep it to ONE turn) --------------------- |
189 | 192 | Set-Clipboard -Value $query |
190 | 193 | Write-Host "MEASURED: the query is on your clipboard. Paste it (Ctrl+V), press Enter, wait, then /exit." -ForegroundColor Yellow |
191 | 194 | Write-Host " Do exactly ONE turn so the cost is just the query." -ForegroundColor DarkGray |
192 | 195 | Wait-Key " Press any key to start the MEASURED session..." |
193 | | - Start-Process -FilePath $ClaudeExe -ArgumentList '--model', $Model, '--append-system-prompt', $nonce -WorkingDirectory $WorkingDir -NoNewWindow -Wait |
| 196 | + Start-Process -FilePath $ClaudeExe -ArgumentList ($modelArgs + '--append-system-prompt', $nonce) -WorkingDirectory $WorkingDir -NoNewWindow -Wait |
194 | 197 |
|
195 | 198 | # Read official metrics; retry in case the config write lags process exit. |
196 | 199 | $r = $null |
|
0 commit comments