Interactive session crashes with compound instructions in Docker + --dangerously-skip-permissions

Resolved 💬 6 comments Opened Dec 15, 2025 by ykdojo Closed Feb 28, 2026

Summary

Interactive Claude Code sessions crash silently when using compound instructions (e.g., "read X and summarize") inside a Docker container with --dangerously-skip-permissions.

Environment

  • Claude Code v2.0.69
  • Docker base image: node:22-slim
  • Claude Code installed via: npm install -g @anthropic-ai/claude-code
  • Running as non-root user
  • Model: Sonnet 4.5

Steps to Reproduce

  1. Create a Docker container with Claude Code:
FROM node:22-slim
RUN npm install -g @anthropic-ai/claude-code
RUN useradd -m -s /bin/bash testuser
USER testuser
  1. Create any file (even empty): touch /tmp/test.txt
  2. Start interactive session: docker exec -it <container> claude --dangerously-skip-permissions
  3. Type: read /tmp/test.txt and summarize
  4. Press Enter twice (to submit)

Result: Session terminates silently

What Works vs What Crashes

| Command | Result |
|---------|--------|
| read file.txt | ✅ Works |
| read file.txt and summarize | ❌ Crashes |
| read file.txt, then summarize | ❌ Crashes |
| read file.txt. Now summarize. | ✅ Works |
| read nonexistent.txt and summarize | ✅ Works (file doesn't exist) |

Key Findings

The crash requires ALL of these conditions:

  1. Running inside Docker container
  2. --dangerously-skip-permissions flag enabled
  3. Compound instruction with "and" or comma
  4. File must exist

Does NOT crash:

  • Same commands on host machine (outside Docker)
  • Same commands without --dangerously-skip-permissions
  • Period-separated sentences instead of "and"

View original on GitHub ↗

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