[BUG] .NET MSBuild commands (dotnet build/restore/clean) timeout after 2 minutes despite successful completion
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <\!-- specify -->
- Claude CLI version: 1.0.58 (Claude Code)
- Operating System: macOS Darwin 24.5.0
- Terminal: Terminal App
Bug Description
.NET MSBuild commands consistently timeout after 2 minutes even though they complete successfully. This appears to be a more specific variant of issue #3505, affecting only certain commands that spawn multiple processes.
Steps to Reproduce
- Navigate to any .NET project directory
- Run
dotnet buildusing the Bash tool - Observe that the build completes successfully (e.g., in 1.67 seconds)
- Wait and observe the "Command timed out after 2m 0.0s" error
Expected Behavior
Commands should return immediately after successful completion without any timeout error.
Actual Behavior
MSBuild commands complete successfully but the Bash tool waits for 2 minutes before timing out:
Command timed out after 2m 0.0s
Determining projects to restore...
All projects are up-to-date for restore.
[... successful build output ...]
Build succeeded.
0 Warning(s)
0 Error(s)
Time Elapsed 00:00:01.67
Additional Context
This issue is related to #3505 but is more specific. Through systematic testing, I found:
Commands that timeout:
dotnet build(completes in ~2s, times out after 2m)dotnet restore(completes successfully, times out after 2m)dotnet clean(completes in ~3s, times out after 2m)
Commands that work normally:
dotnet --versiondotnet --list-sdks- All other simple commands (
echo,pwd,ls, etc.) - Other build tools (
npm,make, etc.)
This suggests the issue is specific to commands that:
- Spawn multiple child processes (MSBuild)
- May leave file handles or streams open after the main process exits
- Use the .NET MSBuild engine
The issue makes .NET development workflows frustrating as every build operation requires waiting for a 2-minute timeout.
---
This issue was discovered and reported through Claude Code's systematic testing of various command types.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗