Skip to content

[Bug]: Running Claude Code in a container crashes apps on the host system with "too many open files" #1097

@Artur-

Description

@Artur-

I have done the following

  • I have searched the existing issues
  • If possible, I've reproduced the issue using the 'main' branch of this project

Steps to reproduce

https://github.com/emarc/claude-contained implements a containerized version of Claude Code (and other AI tools). It works by sharing the current folder with Claude Code running in a container.

Run that on any folder with many files (tried with https://github.com/vaadin/flow) and ask Claude to do just about anything related to files (e.g. "What files are there").

Current behavior

It will start consuming file descriptors as it iterates through files. Quite quickly you will have tens or hundreds of thousands of file descriptors in use when the project contains e.g. a node_modules folder. Then you will quite quickly reach the Mac OS file system limit and applications inside or outside the container will start crashing.

Expected behavior

It closes file descriptors after they have been used

Environment

- OS: macOS Tahoe 26.2 (25C56)
- Xcode: 
- Container: container CLI version 0.8.0 (build: release, commit: a18df81)

Relevant log output

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions