[BUG] v2.1.63 crashes on Alpine Linux (musl): posix_getdents symbol not found

Status Fixed / completed
Reported on v2.1.62
Maintainer reply ✓ Yes — ant-kurt
Activity 13 comments · opened Feb 28, 2026 · closed Apr 3, 2026
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

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?

Claude Code v2.1.63 crashes immediately on Alpine Linux (musl libc) with:
Error relocating /home/claude/.local/bin/claude: posix_getdents: symbol not found
Every command fails, including claude --version.

What Should Happen?

Claude Code should start normally on Alpine Linux, as it did with v2.1.62.

Error Messages/Logs

Error relocating /home/claude/.local/bin/claude: posix_getdents: symbol not found

Steps to Reproduce

  1. Have Claude Code installed on Alpine Linux (musl-based)
  2. Auto-update to v2.1.63
  3. Run any command, e.g. claude --version
  4. Observe the posix_getdents: symbol not found error

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.62

Claude Code Version

2.1.63 (broken) / 2.1.62 (Claude Code) (rollback)

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

Installing gcompat (glibc compatibility shim) does not resolve the issue.
posix_getdents is not provided by gcompat either.

The 2.1.63 binary is ~6MB larger than 2.1.62 (225MB vs 219MB), suggesting a
dependency change. posix_getdents is a glibc-specific symbol absent from musl libc.

Workaround: roll back the symlink:
ln -sf ~/.local/share/claude/versions/2.1.62 ~/.local/bin/claude

View original on GitHub ↗

13 Comments

thecodeassassin · 6 months ago

Yes this is a very big issue for every ExitBox user, we use Alpine to isolate and sandbox Claude and this update completely breaks Claude.

CarstenGrohmann · 6 months ago

Small workaround for Alpine:

  1. Install gcompat package with apk add gcompat
  2. Create posix_getdents_fix.c

```
#define _GNU_SOURCE
#include <dirent.h>
#include <sys/syscall.h>
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>

ssize_t posix_getdents(int fd, void *buf, size_t count) {
return syscall(SYS_getdents64, fd, buf, count);
}
```

  1. Compile

``
gcc -shared -fPIC -O2 -o posix_getdents_fix.so posix_getdents_fix.c
``

  1. Start Claude

```
$ LD_PRELOAD="/lib/libgcompat.so.0:/home/username/posix_getdents_fix.so" /home/username/.local/bin/claude

▐▛███▜▌ Claude Code v2.1.63
▝▜█████▛▘ Sonnet 4.6 · Claude Pro
▘▘ ▝▝
```

tino-q · 5 months ago

Thanks @CarstenGrohmann , fix worked for me

For anyone on Alpine who applied the posix_getdents shim workaround, you can make it permanent by wrapping the claude launcher so you don’t have to set LD_PRELOAD every time.

I kept the installer managed binary and just added a small wrapper in ~/.local/bin.

cp ~/.local/bin/claude ~/.local/bin/claude.orig

cat > ~/.local/bin/claude << 'EOF'
#!/bin/sh
export LD_PRELOAD="/lib/libgcompat.so.0:$HOME/posix_getdents_fix.so${LD_PRELOAD:+:$LD_PRELOAD}"
exec "$HOME/.local/bin/claude.orig" "$@"
EOF

chmod +x ~/.local/bin/claude

This keeps Claude auto updates working because the wrapper still calls the installer managed launcher. Now claude --version works normally without manually setting LD_PRELOAD.

wenerme · 5 months ago
Small workaround for Alpine: 1. Install gcompat package with apk add gcompat 2. Create posix_getdents_fix.c `` #define _GNU_SOURCE #include <dirent.h> #include <sys/syscall.h> #include <unistd.h> #include <errno.h> #include <sys/types.h> ssize_t posix_getdents(int fd, void *buf, size_t count) { return syscall(SYS_getdents64, fd, buf, count); } ` 3. Compile ` gcc -shared -fPIC -O2 -o posix_getdents_fix.so posix_getdents_fix.c ` 4. Start Claude ` $ LD_PRELOAD="/lib/libgcompat.so.0:/home/username/posix_getdents_fix.so" /home/username/.local/bin/claude ▐▛███▜▌ Claude Code v2.1.63 ▝▜█████▛▘ Sonnet 4.6 · Claude Pro ▘▘ ▝▝ ``

Change last step to

LD_PRELOAD="/lib/libgcompat.so.0:$PWD/posix_getdents_fix.so" claude install 2.1.62

CodyJon · 5 months ago

Also running into same issue reported

rajguru7 · 5 months ago

Same issue

wzqwtt · 5 months ago

same issue

Grandnainconnu · 5 months ago

same issue

ant-kurt collaborator · 4 months ago

We have a fix for this in the pipe + additional steps to prevent this going forward. This should be fixed early next week.

For the time being, please use a version prior to 2.1.63

avs-rd · 4 months ago

+1

avs-rd · 4 months ago

It seems solved already

ant-kurt collaborator · 4 months ago

This crash should no longer occur with 2.1.97 - we've added additional testing to prevent this going forward.

github-actions[bot] · 4 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.