[BUG] Desktop app on Windows: every new PowerShell tool call waits ~154 s before the command starts (dialog, permissions and host IPC ruled out); Bash is instant (same as #57960, closed stale; still present on 2.1.270)

Status Open
Reported on v2.1.138
Maintainer reply None cached
Activity 3 comments · opened Sep 14, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

<html>
<body>
<!--StartFragment--><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">This is the same bug as #57960 (filed May 2026 on Claude Code 2.1.138, closed as stale without a response). That report's desktop log shows the mechanism: "Streaming stall detected: 150.0s gap between events" and "permissionDecisionMs=150717". Four months and about 130 builds later the delay is unchanged; the measurements below cover every build from 2.1.220 to 2.1.270.</p><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">In the Claude Desktop app (Code tab) on Windows, every PowerShell tool call that has not been run before in the session takes 153 to 160 seconds from tool invocation until the command actually starts. When a permission dialog is shown, it appears only at the end of that wait and is confirmed within seconds. The Bash tool is unaffected (median 2.7 s).</p><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Measured from the session transcripts (<code data-epitaxy-inline-code="" style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; font-family: anthropic-mono, ui-monospace, monospace, &quot;SF Mono&quot;, ui-monospace, Menlo, Consolas, monospace; font-feature-settings: &quot;calt&quot; 0, &quot;liga&quot; 0; font-variation-settings: normal; font-size: 12px; font-variant-ligatures: none; text-rendering: optimizelegibility; background: none 0% 0% / auto repeat scroll padding-box border-box color(srgb 0.0431373 0.0431373 0.0431373 / 0.05); color: rgb(11, 11, 11); border-radius: 4px; padding-block: 1px; padding-inline: 2px; line-height: 1.4;">~/.claude/projects/&lt;project&gt;/&lt;session&gt;.jsonl</code>, tool_use timestamp to tool_result timestamp) across 224 sessions:</p><div class="epitaxy-table-scroll" style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: auto; app-region: initial; text-rendering: optimizelegibility; scrollbar-color: auto; overflow-x: auto; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">

Tool | Calls | Median | p90 | Total
-- | -- | -- | -- | --
PowerShell | 1244 | 154.1 s | 168.4 s | 40.1 h
Bash | 10827 | 2.7 s | 7.9 s | 16.4 h

</div><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">851 of the 1244 PowerShell calls (68 %) took longer than 60 s; those alone add up to 37.8 hours over 121 sessions. The delay is present in every Claude Code build I have used, 2.1.220 through 2.1.270 (per-version table in Additional Information).</p><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Where the time goes: a probe command wrote its own start time. Tool call issued at 17:21:54, the command itself started at 17:24:30.453 and finished at 17:24:30.572 (119 ms). The entire wait happens before the command starts.</p><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">The same command repeated verbatim returns in 2 to 3 seconds, so some per-command result is cached after the first run.</p><!--EndFragment-->
</body>
</html>

What Should Happen?

A PowerShell tool call should start within a few seconds, like the Bash tool does on the same machine, and any permission dialog should appear immediately rather than after ~150 s.

Error Messages/Logs

No error message is shown; the call simply waits and then succeeds.

Process-start watcher (WMI, 200 ms polling) during one slow call, tool_use issued at 16:44:25:

16:44:25 bash.exe parent claude.exe (PreToolUse hook, finishes in ~1 s) 16:44:26 powershell.exe parent claude.exe -NoProfile -NonInteractive -NoLogo -EncodedCommand ... (AST parser script) ... no process activity related to the call for ~150 s ... ~16:47:00 the actual command runs

The EncodedCommand decodes to the PowerShell AST parser script ([System.Management.Automation.Language.Parser]::ParseInput, output via ConvertTo-Json -Depth 10 -Compress). Run manually with "Get-Date" as input it completes in 1.07 s and returns "valid":true.

Timing of individual calls in one session (2026-09-14, local time, durations from the transcript):

18:00:08 Get-Date auto mode sandbox on 153.2 s 18:11:00 Get-Date (exact repeat) manual mode sandbox on 2.6 s 18:11:21 Get-Process -Name explorer | Select-Object -First 1 ... manual mode sandbox on 159.5 s 18:14:23 Start-Sleep -Milliseconds 10 manual mode sandbox on 158.8 s 18:19:42 Get-Process -Name explorer manual mode sandbox on 153.3 s 18:23:03 Get-Process -Name explorer (exact repeat) manual mode sandbox on 2.2 s 17:51:30 $a = Get-Date; "..." auto mode sandbox OFF 156.7 s (dangerouslyDisableSandbox: true)

Startup cost of the shell itself, measured on the same machine: powershell.exe -NoProfile -Command 1 0.63 to 0.70 s bash.exe -c "echo x" 0.14 s

Steps to Reproduce

  1. Open a project in the Claude Desktop app (Code tab) on Windows 11.
  2. Ask Claude to run a trivial PowerShell tool command, for example Get-Date.
  3. Observe: the result (or the permission dialog) appears only after roughly 150 seconds.
  4. Ask Claude to run the identical command again: it returns in 2 to 3 seconds.
  5. Ask Claude to run an equivalent Bash command (date): it returns in 2 to 4 seconds.

Reproduces in auto mode and in manual mode, with and without the sandbox, with and without matching permissions.allow rules, with simple and with compound commands.

Claude Model

Other

Is this a regression?

No, this never worked

Last Working Version

none observed

Claude Code Version

2.1.270 (Claude Code), bundled in Claude Desktop app 1.52386.6.0 (Windows Store package Claude_1.52386.6.0_x64__pzs8sxrjxfjjc). A separate CLI install reports 2.1.236 but was not used for these sessions.

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Other

Additional Information

<html>
<body>
<!--StartFragment--><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Environment</p><ul style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px 0px 0px 20px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; list-style: outside; text-rendering: optimizelegibility; gap: 6px; flex-direction: column; display: flex; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">Windows 11 Pro 10.0.26200</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">Windows PowerShell 5.1.26100.9444; pwsh (PowerShell 7) is not installed</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">Git for Windows present; the Bash tool uses Git Bash and works normally</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">Workspace trust accepted (hasTrustDialogAccepted: true)</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">One PreToolUse hook with matcher<span> </span><code data-epitaxy-inline-code="" style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; font-family: anthropic-mono, ui-monospace, monospace, &quot;SF Mono&quot;, ui-monospace, Menlo, Consolas, monospace; font-feature-settings: &quot;calt&quot; 0, &quot;liga&quot; 0; font-variation-settings: normal; font-size: 12px; font-variant-ligatures: none; text-rendering: optimizelegibility; background: none 0% 0% / auto repeat scroll padding-box border-box color(srgb 0.0431373 0.0431373 0.0431373 / 0.05); color: rgb(11, 11, 11); border-radius: 4px; padding-block: 1px; padding-inline: 2px; line-height: 1.4;">Bash|PowerShell</code><span> </span>(timeout 10 s). It applies equally to both tools and Bash is fast, so it is not the cause.</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">Project<span> </span><span role="button" tabindex="0" class="inline-block rounded-[4px] focus-visible:outline-hidden hide-focus-ring focus-visible:shadow-focus" style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: no-drag; cursor: default; display: inline-block; border-radius: 4px; text-rendering: optimizelegibility;"><code data-epitaxy-inline-code="" data-epitaxy-file-ref="" style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; font-family: inherit; font-feature-settings: &quot;calt&quot; 0, &quot;liga&quot; 0; font-variation-settings: normal; font-size: inherit; font-variant-ligatures: none; text-rendering: optimizelegibility; background: 0px 0px; color: rgb(24, 79, 149); border-radius: 4px; padding-block: 1px; padding-inline: 2px; line-height: inherit; --code-chip-ink: #184f95;">.claude/settings.json</code></span><span> </span>contains 40<span> </span><code data-epitaxy-inline-code="" style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; font-family: anthropic-mono, ui-monospace, monospace, &quot;SF Mono&quot;, ui-monospace, Menlo, Consolas, monospace; font-feature-settings: &quot;calt&quot; 0, &quot;liga&quot; 0; font-variation-settings: normal; font-size: 12px; font-variant-ligatures: none; text-rendering: optimizelegibility; background: none 0% 0% / auto repeat scroll padding-box border-box color(srgb 0.0431373 0.0431373 0.0431373 / 0.05); color: rgb(11, 11, 11); border-radius: 4px; padding-block: 1px; padding-inline: 2px; line-height: 1.4;">permissions.allow</code><span> </span>rules such as<span> </span><code data-epitaxy-inline-code="" style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; font-family: anthropic-mono, ui-monospace, monospace, &quot;SF Mono&quot;, ui-monospace, Menlo, Consolas, monospace; font-feature-settings: &quot;calt&quot; 0, &quot;liga&quot; 0; font-variation-settings: normal; font-size: 12px; font-variant-ligatures: none; text-rendering: optimizelegibility; background: none 0% 0% / auto repeat scroll padding-box border-box color(srgb 0.0431373 0.0431373 0.0431373 / 0.05); color: rgb(11, 11, 11); border-radius: 4px; padding-block: 1px; padding-inline: 2px; line-height: 1.4;">PowerShell(Get-Date)</code>,<span> </span><code data-epitaxy-inline-code="" style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; font-family: anthropic-mono, ui-monospace, monospace, &quot;SF Mono&quot;, ui-monospace, Menlo, Consolas, monospace; font-feature-settings: &quot;calt&quot; 0, &quot;liga&quot; 0; font-variation-settings: normal; font-size: 12px; font-variant-ligatures: none; text-rendering: optimizelegibility; background: none 0% 0% / auto repeat scroll padding-box border-box color(srgb 0.0431373 0.0431373 0.0431373 / 0.05); color: rgb(11, 11, 11); border-radius: 4px; padding-block: 1px; padding-inline: 2px; line-height: 1.4;">PowerShell(Get-Process)</code>. They do not change the timing (see #73587 and #82523 for related rule-matching reports).</li></ul><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Ruled out</p><ul style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px 0px 0px 20px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; list-style: outside; text-rendering: optimizelegibility; gap: 6px; flex-direction: column; display: flex; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">PowerShell startup: 0.6 to 0.8 s</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">Sandbox: identical delay with dangerouslyDisableSandbox: true</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">Auto mode classifier: identical delay in manual mode</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">Permission rules and trust: identical delay for allow-listed commands</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">dialogExpiry: default 5 min and resolves to cancel, does not match 155 s</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">AST parser subprocess: fast and valid when run manually</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">Command complexity:<span> </span><code data-epitaxy-inline-code="" style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; font-family: anthropic-mono, ui-monospace, monospace, &quot;SF Mono&quot;, ui-monospace, Menlo, Consolas, monospace; font-feature-settings: &quot;calt&quot; 0, &quot;liga&quot; 0; font-variation-settings: normal; font-size: 12px; font-variant-ligatures: none; text-rendering: optimizelegibility; background: none 0% 0% / auto repeat scroll padding-box border-box color(srgb 0.0431373 0.0431373 0.0431373 / 0.05); color: rgb(11, 11, 11); border-radius: 4px; padding-block: 1px; padding-inline: 2px; line-height: 1.4;">Get-Date</code><span> </span>alone is as slow as compound pipelines</li></ul><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">PowerShell tool call duration by Claude Code build and entry point (all sessions of this project since August 2026):</p><div class="epitaxy-table-scroll" style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: auto; app-region: initial; text-rendering: optimizelegibility; scrollbar-color: auto; overflow-x: auto; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">

Version | Entry point | Calls | Median | p90 | over 60 s
-- | -- | -- | -- | -- | --
2.1.220 | sdk-ts | 44 | 31.6 s | 151.9 s | 45 %
2.1.221 | claude-desktop | 68 | 153.3 s | 159.5 s | 66 %
2.1.222 | claude-desktop | 28 | 153.3 s | 164.9 s | 79 %
2.1.227 | claude-desktop | 16 | 39.6 s | 153.6 s | 44 %
2.1.229 | claude-desktop | 55 | 152.0 s | 155.8 s | 62 %
2.1.234 | claude-desktop | 84 | 154.6 s | 160.8 s | 83 %
2.1.236 | claude-desktop | 6 | 153.0 s | 156.2 s | 67 %
2.1.236 | sdk-ts | 17 | 151.2 s | 155.9 s | 59 %
2.1.237 | claude-desktop | 246 | 155.1 s | 170.0 s | 68 %
2.1.241 | claude-desktop | 29 | 60.2 s | 172.1 s | 52 %
2.1.246 | claude-desktop | 122 | 157.5 s | 175.2 s | 75 %
2.1.247 | claude-desktop | 159 | 154.2 s | 170.0 s | 74 %
2.1.258 | claude-desktop | 41 | 153.7 s | 162.4 s | 66 %
2.1.260 | claude-desktop | 280 | 154.6 s | 168.4 s | 67 %
2.1.270 | claude-desktop | 49 | 155.5 s | 157.2 s | 65 %

</div><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Additional observations</p><ul style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px 0px 0px 20px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; list-style: outside; text-rendering: optimizelegibility; gap: 6px; flex-direction: column; display: flex; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">A few calls per session take 33 to 38 s instead of ~155 s; no pattern identified.</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">Near-identical repeats (same script, different log file name) are also fast (3 to 10 s).</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">The user confirms every permission dialog within seconds; the dialog only shows up after the wait, so the delay precedes the prompt, consistent with #69647.</li></ul><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Related issues</p><ul style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px 0px 16px; padding: 0px 0px 0px 20px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; list-style: outside; text-rendering: optimizelegibility; gap: 6px; flex-direction: column; display: flex; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;"><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">#57960 Claude Desktop on Windows: PowerShell tool call permission prompt delayed ~2m35s before appearing: identical bug, closed as stale without a fix</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">#45099 PowerShell prompt freezing (referenced by #57960)</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">#69647 PowerShell tool takes ~3 minutes to spawn in VS Code extension on Windows (Bash tool is instant): same symptom, different host, 2.1.183</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">#73587 Desktop app ignores permissions.allow rules</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">#82523 PowerShell allow rules do not prevent the prompt</li><li style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility;">#59454 PowerShell pre-validation intermittently fails or times out on Windows</li></ul><p style="box-sizing: border-box; border: 0px solid color(srgb 0.0431373 0.0431373 0.0431373 / 0.1); margin: 0px; padding: 0px; outline-color: rgb(37, 106, 191); scrollbar-width: thin; app-region: initial; text-rendering: optimizelegibility; color: rgb(11, 11, 11); font-family: anthropic-sans, system-ui, &quot;Segoe UI&quot;, Roboto, Helvetica, Arial, sans-serif, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; white-space: normal; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">I can provide the transcript-analysis script and the WMI watcher output on request.</p><!--EndFragment-->
</body>
</html>

View original on GitHub ↗

3 Comments

marcoraepple-sys · 1 month ago

Minimal reproduction (Windows 11, Claude Code 2.1.270):

echo "Run Get-Date using the PowerShell tool. Wait for its result, then run date using the Bash tool. Output only the two results." \
  | claude -p --permission-mode auto --allowedTools "PowerShell,Bash"

Durations read from the session transcript, three consecutive runs: PowerShell 154.0 s, 153.8 s, 153.6 s. Bash in the same sessions 2.7 s and 3.2 s. Both tools were explicitly pre-allowed, and in print mode without a TTY no permission dialog can appear at all.

Note on measuring this: the prompt has to force sequential calls. If the model emits both tool calls in one block, they are processed serially, so the Bash entry inherits the PowerShell wait and shows up as roughly 156 s even though the command itself ran 3 s after the PowerShell one.

marcoraepple-sys · 1 month ago

Two additions since the previous comment, one of which narrows down where the wait actually sits.

A blocking hook is rejected long before the wait. A PreToolUse hook returning permissionDecision: deny for the PowerShell tool rejects the call after 1.59 s, measured from the session transcript in a fresh session. Hook evaluation therefore completes well before the delay, which places the wait after hook evaluation and before the command is started. Combined with the earlier exclusions (dialog, pre-allowance, host IPC, entry point, PowerShell startup cost, model and network), that leaves a fixed timeout in the tool's own Windows path.

As a side effect this makes the bug avoidable in practice: blocking the tool costs 1.6 s instead of 154 s per accidental call, and the block message can point at the Bash workaround.

Note on reproducing the comparison. The prompt has to force sequential tool calls. If the model emits the PowerShell and Bash calls in one block, they are processed serially, so the Bash entry inherits the PowerShell wait and shows up as roughly 156 s in the transcript, even though the command itself ran about 3 s after the PowerShell one. Measured on 2026-09-15: PowerShell 153.6 s and Bash 156.0 s with an identical start timestamp, while the output timestamps were 3 s apart. A prompt of the form "run X with the PowerShell tool, wait for its result, then run Y with the Bash tool" avoids this.

Durations across three consecutive runs of the reproduction: 154.0 s, 153.8 s, 153.6 s. Spread 0.4 s.

marcoraepple-sys · 29 days ago

Correction: root cause is the antivirus (Avira Free), not Claude Code.

After filing this I ran an A-B-A test today (CLI 2.1.270, claude -p --permission-mode auto --allowedTools "PowerShell,Bash" --output-format stream-json, prompt: run Get-Date with the PowerShell tool, then date with Bash). Only Avira's real-time protection was toggled between runs; every event was timestamped on the client side.

| Run | Avira real-time | PowerShell tool wait | Bash tool |
|---|---|---|---|
| 1 | on | 151.3 s | 1.2 s |
| 2 | off | 1.3 s | 0.8 s |
| 3 | on again | 150.5 s | 0.9 s |
| 4 | Avira uninstalled, Windows Defender real-time on | 2.1 s | 2.9 s |

Run 3 repeats the exact command of run 2 and is slow again, so this is not a cache or repetition effect. Run 4 was done after uninstalling Avira and rebooting, with Defender real-time protection, tamper protection and cloud protection all on. All four runs were separate sessions with real, distinct Get-Date output.

So the ~150 s (permissionDecisionMs=150717 in #57960 matches this) is Avira holding the powershell.exe -EncodedCommand launch spawned by the Claude process. The same powershell.exe started from the Bash tool is not delayed. Windows Defender does not show this behaviour (run 4), so this is specific to Avira, or at least not a generic Windows AV problem.

Three things Claude Code could still do:

  1. Spawn PowerShell with -Command (plain text) instead of -EncodedCommand. Kilo Code made exactly this change in June (Kilo-Org/kilocode#11526) because "Windows endpoint security tools commonly treat powershell.exe -EncodedCommand as obfuscated command execution"; #62348 asked for the same here and was closed as not planned.
  2. Log a warning when the PowerShell parser or tool spawn exceeds a few seconds. Today the wait is completely silent, which is why #57960, #55681 and #69647 all show the same ~150 s signature and none of them ever looked at the antivirus.
  3. Mention AV/EDR interference in the Windows section of the docs.

Otherwise this issue can be closed as environmental. Sorry for the noise.