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:
pkg update && pkg upgradepkg install nodejs git opensshStep 3: Grant Storage Permission
termux-setup-storageTap “Allow” when prompted. This lets Termux access your files.
Step 4: Install Claude Code
npm install -g @anthropic-ai/claude-codeStep 5: Authenticate
claude initFollow the prompts to authenticate with your Anthropic account.
Step 6: Start Using
claudeAndroid Optimization Tips
After getting Claude Code running, I added some optimizations for better mobile usage.
Better Terminal with Zsh
pkg install zshsh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"Extra Keys for Coding
I configured extra keys for easier typing:
mkdir ~/.termuxecho 'extra-keys = [[ ["ESC","/","-","HOME","UP","END","PGUP"], ["TAB","CTRL","ALT","LEFT","DOWN","RIGHT","PGDN"]]]' > ~/.termux/termux.properties
termux-reload-settingsCreate Aliases
echo 'alias c="claude"' >> ~/.zshrcecho 'alias cp="claude -p"' >> ~/.zshrcecho 'alias cc="claude --continue"' >> ~/.zshrcsource ~/.zshrcNow 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):
npm install -g @anthropic-ai/claude-codeStep 2: Enable SSH
sudo systemctl enable sshsudo systemctl start sshStep 3: Connect from iOS
Use Termius or the built-in Terminal app on iOS:
ssh user@your-server-ipStep 4: Use Tmux for Persistent Sessions
This is important - if your SSH connection drops, you don’t want to lose your Claude Code session:
# Start a new sessiontmux new -s claudeclaude
# Detach: Ctrl+B, then D# Reattach later:tmux attach -t claudeMobile Usage Tips
Tip 1: Use Short Commands
On mobile, typing is harder. Use concise prompts:
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:
# On desktopgit add .git commit -m "WIP: feature X"git push
# On mobilegit pullclaude "continue working on feature X"Tip 4: Pre-download MCP Servers
On WiFi, pre-install large MCP servers to avoid mobile data usage:
npm install -g @anthropic-ai/server-filesystemnpm install -g @anthropic-ai/server-githubPlatform 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:
- 👨💻 Termux App (F-Droid)
- 👨💻 Claude Code Documentation
- 👨💻 iSH App
Oh, and if you found these resources useful, don’t forget to support me by starring the repo on GitHub!
Comments