Skip to content

// guides

Claude Code on Android: Termux + Cosyra Setup

You can run Claude Code on Android today. The fastest path is Cosyra on Google Play — install the app on any Pixel, Galaxy, OnePlus, or foldable running Android 9+, paste an Anthropic API key into the Ubuntu container, type claude, and the agent is up. Sign up gets you 1 hour free, no credit card. The two other real options are Termux with an npm install workaround (works, needs care on Android 12+) and SSH from Termux + tmux into your own always-on machine.

This guide is the Android-specific companion to our Claude Code on your phone walkthrough (which covers both iPhone and Android generically) and the Claude Code on iPad guide. What changes on Android is that Termux is a real local option — unlike on iOS — but it comes with a glibc-vs-Bionic libc story and the Android 12+ phantom-process killer, both of which we explain below. For the broader context across all four mobile AI agents see AI coding agents on mobile. And if you're choosing between Claude Code and OpenAI's Codex CLI from an Android phone, our Claude Code vs Codex CLI on phone head-to-head walks through the permission-prompt, sandbox, and pricing trade-offs.

Why is Android different from iPhone for Claude Code?

Android is different from iPhone for Claude Code because Android lets you run a real terminal emulator on-device. Termux ships a Linux package manager, Node.js, Python, Git, and tmux, all running against an ARM64 userland on top of the Android kernel. iOS does not allow any of that; iSH emulates x86 Alpine in userspace and a-Shell ships curated WebAssembly binaries, but neither is a real coding environment for Node-based CLIs like Claude Code. On Android, you genuinely have a local option — it just comes with two specific caveats: the ABI mismatch with Anthropic's native binary, and the OS-level phantom-process killer that ships with Android 12 and later.

We have an opinion that the desktop-first crowd would not share: Android, not iPhone, is the most underrated agent-driven coding device in 2026. The reason is exactly the thing iPhone refuses to do — let user-space software install a package manager and run a real Linux shell. On a Pixel 9 Pro Fold on the kitchen counter, the inner display gives you two side-by-side Cosyra panes (one running Claude Code, one with the diff) and a Bluetooth keyboard turns it into a near-laptop. The phone keyboard is fine for the natural-language part of agent work because you are writing one sentence at a time, not 40-line functions.

What are the three real ways to run Claude Code on Android in 2026?

There are three real ways to run Claude Code on Android as of 2026-05-19: Cosyra (cloud terminal with Claude Code pre-installed, native Android app), Termux (on-device with an npm install workaround), or SSH from Termux + Tailscale into your own always-on machine. We walk through each below with the honest trade-offs.

1. Cosyra (cloud terminal, native Android app)

This is what we build. The Cosyra Android app gives you a persistent Ubuntu 24.04 x86_64 container reached from any Pixel, Galaxy, OnePlus, or foldable. Claude Code, Codex CLI, OpenCode, and Gemini CLI are pre-installed. You get 30 GB of persistent storage, session hibernation that resumes exactly where you left off, and the same container is also reachable from iPhone, iPad, and a browser. No npm workaround, no phantom-killer to wrestle with, no Bluetooth-keyboard requirement.

2. Termux (on-device Linux, npm install)

Termux is an Android terminal emulator with a real Linux package manager. It is open-source (GPLv3) and available on F-Droid (requires Android 7+), the Google Play Store (requires Android 11+, separate version scheme since the return in June 2024), and direct GitHub releases. You install Node.js with the bundled package manager and then install Claude Code from npm.

3. SSH from Termux + tmux into your own machine

The remote-into-your-desktop path, popular on r/termux. Install Tailscale on a Mac or Linux box at home, install Tailscale on Android, install OpenSSH inside Termux (pkg install openssh), then ssh user@machine and tmux attach on the host. Claude Code runs on the host, Termux is just the terminal.

How do you set up Claude Code on Android with Cosyra?

You set up Claude Code on Android in about two minutes: install Cosyra from Google Play, sign in, paste an Anthropic API key into the Ubuntu container, and type claude. No npm install, no package manager, no phantom-killer worry. The steps below are exactly what we run on a fresh Pixel 9.

Step 1: Install Cosyra from Google Play

Open the Google Play Store on your Android phone and search for Cosyra. The Android app runs on Pixel (Pixel 6 and later tested by us), Samsung Galaxy S and Z (foldable inner display layouts work), OnePlus, Nothing, and any device running Android 9 or later. Sign in with Google, Apple, or email and the app provisions a fresh Ubuntu container on first launch. First launch takes about 15 seconds in our testing on a Pixel 8 Pro.

Step 2: Pair a Bluetooth keyboard (optional)

Open Android Settings → Connected devices → Pair new device, and pair any Bluetooth keyboard. We use a small folding Bluetooth keyboard on trains and a Logitech MX Keys when working from a chair at home. Gboard handles short agent prompts fine — you are writing one English sentence at a time, not function bodies. The keyboard helps when you switch into git workflows, where typing branch names is faster than swipe-typing them.

On a Galaxy Z Fold or Pixel Fold, the inner display is large enough to run Cosyra and a browser side-by-side via Android's split-screen view. On Samsung DeX (Galaxy S20 and later, plugged into a monitor or a DeX cable), Cosyra opens as a resizable desktop window with full keyboard and mouse support. We have run a four-hour refactor session in DeX using a Galaxy S24 Ultra plugged into a USB-C monitor.

Step 3: Add your Anthropic API key and run claude

Get an API key from console.anthropic.com. In the Cosyra terminal on Android:

cosyra on Android, adding the Anthropic API key

$ # Set the key (persists across sessions)

$ echo 'export ANTHROPIC_API_KEY="sk-ant-your-key-here"' >> ~/.bashrc

$ source ~/.bashrc

 

$ claude --version

Claude Code (latest)

Clone a repo and start a session:

cosyra on Android, starting Claude Code

$ git clone https://github.com/your-org/your-project.git

Cloning into 'your-project'...

$ cd your-project

$ claude

Claude Code (latest)

Type your prompt, or type "/" for commands.

 

> Walk the recent commits and flag anything risky.

The agent indexes the repo and starts working. Approve or reject diffs inline. The phone keyboard is fine for the natural-language input (one sentence per turn). When the screen locks, the container keeps running; when you reopen the app, the session is exactly where you left it.

Try it free. 1 hour on signup, no credit card. Extend with a 10-hour, 7-day trial when you want more. Google Play / App Store / Pricing details

How do you install Claude Code in Termux on Android?

You install Claude Code in Termux by installing Node.js with the bundled package manager, installing the @anthropic-ai/claude-code npm package, and adding a shell alias because the npm release no longer ships a global CLI entry point. Below is the exact sequence we ran on a Pixel 8 running Android 14 with Termux from F-Droid.

termux on Android, installing Claude Code via npm

$ pkg update && pkg install nodejs git -y

Setting up nodejs (22.x) ...

$ npm install -g @anthropic-ai/claude-code

added 1 package in 14s

$ echo 'alias claude="node $PREFIX/lib/node_modules/@anthropic-ai/claude-code/dist/cli.js"' >> ~/.bashrc

$ source ~/.bashrc

$ claude --version

Claude Code (latest)

Two things to know going in. First, recent versions of the npm package (2.1.113+) print a deprecation warning telling you to switch to the native installer. That installer does not work on Termux because the binary is glibc-linked and Termux uses Bionic libc. Anthropic closed the request for a native Termux build as "not planned" in claude-code Issue #10644, so the npm path is the recommended workflow. You can ignore the deprecation warning; the npm path keeps working. Second, the npm package no longer ships a global claude binary, so the alias above is required. The community claude-code-termux repo tracks this and other Termux-specific Claude Code workarounds.

For the full Termux trade-off discussion — phantom-killer risk, ARM64 limits, where it wins — see Cosyra vs Termux.

How do you fix the Android 12+ phantom process killer?

Android 12 introduced a phantom-process limit of 32 background processes per app, and the OS will SIGKILL any beyond the limit or any using "excessive" CPU. For a Termux user running Claude Code, this shows up as the terminal printing [Process completed (signal 9) - press Enter] mid-session. The Termux maintainers track the issue at termux-app #2366; the issue is closed as "wontfix at OS level," with documented user-side workarounds.

The fix depends on your Android version:

What about Galaxy DeX, foldables, and the S Pen?

Android's hardware variety is the biggest practical reason to write an Android-specific guide. iPhone has one shape. Android has Galaxy Z Fold 7s, Pixel Folds, Galaxy S24 Ultras with S Pens, OnePlus Open foldables, Surface Duo holdouts, and DeX, and each unlocks a different workflow.

Foldables (Galaxy Z Fold, Pixel Fold): the inner display gives you a ~7.6" canvas where Android's split-screen view runs Cosyra on the left and Chrome with the GitHub PR on the right. We do most foldable PR reviews this way. The agent's diff sits on the left, the PR conversation sits on the right, and Bluetooth keyboard typing feels closer to laptop than phone.

Samsung DeX (Galaxy S20 and later, Tab S series): plug a USB-C cable into a monitor (or a Smart Dock) and DeX boots a desktop shell. Cosyra opens as a resizable window with full Bluetooth keyboard and mouse support. The container is the same one you used on the phone five minutes ago. We tested a four-hour Galaxy S24 Ultra session in DeX with a 27" display: indistinguishable from a Linux desktop for agent-driven work.

S Pen on Galaxy Ultra and Tab S: hover-and-tap is faster than touch for selecting text in long diffs. We use it to circle specific lines, paste them into a prompt ("explain this regex"), and let Claude Code reply. On the Galaxy Tab S9 the S Pen plus Bluetooth keyboard combo turns the tablet into the same client we run on the phone, just with more vertical real estate.

Chromebook with Linux container (Crostini): a corner case worth flagging. If you carry a Chromebook with Linux containers enabled, you can install Claude Code inside Crostini directly. But honestly, a Chromebook with internet is a perfect Cosyra client — open cosyra.com in Chrome, sign in, and use the web terminal. We cover both paths in Claude Code on a Chromebook.

How do the Android options compare?

The Android options compare cleanly when you line them up against what actually matters for an agent client: persistent state, OS-level process killing, ABI compatibility, and whether you need another machine in the loop. The table below covers the three real paths as of 2026-05-19.

Feature Cosyra (Android app) Termux (local) SSH + tmux + Tailscale
Native Android app Yes Yes Termux as the client
Persistent Ubuntu container Yes (30 GB, x86_64) Termux home (~/, ARM64) On host machine
Claude Code pre-installed Yes npm install + alias You install on host
Native Anthropic installer works Yes (Ubuntu x86_64) No (Bionic libc) Depends on host OS
Phantom-killer risk None Yes (mitigated) None (host runs it)
Works offline No Yes No
Requires another machine No No Yes (always-on)
Foldable / DeX support Yes (native) Yes (terminal only) Yes (via Termux)
Setup time ~2 min ~10 min 20–40 min
Cost $29.99/mo after trial Free Free + host cost

Choose Cosyra if you want zero local setup, the same container across Android, iPhone, iPad, and web, and no Android-OS quirks to manage. Choose Termux if free and offline matter more than the hour you will spend wrestling with the phantom-killer and the npm path. Choose SSH + tmux if you already run an always-on machine and Tailscale is already in your stack. For more on tmux and TUI ergonomics on a phone, see our TUI apps on phone guide.

Frequently asked questions

Does Claude Code actually work on Android, or do I need an iPhone?

Yes, Claude Code runs on Android via two real paths. A cloud terminal like Cosyra ships Claude Code pre-installed in an Ubuntu container and is reachable from the Android app. Termux on-device installs Claude Code from npm with a small alias workaround. The native Anthropic installer does not work on Termux because of a glibc-vs- Bionic libc mismatch — see the GitHub issue cited below.

How do I install Claude Code in Termux on a Pixel or Galaxy?

In Termux: pkg install nodejs git -y, then npm install -g @anthropic-ai/claude-code, then add an alias because the package no longer ships a global CLI entry. The community claude-code-termux repo tracks the exact alias and updates it when the npm package changes its file layout.

Why does the native Claude Code installer fail on Termux?

Because Anthropic's native claude binary is linked against glibc (it looks for /lib/ld-linux-aarch64.so.1 as its dynamic linker), and Termux uses Android's Bionic libc, which is a different C library with an incompatible ABI. The binary also expects libpthread.so.0 as a separate file, which exists in glibc but lives inside libc.so on Bionic. Anthropic has not published an android-arm64 build and closed the request for one as "not planned" in claude-code Issue #10644.

How do I stop Android 12+ from killing my Claude Code session?

On Android 14 and later, Settings → Developer options → "Disable child process restrictions" → toggle off. On Android 12 and 13, run an ADB command from a laptop to lift the phantom-process limit (the exact command is in the setup section above). On Cosyra, this is a non-issue: the container runs in the cloud and Android cannot kill it.

Is Termux back on the Google Play Store?

Yes. Termux returned to Google Play in June 2024 as a separately versioned build maintained by Fredrik Fornwall under the termux-play-store/termux-apps repository. The Play Store build requires Android 11+ and uses its own version scheme. The F-Droid and GitHub builds still support Android 7+ on the upstream version.

Does the Claude Code Remote path work on Android?

Yes, but with caveats. Claude Code Remote is a community-built WebSocket bridge that needs an active Claude Code session running on a desktop and forwards the terminal to your phone over a Cloudflare Tunnel. It is useful if you already have a desktop session running and want to monitor it; it is not a replacement for a persistent Android-app-driven environment. For that, Cosyra (cloud) or Termux (local) is the answer.

tl;dr

Three real ways to run Claude Code on Android as of 2026-05-19. Cosyra (native Android app, Claude Code pre-installed, persistent Ubuntu container, no phantom-killer, no other machine required). Termux (free, local, on-device — install via pkg install nodejs then npm install -g @anthropic-ai/claude-code with a shell alias; native Anthropic installer does not work because of glibc vs Bionic libc). SSH + tmux into your own machine (works if you already run an always-on box and Tailscale).

Google Play / App Store. Sign up — 1 hour free, no credit card. Extend with a 10-hour, 7-day trial when you want more.

Run Claude Code on your Android phone in 2 minutes. Install Cosyra, paste an Anthropic API key, type claude.

See pricing