The goal: an AI coding agent in your pocket
My post on Running OpenCode in Termux on Android is one of the most-read pages on this blog, and the obvious follow-up question is whether you can do the same with Anthropic’s tool. You can run Claude Code in Termux, but not quite the way you would on a laptop, and it is worth understanding why before you start.
This is the first post in a short series on turning Termux into a proper dev box. The others cover local LLMs with llama.cpp, SSH, Termux:API automation, Neovim and full Ubuntu via proot-distro.
Why the official installer fails on Termux
Claude Code now ships as a native binary. The official docs list Linux on x64 or ARM64 with glibc or musl, and the npm package simply pulls in the matching native binary. Termux is neither: it runs on Android’s Bionic C library. Since v2.1.113 there has been no Android build, and on plain Termux the package installs but claude exits complaining that the native binary is not installed. The upstream GitHub issue (anthropics/claude-code #50270) was still open at the time of writing, so check it for news.
That leaves three realistic options.
Option 1 (recommended): Ubuntu inside proot-distro
proot-distro gives you a real glibc userland, so the standard linux-arm64 binary and the official installer both work, including auto-updates. It costs disk space and some speed, but it is the only route that tracks Anthropic’s supported path.
Install Termux from F-Droid or the project’s GitHub releases. The Google Play listing is still labelled an experimental branch with missing functionality, and Termux plus its plugin apps must all come from the same source because they share a signing key. Mixing sources gives you INSTALL_FAILED_SHARED_USER_INCOMPATIBLE errors.
pkg update && pkg upgrade
pkg install proot-distro
proot-distro install ubuntu
proot-distro login ubuntu
Inside Ubuntu (you are root by default), install the basics and run the official installer:
apt update && apt install -y curl git
curl -fsSL https://claude.ai/install.sh | bash
export PATH="$HOME/.local/bin:$PATH"
claude --version
claude doctor
Add that PATH line to ~/.bashrc inside the container so it sticks. Then cd into a project and run claude. Login prints a URL; open it in your phone’s browser, approve, and paste the code back. You need a Pro, Max, Team, Enterprise or Console account, as on any other platform.
To work on files that also live in Termux, bind your Termux home into the container:
proot-distro login ubuntu --bind $HOME:/root/termux-home
Option 2: pin the last JavaScript release
Versions up to 2.1.112 still ran on Node in Termux, and people in the GitHub thread report that pinning it works. The catch is that you are frozen on an old release: no new features, no security fixes, and newer models may need a newer client. If you accept that:
pkg install nodejs
DISABLE_AUTOUPDATER=1 npm i -g @anthropic-ai/claude-code@2.1.112
Then stop it updating itself into a broken state by adding this to ~/.claude/settings.json:
{
"env": { "DISABLE_AUTOUPDATER": "1" }
}
Option 3: community wrappers
Several community projects patch the official linux-arm64 binary to run through Termux’s glibc-runner, for example ferrumclaudepilgrim/claude-code-android. They are not from Anthropic, they pipe scripts from the internet into your shell, and they can break when upstream changes. Read the script before you run it, and treat this as an experiment rather than a foundation.
What works and what to expect
- Editing, git and shell tools work normally inside Ubuntu. Install whatever your project needs with
apt. - Performance is fine for the agent itself, since the heavy lifting happens on Anthropic’s servers. proot adds overhead to file-heavy commands such as large
npm installruns. - RAM: the docs ask for 4 GB or more. Older phones will struggle, especially with a browser open.
- Background killing: Android 12 and later can kill long-running child processes. Keep Termux in the foreground for long sessions, and take a wake lock from the notification.
- Typing: a Bluetooth keyboard makes this far more pleasant. Failing that, set up the extra-keys row covered in the Neovim in Termux post.
Troubleshooting
claude: command not foundinside Ubuntu:~/.local/binis not on yourPATH.- Bad system call or instant crashes on plain Termux: you are running a native build outside proot. Use option 1 or 2.
- Login loop: copy the URL manually into the browser rather than relying on the tap-to-open link.
If you would rather point the agent at a model you host yourself, see my guide on using Claude Code with local LLM models.
Wrap-up
Running Claude Code in Termux is entirely doable, but until Anthropic publishes an Android build the sensible choice is Ubuntu under proot-distro with the official installer. It updates itself, behaves like the Linux version you already know, and leaves plain Termux for the lighter tools in the rest of this series.
Leave a Reply
You must be logged in to post a comment.