[BUG] Excessive settings.json file I/O (1000x/sec) after tool calls causes performance degradation in WSL

Resolved 💬 2 comments Opened Jul 3, 2025 by aboveaboutbelow Closed Jul 17, 2025

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

  1. Open Claude Code on Windows (project on Windows filesystem accessed via WSL /mnt/c/)
  2. Configure hooks in .claude/settings.json (PreToolUse and PostToolUse hooks)
  3. Execute any tool (e.g., Bash, Read, Edit)
  4. Monitor file access using Windows Process Monitor (procmon.exe)
  5. 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.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗