ClaudeGo fixes this. One script, zero dependencies, bulletproof sessions.
The mobile Claude Code experience is broken. SSH drops. Sessions vanish. Your 512MB VPS kills tmux with OOM errors. You spend more time fighting infrastructure than coding.
ClaudeGo is a single, dependency-free bash script that transforms any Linux server into a rock-solid Claude Code workstation. Connect from your phone (Termius, Blink Shell, JuiceSSH), close the app, switch networks, put your phone to sleep - your session survives.
$ tmux ls
no server running on /tmp/tmux-1000/default
Sound familiar? Here's what kills your sessions:
- OOM Killer - Your 512MB VPS runs out of memory, Linux kills tmux
- Systemd Scope Failures - Degraded user sessions crash tmux on pane creation
- SSH Drops - Phone goes to sleep, connection dies, attached session dies with it
- No Swap - Memory pressure with nowhere to spill over
- Firewall Blocks - Mosh ports not open, falling back to fragile SSH
curl -fsSL https://raw.githubusercontent.com/ankurkakroo2/claudeGo/main/claudego | bashOr download and run:
wget https://raw.githubusercontent.com/ankurkakroo2/claudeGo/main/claudego
chmod +x claudego
./claudegoClaudeGo handles everything:
- Detects low RAM and sets up swap (stops OOM kills)
- Installs and configures mosh (survives network changes)
- Configures tmux with systemd-safe wrapper (no more scope failures)
- Opens firewall ports (SSH + mosh)
- Installs Node.js and Claude Code
- Creates helpful aliases (
cgto start,cg-statusto check health) - Resumes from where it left off if interrupted
Pure bash. No Python, no Ruby, no package managers beyond what's on your system.
Script crashed? SSH dropped mid-install? Just run it again. ClaudeGo tracks progress and picks up where it left off.
Built for the exact pain points of mobile SSH:
- Mosh for connection persistence
- Tmux wrapper that avoids systemd scope issues
- Swap setup for memory-constrained VPS
- Quick aliases for one-handed operation
Every step is explained. Every action requires confirmation. No black boxes.
# One-liner install
curl -fsSL https://raw.githubusercontent.com/yourusername/claudego/main/claudego | bash
# Or step by step
wget https://raw.githubusercontent.com/yourusername/claudego/main/claudego
chmod +x claudego
./claudego- Edit your host connection
- Enable "Use Mosh" in connection settings
- Connect to your server
- Run:
cg - Work with Claude as long as you need
- Detach:
Ctrl+b dbefore closing Termius - Reconnect anytime:
cgto resume exactly where you left off
| Client | Platform | Mosh Support | Notes |
|---|---|---|---|
| Termius | iOS/Android | Yes (toggle in settings) | Most popular, works well |
| Blink Shell | iOS | Yes (native) | Best mosh implementation |
| JuiceSSH | Android | Plugin | Good alternative |
| Termux | Android | Yes (install mosh) | Full Linux environment |
cg # Start or attach to Claude session
cg-new # Force create new session (kills existing)
cg-list # List all tmux sessions
cg-kill # Kill Claude session
cg-status # Show system status (memory, swap, sessions)
cg-help # Quick referenceInside a tmux session:
| Keys | Action |
|---|---|
Ctrl+b d |
Detach (session keeps running) |
Ctrl+b [ |
Scroll mode (use arrows, q to exit) |
Ctrl+b c |
Create new window |
Ctrl+b n |
Next window |
Ctrl+b p |
Previous window |
Ctrl+b 1-9 |
Jump to window number |
Golden Rule: Always detach (Ctrl+b d) before closing your terminal app.
Detects OS, package manager, RAM, existing swap. Warns if your setup is at risk.
On servers with <512MB RAM, swap is mandatory. ClaudeGo creates a 2GB swapfile and makes it persistent across reboots.
Installs: tmux, mosh, curl, git
Installs latest LTS via NodeSource. Required for Claude Code.
Verifies mosh-server works. Mosh keeps your session alive when:
- Phone switches from WiFi to cellular
- Connection drops temporarily
- Phone goes to sleep
- IP address changes
Opens ports in UFW:
- TCP 22 (SSH - initial handshake)
- UDP 60000-61000 (Mosh - persistent connection)
Creates ~/.tmux.conf optimized for mobile:
- Extended history (100k lines)
- Mouse support
- Aggressive resize for varying screen sizes
Adds a safe wrapper to ~/.bashrc that prevents systemd scope failures:
tmux() {
command env -u DBUS_SESSION_BUS_ADDRESS -u XDG_RUNTIME_DIR /usr/bin/tmux "$@"
}This is crucial. Without it, tmux can fail silently on many VPS configurations.
Installs @anthropic-ai/claude-code globally via npm.
Adds cg, cg-new, cg-list, cg-kill, cg-status, cg-help to your shell.
Verifies everything is working:
- Swap present
- Mosh available
- Tmux configured
- Claude installed
- Firewall rules set
- User lingering enabled
Cause: OOM killer terminated tmux, or systemd scope failure.
Fix:
# Check if OOM killed something
sudo journalctl -b | grep -i "oom\|killed process"
# Check swap
free -h
swapon --show
# If no swap, run claudego again to set it up
./claudegoCause: Firewall blocking UDP ports.
Fix:
# Check firewall
sudo ufw status
# Should show:
# 60000:61000/udp ALLOW Anywhere
# If not:
sudo ufw allow 60000:61000/udpCause: Systemd user session is degraded.
Fix: ClaudeGo's tmux wrapper should prevent this. Verify it's in your bashrc:
grep "ClaudeGo tmux wrapper" ~/.bashrcIf missing, run ./claudego again.
Cause: npm global bin not in PATH.
Fix:
# Find where npm installs globals
npm config get prefix
# Add to PATH (replace /usr/local with your prefix)
export PATH="$PATH:/usr/local/bin"
# Or re-run claudego
./claudego~/.claudego/
├── state # Installation progress (for resume)
├── config # User configuration
└── install.log # Detailed installation log
~/.tmux.conf # Tmux configuration
~/.bashrc # Shell aliases and tmux wrapper
- Linux (Ubuntu, Debian, RHEL, Fedora, Arch)
- Bash 4+
- sudo access
- Internet connection (for package installation)
Tested on:
- Ubuntu 20.04, 22.04, 24.04
- Debian 11, 12
- DigitalOcean droplets (512MB to 8GB)
- AWS EC2
- Google Cloud Compute
Tmux alone doesn't survive OOM kills, doesn't handle systemd scope failures, and doesn't persist through network changes.
Mosh keeps the connection alive, but the session still dies if the server-side process is killed. You need tmux + mosh together, configured correctly.
Swap helps, but without proper tmux configuration (avoiding systemd scope issues), sessions still die unexpectedly.
Great if you have a laptop. ClaudeGo is for when your phone is all you have.
Your Phone
│
│ (mosh - survives network issues)
▼
SSH Connection
│
│ (initial handshake only)
▼
Mosh Server
│
│ (persistent UDP connection)
▼
Tmux Server
│
│ (survives disconnects, protected from systemd issues)
▼
Claude Code
│
│ (your actual work)
▼
Swap Memory (prevents OOM kills when RAM fills)
Each layer protects against different failure modes:
- Mosh: Network instability
- Tmux: Connection/terminal loss
- Swap: Memory exhaustion
- Wrapper: Systemd scope failures
PRs welcome. Please test on at least one of:
- Ubuntu 22.04 (most common)
- Debian 12
- A 512MB VPS (stress tests the swap/OOM handling)
MIT
Stop losing sessions. Start shipping code.
curl -fsSL https://raw.githubusercontent.com/ankurkakroo2/claudeGo/main/claudego | bash