[BUG] Excessive settings.json file I/O (1000x/sec) after tool calls causes performance degradation in WSL
Environment
- Platform (select one):
- [x] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: v1.0.41
- Operating System: Windows 10 with WSL Debian
- Terminal: WSL Debian terminal
Bug Description
Claude Code reads .claude/settings.json (and settings.local.json if present) approximately
1000 times per second for 1-2 seconds after tool execution. The excessive file I/O is
observable in Windows Process Monitor (procmon.exe) and occurs through COM Surrogate
(Dllhost.exe) - this is WSL→Windows filesystem access.
Steps to Reproduce
- Open Claude Code on Windows (project on Windows filesystem accessed via WSL /mnt/c/)
- Configure hooks in .claude/settings.json (PreToolUse and PostToolUse hooks)
- Execute any tool (e.g., Bash, Read, Edit)
- Monitor file access using Windows Process Monitor (procmon.exe)
- Observe Dllhost.exe reading settings files ~1000x/second for 1-2 seconds
Expected Behavior
Settings files should be read once on startup and cached, or at most once per tool execution
if configuration changes need to be detected.
Actual Behavior
- Settings files are read ~1000 times per second after each tool call
- Reading occurs through COM Surrogate (Dllhost.exe)
- Causes 1-2 second delay/freeze after tool execution
- Hooks seem to be causing "offline" status and freezing (worse than before using hooks) -
might be related to this issue we're reporting
Additional Context
- Claude Code v1.0.41
- Project uses PreToolUse hooks (4 bash scripts) and PostToolUse hooks (1 bash script)
- Might be related to GitHub issue #2834 (Unhandled EPIPE Error) though the suggested
workaround (CLAUDE_HTTP_KEEPALIVE=0) didn't help in this case
- File path crosses WSL→Windows boundary: /mnt/c/[project]/.claude/settings.json
- All MCP servers show as working (basic-memory, mcp-sequentialthinking-tools, serena)
This excessive file I/O could explain the performance degradation with hooks enabled, as each
settings file read through the WSL→Windows boundary has overhead.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗