[BUG] `claude install` segfaults on AMD64 Debian Bookworm, installation fails silently

Resolved 💬 6 comments Opened Nov 20, 2025 by smartin-qb Closed Jan 24, 2026

[BUG] claude install segfaults on AMD64 Debian Bookworm, installation fails silently

Summary

The claude install command crashes with a segmentation fault on linux/amd64 when running in Debian Bookworm containers, but the installation script still reports success. This results in an empty /root/.local/bin directory and no working claude binary, despite the "✅ Installation complete!" message.

The issue is AMD64-specific - ARM64 installations work correctly.

Environment

  • Platform: linux/amd64 (Docker with --platform linux/amd64)
  • OS: Debian Bookworm (debian:bookworm-slim)
  • Claude Version: 2.0.47
  • Installation Method: curl -fsSL https://claude.ai/install.sh | bash

Reproduction Steps

AMD64 (Fails)

docker run --platform linux/amd64 -it --rm debian:bookworm-slim bash
apt update && apt install -y curl
curl -fsSL https://claude.ai/install.sh | bash
# Shows "✅ Installation complete!" but...
ls /root/.local/bin/
# Empty directory!

ARM64 (Works)

docker run --platform linux/arm64 -it --rm debian:bookworm-slim bash
apt update && apt install -y curl
curl -fsSL https://claude.ai/install.sh | bash
# Shows "✅ Installation complete!" and...
ls -la /root/.local/bin/
# lrwxrwxrwx 1 root root 41 Nov 20 21:00 claude -> /root/.local/share/claude/versions/2.0.47
/root/.local/bin/claude --version
# 2.0.47 (Claude Code)
# ✅ Works correctly!

Root Cause Analysis

Through detailed investigation, we found:

  1. The install script downloads the binary successfully and stores it at ~/.claude/downloads/claude-2.0.47-linux-x64
  1. The binary itself executes fine:

``bash
~/.claude/downloads/claude-2.0.47-linux-x64 --version
# 2.0.47 (Claude Code)
``

  1. The install subcommand segfaults:

``bash
~/.claude/downloads/claude-2.0.47-linux-x64 install
# [?2026h[?2026l[?2026h[?2026lSegmentation fault
# Exit code: 0 (incorrectly!)
``

  1. Partial installation occurs before crash:
  • Creates /root/.local/bin/ directory (empty)
  • Creates /root/.local/share/claude/versions/2.0.47 file (0 bytes!)
  • Never creates the symlink /root/.local/bin/claude
  1. The bootstrap script doesn't detect the failure because it doesn't check the exit code of the install command:

``bash
"$binary_path" install ${TARGET:+"$TARGET"}
# No exit code check here!
rm -f "$binary_path"
echo "✅ Installation complete!"
``

Diagnostic Output

<details>
<summary>Full diagnostic session on AMD64</summary>

$ docker run --platform linux/amd64 --rm debian:bookworm-slim bash -c "
apt update -qq 2>/dev/null && apt install -y curl -qq 2>/dev/null &&
curl -fsSL https://claude.ai/install.sh | sed 's|rm -f \"\$binary_path\"|:|' > /tmp/install_modified.sh &&
bash /tmp/install_modified.sh >/dev/null 2>&1
echo '=== Running install command ==='
~/.claude/downloads/claude-* install 2>&1
echo \"Exit code: \$?\"
echo '=== Checking bin directory ==='
ls -la ~/.local/bin/ 2>&1
echo '=== Checking versions directory ==='
ls -lh ~/.local/share/claude/versions/ 2>&1
"

=== Running install command ===
[?2026h[?2026l[?2026h[?2026lExit code: 0
=== Checking bin directory ===
total 8
drwx------ 2 root root 4096 Nov 20 20:56 .
drwx------ 5 root root 4096 Nov 20 20:56 ..
=== Checking versions directory ===
total 8
drwx------ 2 root root 4096 Nov 20 20:56 .
drwx------ 3 root root 4096 Nov 20 20:56 ..
-rw------- 1 root root    0 Nov 20 20:56 2.0.47

Note the 0-byte file at 2.0.47 - the install command crashed while copying the binary.

When running without output redirection, the segfault is visible:

bash: line 9:  3016 Segmentation fault      ~/.claude/downloads/claude-* install > /dev/null 2>&1

</details>

Impact

This affects anyone using Dockerfile-based builds on AMD64 architecture:

  • CI/CD pipelines building AMD64 containers
  • Docker builds on AMD64 Linux hosts
  • Multi-architecture builds (ARM64 succeeds, AMD64 fails silently)

Since the installation reports success but fails silently, builds continue and produce broken containers without Claude Code, making debugging difficult.

Workaround

Until fixed, manually install by bypassing the broken install subcommand:

# Download and manually install (bypassing broken install command)
RUN curl -fsSL https://claude.ai/install.sh | sed 's|rm -f "\$binary_path"|:|' | bash && \
    mkdir -p /root/.local/bin /root/.local/share/claude/versions && \
    cp /root/.claude/downloads/claude-* /root/.local/share/claude/versions/2.0.47 && \
    chmod +x /root/.local/share/claude/versions/2.0.47 && \
    ln -s /root/.local/share/claude/versions/2.0.47 /root/.local/bin/claude && \
    /root/.local/bin/claude --version

Note: This workaround is version-specific (hardcoded to 2.0.47). A better solution would extract the version dynamically or wait for a fix.

Suggested Fixes

  1. Short-term: Fix the segfault in the install subcommand on AMD64
  2. Medium-term: Add exit code checking in bootstrap.sh:

``bash
"$binary_path" install ${TARGET:+"$TARGET"} || {
echo "Installation failed" >&2
exit 1
}
``

  1. Long-term: Add validation that the binary was actually installed:

``bash
if [ ! -x "$HOME/.local/bin/claude" ]; then
echo "Installation verification failed" >&2
exit 1
fi
``

Additional Context

This investigation was performed by Claude Code (AI agent) analyzing the installation failure in a Docker environment. All test cases and diagnostics shown above were executed in fresh Debian Bookworm containers to ensure reproducibility.

View original on GitHub ↗

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