[BUG] Bash tool hangs ~3 minutes on `docker compose up/down` on Linux

Resolved 💬 3 comments Opened Mar 21, 2026 by cuitaocrazy Closed May 4, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

docker compose up -d and docker compose down commands take ~3 minutes to return in the Bash tool, even though the actual command completes in ~10 seconds (verified with time). Other commands (echo, git, ls, docker compose ps) return instantly.

Reproduction

  1. Have any docker-compose.yml with services
  2. Run docker compose up -d via Bash tool — hangs ~3 min
  3. Run docker compose down via Bash tool — hangs ~3 min
  4. Run echo hello — instant

Workarounds attempted (all failed)

  • < /dev/null
  • --ansi=never --progress=plain
  • setsid docker compose up -d &>/tmp/dc.log; cat /tmp/dc.log
  • docker compose up -d 3>&- 2>&1 (closing fd3 explicitly)
  • > /dev/null 2>&1

Suspected root cause

On Linux, docker compose spawns host-level processes (containerd-shim etc.) that inherit the Bash tool session's file descriptors. These processes outlive docker compose itself, keeping the pipe/socket open. Claude Code waits for EOF on the output fd, which never comes until timeout.

Mac is unaffected because Docker Desktop runs containers in a VM — no fd inheritance on the host.

Environment

  • Claude Code: v2.1.81
  • Platform: Linux (x86_64, kernel 6.19)
  • Docker Compose: v5.0.2
  • Shell: zsh

View original on GitHub ↗

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