Claude Code on Termux
The latest Claude Code, patched to fit, on bionic Android
Two install paths · CLAUDE.md-aligned prompt patches · byte-preserving binary patcher
Claude Code v2.1.123+ stopped shipping a portable cli.js and
switched to a bun-compiled glibc binary that hardcodes the
/lib/ld-linux-aarch64.so.1 interpreter — absent on Android's
bionic libc. This repo keeps both the stable bundle and the
latest binary running, and aligns the system prompt with your global
CLAUDE.md conventions.
# Two install paths
cli.js bundle
2.1.112- Runs
- Direct — a Node-compatible JS bundle (~14 MB).
- Patching
- sed-patchable: 5 idempotent patches applied after install.
- Select
CCINSTALL_VERSION=2.1.112 (default)
bun-compiled binary
2.1.158- Runs
- Userland-exec via bun-on-termux (no grun, no patchelf).
- Patching
- Byte-preserving: same-length blanking survives bun-vfs offsets.
- Select
CCINSTALL_VERSION=next
# What the patcher does
Each prompt patch is opt-out via an env var (CCPATCH_KEEP_*). A backup is kept on first run.
Socket path
Hardcoded /tmp/claude-mcp-browser-bridge- → CLAUDE_CODE_TMPDIR
Termux /tmp is not writable; redirect into $PREFIX/tmp.
Commit directive
Strip “NEVER commit changes unless the user explicitly asks.”
Conflicts with a conventional-commit-per-round workflow.
Comment directive
Strip “Default to writing no comments.”
Conflicts with a typed, explanatory-comment house style.
Length caps
Relax inter-tool 25→60 / final 100→250 words (cli.js path).
Comfort. 2.1.158 already ships the relaxed caps upstream.
# Patching a bun-compiled binary
# bun embeds the JS in a vfs blob keyed by internal byte offsets
length-changing edit ──▶ offsets shift ──▶ binary corrupts
(--version → bun 1.3.x)
length-preserving edit ──▶ offsets intact ──▶ binary still runs
(blank a target string with equal-length spaces) bun-vfs is not checksummed, so a same-length overwrite leaves every downstream offset in place — the patched 2.1.158 binary still reports its own version and runs full inference. That's why the patcher blanks the conflicting prompt lines with spaces instead of deleting them. P5 needs no binary edit: 2.1.158 already ships the relaxed length caps upstream.
# Quick start
# Clone the repo and run the interactive installer
git clone https://github.com/tribixbite/termux-tools ~/git/termux-tools
cd ~/git/termux-tools
# Install Claude Code — latest binary path (Opus 4.8):
CCINSTALL_VERSION=next ./claude-edge-setup.sh
# (omit the env var to install the patched cli.js / Opus 4.7 path)
# Make bare `claude` resolve to 4.8:
ln -sf ~/.local/bin/claude-next ~/.local/bin/claude
claude --version # 2.1.158 (Claude Code)
claude --model claude-opus-4-8
The binary path depends on bun-on-termux
(a userland-exec wrapper for glibc binaries). The installer wires the
claude-next launcher and applies the patches automatically.