Stack A · 15 min · your AI plan

Claude Code on the VPS: code from anywhere

Install the AI agent on the box that serves traffic, run it in tmux, and SSH in from any device. Your laptop becomes a window onto the VPS.

Claude Code on the VPS

The big idea: the AI agent runs on the same machine that serves your app. It edits the files that are actually live, it runs the build that systemd restarts, and you can drive it from a 50 EUR Chromebook because the heavy lifting happens on the box.

1. Install Claude Code

On the VPS, as your user:

npm install -g @anthropic-ai/claude-code   # or the installer for your tool
claude   # first run authenticates you (browser or device code)

Authenticate once. Your API key / session lives on the box, not on each device you SSH from.

2. Run it inside tmux

cd ~/hackup
tmux new -s claude
claude

Now Claude is running in a persistent session. Detach with Ctrl+B, D. It keeps working (or waits for you) while you are gone.

3. Drive it from anywhere

From an old laptop, a Chromebook, or even a phone (Termux on Android, or a SSH app on iOS):

ssh hackup@YOUR_VPS_IP
tmux attach -t claude

You are back in the exact same session, same files, same agent. Your laptop is now just a window onto the VPS.

4. Let the agent ship

Because Claude is on the box, it can:

  • edit the files systemd serves
  • run npm run build and npm run deploy:vps
  • read journalctl -u hackup-web to see what failed
  • curl http://127.0.0.1:8793/health to check the app

You are not copying code between machines. The agent edits the source of truth.

Safety rails

  • Keep git as your undo: commit before letting the agent do big changes, git checkout . to revert.
  • Keep your .env.production chmod 600 and gitignored; don’t paste it into the agent’s context unless you mean to.
  • One project per tmux session so contexts don’t bleed.

New models & deals, once a month

New proprietary and open-source models worth trying, price drops, and the best deals on AI coding plans. No spam.