Picture this: you're on a train, drinking coffee in a café, or simply don't have a laptop at hand. Suddenly you get an idea for fixing a bug in your project on GitHub. Or a client reports an urgent problem that has to be fixed now.
Sounds like a situation where you're helpless? Not necessarily. With Claude Code and Android you can program practically from anywhere. In this article I'll show you, step by step, how to set it up.
What Is Claude Code and Why Use It on Mobile?
Claude Code is Anthropic's official CLI client - a tool that combines Claude's powerful artificial intelligence with your development environment. It is not an ordinary chatbot for chatting about code.
What Claude Code can do:
- Reads and edits files in your project
- Runs terminal commands (git, npm, make, etc.)
- Analyses whole repositories and understands the project context
- Commits changes and creates pull requests
- Works with many files at once
- Debugs code and proposes solutions
Most importantly: Claude Code runs in the terminal. And a terminal can be run on Android. So - you can have a full development environment in your pocket.
Scenarios: When Does Mobile Programming Make Sense?
Mobile programming won't replace a comfortable setup with a laptop, two monitors and a mechanical keyboard. But there are situations where it is irreplaceable:
1. Quick Fixes
A typo in the documentation, a simple CSS bugfix, a configuration change - things that take 5 minutes, but waiting until you're back at the office is a waste of time.
2. Code Review on the Go
You can browse pull requests, commit suggestions and test changes - all from your phone on the way to work.
3. Monitoring and Hotfixes
Production is on fire and you happen to be in a shop? You log in from your phone, identify the problem, and Claude Code helps you fix it and deploy a hotfix.
4. Learning and Experiments
Reading an article about a new library? You can test the examples straight away in a test repo, without waiting for access to a computer.
The rule: Mobile programming is a supplement, not a replacement for working at a desk. But as a supplement - it's brilliant.
Architecture: How Does It Work?
Before we move on to configuration, let's understand the architecture of the whole setup:
- A server/VPS in the cloud - this is where Claude Code runs (it needs some computing power)
- Your Android - this is where you have the SSH client (Termux, JuiceSSH, ConnectBot)
- GitHub - this is where you store your code (access through SSH keys)
- An SSH connection - a secure tunnel between Android and the server
Why can't you run Claude Code directly on Android?
Claude Code is a Node.js application that needs a fair amount of RAM and CPU when analysing large projects. Smartphones have limited resources, so it's more efficient to keep Claude Code on a server and connect over SSH.
Note: Advanced users with a rooted Android can try installing Node.js and Claude Code directly in Termux, but stability and performance will be problematic with large projects.
Step 1: Preparing the VPS Server
You need a server in the cloud. It doesn't have to be expensive - the simplest VPS for $5-10 a month is enough.
Recommended Providers
- DigitalOcean: $6/month for a droplet (1GB RAM, 1 vCPU) - enough
- Hetzner: €4/month for a CX11 (2GB RAM, 1 vCPU) - good price-to-power ratio
- Vultr: $6/month for Cloud Compute - globally distributed
- Linode: $5/month for a Nanode - solid reputation
Minimum requirements:
- 1GB RAM (2GB recommended for larger projects)
- 10GB of disk (20GB if you work with many repos)
- Ubuntu 22.04 LTS or Debian 12
Basic Server Configuration
After creating the VPS, we log in and install the required tools:
# System update
sudo apt update && sudo apt upgrade -y
# Install Node.js 20 (required by Claude Code)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
# Install Git
sudo apt install -y git
# Install Claude Code
npm install -g @anthropic-ai/claude-code
# Verify
claude --version
node --version
git --version
Security: Disabling Password Login
SSH with a password is a risk. We use SSH keys (we'll set them up later):
# Edit the SSH configuration
sudo nano /etc/ssh/sshd_config
# Change these lines:
PasswordAuthentication no
PubkeyAuthentication yes
PermitRootLogin no
# Restart SSH
sudo systemctl restart sshd
Note: Do this ONLY after you've set up SSH keys on Android! Otherwise you'll lock yourself out.
Step 2: Installing and Configuring Termux on Android
Termux is a full-fledged Linux terminal emulator for Android. It is the best client for our purposes.
Installing Termux
IMPORTANT: Don't install Termux from Google Play - the version there is outdated and unsupported. Download it from F-Droid:
- Install the F-Droid app (a store for open-source apps): https://f-droid.org
- In F-Droid search for "Termux" and install it
- Optionally install Termux:API (access to phone functions) and Termux:Widget (shortcuts on the home screen)
Basic Termux Configuration
# Update packages
pkg update && pkg upgrade
# Install OpenSSH
pkg install openssh
# Install Git (handy locally)
pkg install git
# Install nano (text editor)
pkg install nano
Generating SSH Keys
SSH keys are your pass to the server - more secure than a password:
# Generate a key pair (private + public)
ssh-keygen -t ed25519 -C "android-termux"
# You will be asked for a passphrase
# Set one! It's an extra layer of security
# The keys are saved in ~/.ssh/
ls ~/.ssh/
# You'll see: id_ed25519 (private key) and id_ed25519.pub (public key)
Copying the Public Key to the Server
We have to tell the server: "this key is trusted, let it in":
# Display the public key
cat ~/.ssh/id_ed25519.pub
# Select and copy the whole output (a long string of characters)
# It will look like:
# ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJx... android-termux
Now you log in to the VPS (once more, with the password - for the last time!) and add the key:
# On the VPS
mkdir -p ~/.ssh
chmod 700 ~/.ssh
nano ~/.ssh/authorized_keys
# Paste the copied public key, save (Ctrl+O, Enter, Ctrl+X)
# Set permissions
chmod 600 ~/.ssh/authorized_keys
Now you can log in without a password:
# From Termux on Android
ssh your-user@server-ip
# You'll be asked for the passphrase (the password for the private key)
# After entering it - you're on the server!
Step 3: Configuring GitHub SSH Keys
Claude Code will commit and push changes. For GitHub to let you in, you need another SSH key - this time on the VPS.
Generating a Key on the Server
# While logged in to the server over SSH from Android
ssh-keygen -t ed25519 -C "vps-claude-code"
# Save in the default location (~/.ssh/id_ed25519)
# Set a passphrase (optional, but recommended)
Adding the Key to GitHub
# Display the public key
cat ~/.ssh/id_ed25519.pub
# Copy the whole output
Now on your phone:
- Open a browser and log in to GitHub
- Go to Settings → SSH and GPG keys
- Click New SSH key
- Paste the copied public key
- Name it e.g. "VPS Claude Code"
- Save
Testing the Connection
# On the server (over SSH from Android)
ssh -T git@github.com
# If it works, you'll see:
# Hi username! You've successfully authenticated...
Step 4: Configuring Claude Code
Now the most interesting part - launching Claude Code.
Initialisation and API Key
Claude Code requires an API key from Anthropic. You can get one at: https://console.anthropic.com
After creating an account and generating a key:
# On the server
export ANTHROPIC_API_KEY="sk-ant-api03-...your-key..."
# So you don't have to type this every time, add it to ~/.bashrc
echo 'export ANTHROPIC_API_KEY="sk-ant-api03-...your-key..."' >> ~/.bashrc
source ~/.bashrc
Cloning a Repository
# Create a directory for projects
mkdir -p ~/projects
cd ~/projects
# Clone your repo (over SSH!)
git clone git@github.com:your-user/your-repo.git
cd your-repo
Launching Claude Code
# In the project directory
claude
# You'll see the Claude Code interface
# You can start asking questions about the project
Example commands to try:
- "Analyse the structure of this project and explain the main components to me"
- "Find all the TODOs in the code and create a list"
- "Add the missing documentation to the functions in src/utils.js"
- "Fix the bug in the login form - email validation doesn't work"
Step 5: Workflow - How to Work Efficiently
You now have the environment set up. Here are practical tips on how to use it.
1. A Persistent Session with tmux
The problem: you disconnect SSH, your Claude Code session dies. The solution: tmux.
# Install tmux on the server
sudo apt install tmux
# Start a new session
tmux new -s claude
# Now you can launch Claude Code
claude
# Detaching from the session (Claude keeps running!):
# Press Ctrl+B, then D
# Returning to the session (e.g. after logging in again):
tmux attach -t claude
Thanks to tmux you can disconnect, come back an hour later, and continue the conversation with Claude in exactly the same place.
2. SSH Shortcuts in Termux
Instead of typing ssh user@long-ip-address every time:
# In Termux on Android
nano ~/.ssh/config
# Add:
Host vps
HostName 123.45.67.89
User your-user
Port 22
IdentityFile ~/.ssh/id_ed25519
# Save, now you log in with:
ssh vps
3. Git Aliases for Quick Commits
Typing on mobile is torture. Shorten the commands:
# On the server
git config --global alias.s "status -s"
git config --global alias.c "commit -m"
git config --global alias.p "push origin main"
git config --global alias.pl "pull origin main"
# Now instead of:
git status -s
git commit -m "fix: typo in readme"
git push origin main
# You type:
git s
git c "fix: typo in readme"
git p
4. Claude Code Scripts
Repetitive tasks? Save them as scripts:
# ~/scripts/code-review.sh
#!/bin/bash
cd ~/projects/my-repo
git pull
claude "Analyse the last 3 commits and write a code review"
5. A Notification Bot (Optional)
If you want to get notifications on your phone about important events (e.g. failed builds), set up a webhook to Telegram or Discord:
# Example Telegram webhook
curl -X POST "https://api.telegram.org/bot<TOKEN>/sendMessage" \
-d chat_id=<CHAT_ID> \
-d text="Build failed on main branch!"
Security: What NOT to Do
Mobile programming opens up new possibilities, but also risks. Here are practical security tips:
1. Never Log In Over Public WiFi Without a VPN
A café, an airport, a hotel - these are traps. Someone may intercept your connection. Always use a VPN:
- WireGuard: Fast, modern, easy to configure
- OpenVPN: A classic, widely supported
- Tailscale: The easiest to set up (mesh VPN)
2. Use a Passphrase for SSH Keys
An SSH key without a passphrase is like a password written in a notebook. Someone gets hold of your phone = they have access to the server.
3. Fail2ban on the Server
Automatically blocking IPs after failed login attempts:
# Install
sudo apt install fail2ban
# Configuration (file /etc/fail2ban/jail.local)
[sshd]
enabled = true
port = ssh
filter = sshd
logpath = /var/log/auth.log
maxretry = 3
bantime = 3600
# Restart
sudo systemctl restart fail2ban
4. Regular Updates
# On the server, once a week:
sudo apt update && sudo apt upgrade -y
5. Back Up Your SSH Keys
Lose your phone = lose access. Back up your keys somewhere safe (a password manager, an encrypted USB stick).
Alternatives to Termux
If Termux doesn't suit you, there are other options:
1. JuiceSSH
Pros:
- Nice interface, easy to use
- Snippets (saved commands)
- Port forwarding GUI
- Google Drive integration (backup)
Cons:
- Not open-source
- The free version has ads
2. ConnectBot
Pros:
- Open-source
- Very lightweight
- Stable (has been around for years)
Cons:
- Outdated UI
- Fewer features than the competition
3. Serverauditor (Termius)
Pros:
- The prettiest interface
- Sync between devices
- Built-in SFTP
Cons:
- Expensive (a paid plan is required for advanced features)
- Closed-source
Recommendation: For advanced users - Termux. For beginners - JuiceSSH.
Limitations and When NOT to Use a Mobile Setup
Let's be honest - mobile programming has limitations:
When It Won't Work:
- Refactoring large files: A small screen = hard to follow changes
- Frontend debugging: No browser DevTools
- Pair programming: Screen sharing from a phone is a pain
- Very large repositories: A $5 VPS may not cope with analysing 100k lines of code
- Visual design: Without a preview of the graphics it's a shot in the dark
When It Makes Sense:
- Small fixes (typo, config, documentation)
- Code review and pull requests
- Backend bugfixes
- Production hotfixes
- Experiments with small projects
Optimisation: How to Speed Up Your Work
1. A Bluetooth Keyboard
This is a game-changer. A foldable Bluetooth keyboard costs ~100 PLN. Typing on a touchscreen is torture, a keyboard is normality.
2. Larger Font Size in Termux
# In Termux, long press → Settings → Appearance
# Font size: increase to 18-20
3. Hacker's Keyboard
The standard Android keyboard has no Ctrl, Esc or Tab. Install Hacker's Keyboard from F-Droid - a full PC layout.
4. Termux Keyboard Shortcuts
Volume Down + Q- Toggle extra keys row (Esc, Tab, Ctrl...)Volume Down + W- Up arrow (scroll back)Volume Down + S- Down arrow (scroll forward)Volume Down + K- Toggle soft keyboard
5. Zsh + Oh My Zsh
A better shell experience with autocompletion:
# On the server
sudo apt install zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Set as the default shell
chsh -s $(which zsh)
Cost: How Much Does It All Cost?
A full breakdown of the costs of a mobile setup with Claude Code:
- Termux: Free (open-source)
- VPS: $5-10/month (DigitalOcean, Hetzner, Vultr)
- Claude API: Pay-as-you-go, ~$0.01-0.05 per conversation (depends on length)
- VPN (optional): $5-10/month (self-hosted WireGuard = free)
- Bluetooth keyboard (optional): ~100 PLN (one-off)
Total: ~$10-15/month + an optional keyboard.
For comparison: GitHub Codespaces is a minimum of $18/month for 60 hours of use. A setup with your own VPS is cheaper and more flexible.
Troubleshooting: The Most Common Problems
Problem: "Permission denied (publickey)"
Solution:
# Check whether the key is loaded
ssh-add -l
# If it isn't, add it:
ssh-add ~/.ssh/id_ed25519
# Check permissions
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub
Problem: Claude Code timeout on large files
Solution:
- Increase the server's RAM (upgrade the VPS)
- Add a
.claudeignorewith excluded directories (node_modules, .git, dist) - Split the task into smaller steps
Problem: Termux session expires
Solution:
# Use tmux (see the Workflow section)
# Or a wake lock in Termux:
# Settings → Acquire wakelock
Problem: Slow connection
Solution:
- Enable SSH compression:
ssh -C user@host - Choose a VPS closer to your location (Europe instead of the USA)
- Use
moshinstead of SSH (tolerates packet loss)
What this means in practice
Mobile programming with Claude Code and Android isn't science fiction - it's a practical solution for the modern developer.
What you gain:
- Full mobility - code always in your pocket
- AI-powered assistance in any situation
- The ability to make quick fixes without waiting for a laptop
- Productivity in "dead" time (commutes, queues, breaks)
What you lose:
- The comfort of a big screen and keyboard
- GUI tools (DevTools, IDE features)
- Some performance (compared with a local setup)
Verdict: A mobile setup is a great supplement, not a replacement. For quick fixes, code review and hotfixes - brilliant. For an 8-hour sprint - no.
Ready for mobile programming? Start with a simple VPS, install Termux and Claude Code, clone a test repo and experiment. You may be surprised how much can be done from your pocket.
Need help with the configuration? Get in touch - we will help you set up a secure, efficient development environment matched to your needs and projects.
Want to see how these solutions would work in your business or farm? Write to us through the contact form – we will discuss where to start.
Frequently asked questions
What is Claude Code and why use it on mobile?
Claude Code is Anthropic's official CLI client - a tool that combines Claude's powerful artificial intelligence with your development environment. It is not an ordinary chatbot for chatting about code.
When does mobile programming make sense?
Mobile programming won't replace a comfortable setup with a laptop, two monitors and a mechanical keyboard.
Is mobile programming good for quick fixes?
A typo in the documentation, a simple CSS bugfix, a configuration change - things that take 5 minutes, but waiting until you're back at the office is a waste of time.