π Languages: π¬π§ English Β· πΈπ¦ Ψ§ΩΨΉΨ±Ψ¨ΩΨ© Β· π¨π³ δΈζ
π₯ Run Claude Code natively on Termux β 100% WORKING, 0% PROOT, one command and you're in! π
The missing native installer that lets Claude Code run on Android's Termux β no proot, no chroot, no patchelf, no containers.
- Features
- Quick Install
- Requirements
- Usage
- What Gets Installed
- How It Works
- Troubleshooting
- Uninstall
- FAQ
- Contributing
- License
- Author
- π Native Execution β Runs the official
linux-arm64-muslbinary published by Anthropic. - π‘οΈ No proot, no chroot β No containers, no virtual machines, no emulation.
- π§ No patchelf β Deliberately avoids the SIGSEGV that happens when you patch musl binaries on Android kernels.
- π Working DNS out of the box β Uses a patched musl loader (Musl-on-Termux) that reads
$PREFIX/etc/resolv.confand falls back to deterministic public DNS servers. - β‘ One-command install β Copy, paste, done.
- π Smart updates β
claude-updateskips the 280 MB download if you're already on the latest version. - π Self-healing β
claude-fixrestores the launcher after a manualnpm update. - π§Ή Clean uninstall β
claude-uninstallremoves every artifact. - π« Zero rc-file changes β Never touches
~/.bashrcor~/.zshrc. - π SHA256-verified β The musl runtime is integrity-checked before use.
- π Free forever β GPLv3, community-driven, open source.
Open Termux and paste one line:
curl -fsSL https://raw.githubusercontent.com/Ryovx/Termux-Claude-Code/main/install.sh | bashThat's it. When it finishes, run:
claudeπ‘ Prefer to review the script first? Download it, read it, then run it:
curl -fsSL https://raw.githubusercontent.com/Ryovx/Termux-Claude-Code/main/install.sh -o install.sh less install.sh bash install.sh
| Requirement | Details |
|---|---|
| Termux | From F-Droid or GitHub Releases β NOT the Play Store version |
| Architecture | aarch64 (ARM64) only |
| Free space | ~800 MB (280 MB binary + patched musl runtime + headroom) |
| Internet | Required during install and update |
| Node.js | Auto-installed by the script if missing |
| Root | β Not required |
After installation, the following commands are available immediately:
| Command | Description |
|---|---|
claude |
Run Claude Code (interactive session) |
claude-update |
Update to the latest npm version |
claude-fix |
Restore the launcher if it breaks |
claude-uninstall |
Remove every installed artifact |
Option A β API Key (recommended):
export ANTHROPIC_API_KEY=sk-ant-...
claudeOption B β OAuth:
claude /login| Path | Purpose |
|---|---|
$PREFIX/bin/claude |
The launcher (6 lines of bash) |
$PREFIX/bin/claude-fix |
Restores the launcher from template |
$PREFIX/bin/claude-update |
Updates to the latest npm release |
$PREFIX/bin/claude-uninstall |
Removes everything |
$PREFIX/lib/claude-musl/ |
Patched musl loader + libc + headers |
$PREFIX/lib/claude-musl/launcher.template |
Source of truth for claude-fix |
$PREFIX/lib/node_modules/@anthropic-ai/claude-code-linux-arm64-musl/claude |
The official 280 MB binary |
$PREFIX/etc/resolv.conf |
DNS servers (created if missing) |
Nothing is written outside $PREFIX.
Claude Code ships a linux-arm64-musl ELF binary. Termux runs on Android's Bionic libc, not musl. Direct execution fails with:
cannot execute: required file not found
What doesn't work:
- β
patchelfβ changes the ELF interpreter, but the musl loader still SIGSEGVs on the Android kernel. - β
proot/chrootβ heavy, slow, and breaksclaude's bash tool. - β The npm wrapper
claude-code-termuxβ broken with Claude Code β₯ 2.1.x. - β Stock Alpine musl loader β works for execution, but DNS fails because musl reads
/etc/resolv.conf, which is not readable in Termux.
What does work (this project):
- Download Alpine's musl runtime built by Ryovx/Musl-on-Termux β a patched musl loader that:
- Reads DNS configuration from
$PREFIX/etc/resolv.confwhenMUSL_ON_TERMUX=1is set. - Falls back to
1.1.1.1β8.8.8.8β127.0.0.1when no nameserver is found. - Is SHA256-verified before extraction.
- Reads DNS configuration from
- Download the official
linux-arm64-muslbinary from npm. - Create a 6-line launcher that unsets
LD_PRELOAD, setsMUSL_ON_TERMUX=1, invokes the patched loader with--library-path, and execs the real binary. - Ensure
$PREFIX/etc/resolv.confexists with sensible public DNS servers.
That's it. No patchelf, no proot, no chroot, no DNS failures.
Upstream musl reads /etc/resolv.conf, which is neither readable nor writable inside Termux. Android routes DNS through the netd system service, so musl-based lookups fail with EAI_AGAIN or getaddrinfo failed.
The patched loader from Ryovx/Musl-on-Termux adds:
| Addition | Behavior |
|---|---|
MUSL_ON_TERMUX=1 env var |
Read $PREFIX/etc/resolv.conf first |
| Deterministic DNS fallback | If no nameserver found β 1.1.1.1 β 8.8.8.8 β 127.0.0.1 |
The launcher sets MUSL_ON_TERMUX=1 unconditionally, so DNS works with zero user configuration.
`claude: command not found` after install
hash -r
which claudeIf still missing, run claude-fix.
`claude` broke after `npm update -g`
claude-fixOr use the built-in updater:
claude-update`Error relocating ... libtermux-exec-ld-preload.so`
The launcher handles this via env -u LD_PRELOAD. If you see this, someone bypassed the launcher and ran the binary directly. Use claude, not the raw binary path.
`EAI_AGAIN`, `getaddrinfo failed`, or DNS timeouts
Check that $PREFIX/etc/resolv.conf exists:
cat "$PREFIX/etc/resolv.conf"It should contain at least one nameserver line. If missing, recreate it:
mkdir -p "$PREFIX/etc"
printf 'nameserver 1.1.1.1\nnameserver 8.8.8.8\n' > "$PREFIX/etc/resolv.conf"Then retry claude.
`Segmentation fault` (SIGSEGV)
You're likely running a patchelf-modified binary from an older install. Force a clean reinstall:
bash install.sh --force`SHA256 mismatch` during install
The downloaded musl runtime archive was corrupted or tampered with. Retry β if it persists, open an issue.
bash install.sh --forceOne command:
claude-uninstallOr, if you still have install.sh locally:
bash install.sh --uninstall
claude-uninstallincludes a safety guard that refuses to run outside a Termux$PREFIX.
Does this work on x86_64 or armv7?
No. Only aarch64 (ARM64).
Does this modify my shell configuration?
No. All commands are real executables in $PREFIX/bin, not shell functions.
Does this require root?
No.
Will this work with the Play Store version of Termux?
No. Use F-Droid or GitHub Releases.
How do I update Claude Code?
claude-updateWhy use a patched musl instead of Alpine's stock loader?
Stock Alpine musl reads /etc/resolv.conf, which is inaccessible in Termux. The patched loader from Ryovx/Musl-on-Termux redirects DNS reads to $PREFIX/etc/resolv.conf and provides a deterministic fallback when no nameserver is configured. Without it, network requests from Claude Code fail with DNS errors.
Is the musl runtime verified?
Yes. The installer downloads a signed release archive from Ryovx/Musl-on-Termux and verifies it against a pinned SHA256 before extraction. Installation aborts on any mismatch.
What if I already have a custom `resolv.conf`?
The installer only writes $PREFIX/etc/resolv.conf if it does not exist or is empty. Your existing configuration is preserved.
Why not just use `proot-distro`?
It's slow, it breaks claude's bash tool, and it requires keeping an entire rootfs around. This installer avoids all of that.
See CONTRIBUTING.md for full guidelines.
- π Report bugs β Open an issue
- π‘ Suggest features β Start a discussion
- π§ Submit pull requests β Fork, branch, commit, PR
- π Add translations β Create
README.<lang>.mdand link it at the top
This project is licensed under the GNU General Public License v3.0 or later (SPDX: GPL-3.0-or-later). See LICENSE for the full text.
Ryovx is a proud member of the Open Invention Network (OIN) β a global consortium that protects open-source software from patent aggression.
In line with OIN's mission and our commitment to the Termux community, most of Ryovx's service products are released under GNU GPLv3.
The patched musl runtime bundled by this installer is distributed under the MIT License by Ryovx/Musl-on-Termux. The musl sources it is based on are released under the MIT License by the musl project.
Just as we provide this tool completely free of charge, we kindly ask that you do the same: please keep it free.
This is a friendly request, not a legal prohibition.
Under the GNU GPLv3, you are fully entitled to use, study, modify, redistribute, and even sell this software β provided you comply with the license terms.
You may do whatever the license permits. We simply hope you'll choose to honor the spirit in which it was shared.
- β Star the repository
- π Report bugs and issues
- π‘ Suggest new features
- π§ Submit pull requests
- π£ Share it with the Termux community
- π¬ Help others in the discussions
If you see this software being sold against this request, please open an issue β not because it violates the license, but because it violates the spirit of the project.