Skip to content

How to Use Claude Code on Mobile: Android Termux and iOS SSH Setup

Purpose

I want to use Claude Code on my phone when I’m away from my computer. Is it possible to run an AI coding assistant on mobile?

The short answer: Yes, but the approach differs between Android and iOS.

┌─────────────────────────────────────────────────────────────┐
│ Mobile Claude Code Options │
├─────────────────┬─────────────────┬─────────────────────────┤
│ Method │ Platform │ Recommendation │
├─────────────────┼─────────────────┼─────────────────────────┤
│ Termux (local) │ Android │ ★★★★★ Best experience │
│ iSH App │ iOS │ ★★☆☆☆ Limited │
│ SSH to server │ iOS │ ★★★★☆ Reliable │
└─────────────────┴─────────────────┴─────────────────────────┘

Environment

  • Android phone/tablet with Termux
  • OR iOS device with Termius/terminal app
  • Remote Linux/macOS server (for iOS SSH method)
  • Node.js v18+ required

What Is Termux?

Termux is a terminal emulator for Android that lets you run Linux commands and install packages. It’s the best way to run Claude Code locally on mobile.

Why Termux over other options:

  • Local execution: Claude Code runs directly on your phone
  • Full MCP support: You can install and use MCP servers
  • Offline capable: Works without internet after setup
  • File access: Can access your phone’s storage

Android Setup via Termux

Step 1: Install Termux

Download Termux from F-Droid (recommended) or Google Play. The F-Droid version has better compatibility and more frequent updates.

Step 2: Update and Install Dependencies

Open Termux and run:

Install dependencies
pkg update && pkg upgrade
pkg install nodejs git openssh

Step 3: Grant Storage Permission

Grant storage permission
termux-setup-storage

Tap “Allow” when prompted. This lets Termux access your files.

Step 4: Install Claude Code

Install Claude Code
npm install -g @anthropic-ai/claude-code

Step 5: Authenticate

Authenticate
claude init

Follow the prompts to authenticate with your Anthropic account.

Step 6: Start Using

Start Claude Code
claude

Android Optimization Tips

After getting Claude Code running, I added some optimizations for better mobile usage.

Better Terminal with Zsh

Install zsh and oh-my-zsh
pkg install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Extra Keys for Coding

I configured extra keys for easier typing:

Configure extra keys
mkdir ~/.termux
echo 'extra-keys = [[
["ESC","/","-","HOME","UP","END","PGUP"],
["TAB","CTRL","ALT","LEFT","DOWN","RIGHT","PGDN"]
]]' > ~/.termux/termux.properties
termux-reload-settings

Create Aliases

Create aliases
echo 'alias c="claude"' >> ~/.zshrc
echo 'alias cp="claude -p"' >> ~/.zshrc
echo 'alias cc="claude --continue"' >> ~/.zshrc
source ~/.zshrc

Now I can type c instead of claude, cp "fix bug" for quick tasks, and cc to continue the last session.

iOS Setup via SSH

iOS is more restrictive. The iSH app exists but has limitations. I recommend using SSH to connect to a remote server instead.

Step 1: Set Up a Server with Claude Code

On your server (Linux or macOS):

Server setup
npm install -g @anthropic-ai/claude-code

Step 2: Enable SSH

Enable SSH (Linux)
sudo systemctl enable ssh
sudo systemctl start ssh

Step 3: Connect from iOS

Use Termius or the built-in Terminal app on iOS:

Connect via SSH
ssh user@your-server-ip

Step 4: Use Tmux for Persistent Sessions

This is important - if your SSH connection drops, you don’t want to lose your Claude Code session:

Use tmux for persistence
# Start a new session
tmux new -s claude
claude
# Detach: Ctrl+B, then D
# Reattach later:
tmux attach -t claude

Mobile Usage Tips

Tip 1: Use Short Commands

On mobile, typing is harder. Use concise prompts:

Short commands
claude -p "fix auth bug"
claude -p "add tests for user.js"
claude -p "explain this function"

Tip 2: Use Voice Input

  • Android: Use Gboard voice typing
  • iOS: Use built-in dictation

Dictate your prompt, then paste it into Termux or Terminal.

Tip 3: Sync with Git

For continuity between devices:

Sync with Git
# On desktop
git add .
git commit -m "WIP: feature X"
git push
# On mobile
git pull
claude "continue working on feature X"

Tip 4: Pre-download MCP Servers

On WiFi, pre-install large MCP servers to avoid mobile data usage:

Pre-download MCP servers
npm install -g @anthropic-ai/server-filesystem
npm install -g @anthropic-ai/server-github

Platform Comparison

┌────────────────────────────────────────────────────────────────────┐
│ Mobile Platform Comparison │
├─────────────────┬──────────────┬─────────────┬────────────────────┤
│ Feature │ Termux │ iOS iSH │ iOS SSH │
├─────────────────┼──────────────┼─────────────┼────────────────────┤
│ Local execution │ ✓ Yes │ Limited │ ✗ No │
│ MCP servers │ ✓ Full │ Limited │ ✓ Full (on server) │
│ Storage access │ ✓ Granted │ Limited │ ✓ Remote │
│ Performance │ Good │ Poor │ Excellent │
│ Offline use │ ✓ Yes │ ✓ Yes │ ✗ No │
│ Setup │ Medium │ Easy │ Medium │
│ Recommended │ ★★★★★ │ ★★☆☆☆ │ ★★★★☆ │
└─────────────────┴──────────────┴─────────────┴────────────────────┘

Summary

In this post, I showed how to use Claude Code on mobile devices. Android users get the best experience with Termux for local execution. iOS users should use SSH to connect to a remote server for reliable performance. The key point is choosing the right method for your platform and optimizing with aliases, voice input, and Git sync.

Final Words + More Resources

My intention with this article was to help others share my knowledge and experience. If you want to contact me, you can contact by email: Email me

Here are also the most important links from this article along with some further resources that will help you in this scope:

Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!

Comments