Reemplaza el updater previo por una versión endurecida que: - Preflight duro: valida $PREFIX, arch aarch64, npm disponible, registry accesible, y avisa si settings.json carece de DISABLE_AUTOUPDATER=1. - Verificación real de compatibilidad Termux vía npm pack --dry-run, distinguiendo cli.js (Node.js puro, ok) de cli-wrapper.cjs (binario nativo SEA, rechazado). - Backup automático previo a cualquier cambio en ~/.cache/claude-updates/, con retención de los 3 últimos. - Nuevo flag --rollback que restaura el backup más reciente. - Nuevos flags --dry-run, --check, --version X.Y.Z y --force para operación segura y previsible. - Smoke test post-install (claude --version debe coincidir con target). - Log histórico en ~/.cache/claude-updates/history.log. - Documenta en --help la vía glibc-runner (github.com/ferrumclaudepilgrim/claude-code-android) como camino arriesgado para superar el techo v2.1.112. Cambios menores: shebang absoluto a $PREFIX/bin/bash (más robusto en Termux cuando LD_PRELOAD queda unset), constantes readonly, mensajes en español. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| bin | ||
| config | ||
| docs | ||
| .gitignore | ||
| README.md | ||
| install.sh | ||
README.md
Claude Code for Termux
Run Claude Code CLI on Android via Termux.
Why
Claude Code v2.1.113+ switched to native binaries, breaking Termux/Android compatibility. This repo provides:
- v2.1.112 (last pure Node.js release) with auto-update protection
- termux-chroot wrapper that fixes the
/tmppermission issue - Safe updater that respects the version ceiling
For SSH/mDNS/Tailscale hostname resolution on Termux (used to reach dev machines from the phone) see the companion repo: mdns-termux.
Requirements
- Termux (F-Droid recommended)
- Android 10+ (ARM64)
- ~500MB free storage
- An Anthropic API key or Claude subscription
Quick Install
git clone <your-git-host>/<your-user>/claude-code-termux.git
cd claude-code-termux
bash install.sh
Or dry-run first:
bash install.sh --dry-run
What Gets Installed
| Component | Location | Purpose |
|---|---|---|
| Claude Code v2.1.112 | npm global | The CLI itself |
clauded |
~/.local/bin/ |
Wrapper with termux-chroot for /tmp |
claude-check-env |
~/.local/bin/ |
Environment validator |
claude-update |
~/.local/bin/ |
Safe updater (ceiling-aware) |
settings.json |
~/.claude/ |
Disables auto-updater |
Usage
# Start Claude Code (always use this, not `claude` directly)
clauded
# Check environment
claude-check-env
# Update (safe, respects version ceiling)
claude-update
SSH with dynamic host resolution
Moved out to a dedicated project so it can be reused without Claude Code:
mdns-termux
— mDNS + Tailscale resolver, resolve CLI, SSH ProxyCommand.
Version Ceiling
v2.1.112 is the last compatible version. Starting v2.1.113, Claude Code ships native binaries requiring glibc/musl linkers that don't exist on Android (Bionic libc).
claude-update enforces this automatically. See docs/TROUBLESHOOTING.md for details.
Docs
Step-by-step guides for each piece of the stack:
| # | Doc | Covers |
|---|---|---|
| 01 | docs/01-termux-fresh-install.md | Clean Termux install (F-Droid / GitHub Releases, not Play) |
| 02 | docs/02-base-packages.md | Required pkg / pip / npm packages |
| 03 | docs/03-samba.md | Samba server on port 4450 + msg.lock gotcha |
| 04 | docs/04-claude-code.md | Claude Code internals (version ceiling, clauded, settings) |
| — | docs/TROUBLESHOOTING.md | Common errors and fixes |
| — | mdns-termux | Companion repo: SSH .local / Tailscale hostname resolution |
Troubleshooting
See docs/TROUBLESHOOTING.md for:
/tmppermission errors- Native binary errors
- Auto-updater issues
- SSH resolution problems
License
MIT