[BUG] EISDIR - "illegal operation on a directory, read"

Resolved 💬 3 comments Opened Jan 13, 2026 by hernaneche Closed Mar 1, 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?

Issue: Claude Code tried to readFileSync() on a directory, causing an EISDIR error.

Likely trigger: Around that time, I was doing file operations involving:

  • tests/features/modules/ directory
  • Multiple file reads/writes for test files

Impact: The error was caught but may have corrupted internal state, leading to UI freeze.

For GitHub issue:

### Bug: EISDIR error causes UI freeze

Version: 2.1.6
OS: macOS Darwin 24.6.0

What happened:
Claude Code became completely unresponsive (couldn't type, had to force quit)

What Should Happen?

Error should be handled gracefully without freezing UI

Error Messages/Logs

2026-01-13T11:28:40.237Z [ERROR] Error: Error: EISDIR: illegal operation on a directory, read
      at readFileSync (unknown)
      at <anonymous> (/$bunfs/root/claude:12:535)
      at g2 (/$bunfs/root/claude:11:34566)
      at readFileSync (/$bunfs/root/claude:12:494)
      at zy_ (/$bunfs/root/claude:4670:23316)

  [ERROR] Error: Error: EISDIR: illegal operation on a directory, read
      at readFileSync (unknown)
      at zy_ (/$bunfs/root/claude:4670:23316)

Steps to Reproduce

  • Long session with many tool calls
  • Creating files in subdirectories (tests/features/modules/)
  • Heavy file editing operations

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.6 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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