How to Set Up a Local Development Environment with Remote AI Pair Programming

Vibesies Team | 2026-06-17 | Hosting & Infrastructure

Why Local + Remote AI Hosting Beats Either Alone

Most developers work locally—it's where your muscle memory lives, your editor is tuned, and your git history lives. But when you're building with an AI pair programmer like Claude Code, keeping everything local has a catch: your AI agent lives in your head (or in expensive local token usage), not in a persistent environment where it can learn your codebase, run tests, and iterate without you.

The sweet spot? A hybrid setup: develop locally with your familiar tools, but sync your work to a remote AI hosting environment where Claude Code or OpenAI Codex can run continuously, test your changes, and suggest improvements in real time.

This post walks you through setting up that workflow—no DevOps expertise required.

The Architecture: Local Editor + Remote AI Agent

Here's what we're building:

  • Your machine: VS Code (or your editor), git, local npm/pip installs for fast feedback.
  • Remote server: A managed Linux environment (like Vibesies) with Claude Code or Codex pre-installed, running tests and background tasks.
  • Sync layer: Git + SSH tunneling to keep both in sync without friction.

The AI agent on the remote server watches your commits, runs your test suite, and can suggest refactors or catch bugs before they reach production.

Step 1: Set Up Your Remote AI Hosting Environment

First, you need a persistent Linux environment with your AI tools ready. If you're using a managed solution like Vibesies, this part is handled: you get a Debian container with Claude Code and Codex pre-installed. You just add your API keys in the dashboard and you're live.

If you're using a raw VPS, install the tools manually:

sudo apt update && sudo apt install -y build-essential git curl python3-pip nodejs npm
curl https://claude.ai/install | bash  # or your preferred method
npm install -g @openai/codex  # for Codex

Either way, note your remote server's hostname or IP, SSH port, and username. You'll need these in the next step.

Step 2: Configure SSH Key-Based Authentication

Never use passwords over SSH. Generate a key pair on your local machine if you don't have one:

ssh-keygen -t ed25519 -C "your-email@example.com" -f ~/.ssh/vibesies_key

Copy the public key to your remote server's ~/.ssh/authorized_keys:

ssh-copy-id -i ~/.ssh/vibesies_key.pub -p YOUR_PORT vibe@YOUR_REMOTE_HOST

Test the connection:

ssh -i ~/.ssh/vibesies_key -p YOUR_PORT vibe@YOUR_REMOTE_HOST

If you're on Vibesies, paste your public key in the dashboard under "SSH Keys" and you're done.

Step 3: Initialize a Shared Git Repository

On your remote server, create a bare git repository:

ssh -i ~/.ssh/vibesies_key -p YOUR_PORT vibe@YOUR_REMOTE_HOST
mkdir -p ~/repos/myproject.git
cd ~/repos/myproject.git
git init --bare

On your local machine, add the remote:

cd ~/myproject
git remote add origin ssh://vibe@YOUR_REMOTE_HOST:YOUR_PORT/home/vibe/repos/myproject.git
git push -u origin main

Now every commit you push goes to the remote server, where your AI agent can see it.

Step 4: Configure the AI Agent to Watch Your Repo

SSH into your remote server and clone the repo into a working directory:

cd ~
git clone ~/repos/myproject.git myproject
cd myproject

Create a simple shell script that the AI agent can run on each push. Save it as .vibesies/on-push.sh:

#!/bin/bash
set -e

echo "[AI Agent] Running tests..."
npm test || echo "Tests failed"

echo "[AI Agent] Linting code..."
npm run lint || echo "Linting issues found"

echo "[AI Agent] Checking for security vulnerabilities..."
npm audit --audit-level=moderate || echo "Vulnerabilities detected"

echo "[AI Agent] Build check..."
npm run build || echo "Build failed"

Make it executable:

chmod +x .vibesies/on-push.sh

Set up a git post-receive hook on the bare repo to trigger this script:

cat > ~/repos/myproject.git/hooks/post-receive << 'EOF'
#!/bin/bash
cd ~/myproject
git fetch origin
git reset --hard origin/main
./.vibesies/on-push.sh
EOF
chmod +x ~/repos/myproject.git/hooks/post-receive

Now every time you push from your local machine, the remote server automatically runs tests and checks.

Step 5: Set Up Your Local Git Config for Convenience

Add this to your local .git/config to avoid typing the SSH key path each time:

[core]
    sshCommand = ssh -i ~/.ssh/vibesies_key -p YOUR_PORT

Or add it to ~/.ssh/config for all projects:

Host vibesies-remote
    HostName YOUR_REMOTE_HOST
    Port YOUR_PORT
    User vibe
    IdentityFile ~/.ssh/vibesies_key
    IdentitiesOnly yes

Then update your git remote:

git remote set-url origin ssh://vibesies-remote/home/vibe/repos/myproject.git

Step 6: Connect Your AI Credentials

On the remote server, add your Anthropic or OpenAI API keys to the environment. Create ~/.env:

export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="sk-..."

Source it in your shell profile:

echo 'source ~/.env' >> ~/.bashrc
source ~/.bashrc

If you're on Vibesies, use the dashboard to add these keys securely—they're encrypted and never logged.

Step 7: Test the Full Workflow

Make a small change locally, commit, and push:

echo "console.log('test');" >> index.js
git add index.js
git commit -m "test: add logging"
git push

SSH into the remote server and check the logs:

ssh -i ~/.ssh/vibesies_key -p YOUR_PORT vibe@YOUR_REMOTE_HOST
cd ~/myproject
cat .vibesies/push.log  # if you added logging to your script

You should see test results, lint output, and build status. This is where your AI pair programmer can comment, suggest fixes, or flag issues.

Optional: Add VS Code Remote SSH Extension

If you want to edit directly on the remote server (useful for debugging), install the "Remote - SSH" extension in VS Code:

  • Open the Command Palette (Cmd+Shift+P on Mac, Ctrl+Shift+P on Linux/Windows).
  • Type "Remote-SSH: Connect to Host".
  • Select your remote host from the list (it auto-discovers from ~/.ssh/config).
  • VS Code opens a window connected to the remote server.

Now you can edit, run commands, and see AI agent output all in one place.

Optional: Set Up Continuous Monitoring with Tmux

If you want the AI agent to run continuously (not just on push), use tmux on the remote server:

ssh -i ~/.ssh/vibesies_key -p YOUR_PORT vibe@YOUR_REMOTE_HOST
tmux new-session -d -s ai-watcher
tmux send-keys -t ai-watcher "cd ~/myproject && watch -n 5 'git status'" Enter

This keeps a persistent session running in the background. You can attach to it anytime:

tmux attach -t ai-watcher

Troubleshooting Common Issues

"Permission denied (publickey)" on SSH

Check that:

  • Your public key is in ~/.ssh/authorized_keys on the remote server.
  • Permissions are correct: chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys.
  • You're using the right key: ssh -i ~/.ssh/vibesies_key -v ...</code> shows which key it's trying.

Git push hangs or times out

Check your SSH config for typos in the port or hostname. Test the connection directly:

ssh -i ~/.ssh/vibesies_key -p YOUR_PORT vibe@YOUR_REMOTE_HOST echo "Connected"

Post-receive hook doesn't run

Ensure the script is executable (chmod +x) and has a shebang (#!/bin/bash). Check the bare repo's hooks directory:

ls -la ~/repos/myproject.git/hooks/

Why This Matters for Developer Hosting

A good developer hosting setup isn't just about running your app—it's about enabling your workflow. By pairing a local development environment with a remote AI hosting setup, you get:

  • Fast local iteration: Edit, test, and debug on your machine without latency.
  • Persistent AI pair programming: Your Claude Code or Codex agent runs continuously, learning your codebase and catching issues you'd miss.
  • Automated testing and CI: Every push triggers tests, linting, and security checks without manual setup.
  • No vendor lock-in: This workflow works with any managed Linux hosting, including Vibesies.

Next Steps

Once you've got this baseline working, consider adding:

  • A proper CI/CD pipeline (GitHub Actions, GitLab CI) to replace the post-receive hook.
  • Database backups and snapshots on the remote server.
  • Log aggregation (e.g., tail -f to a central service) to track AI agent activity.
  • Automated deployments to production when tests pass.

The hybrid local + remote model scales well as your projects grow. Start simple with git push and shell scripts, then layer on complexity only when you need it.

If you're looking for a managed solution that handles the hosting side so you can focus on the development workflow, platforms like Vibesies let you skip the VPS setup entirely and go straight to syncing your local repo with a pre-configured AI hosting environment. Either way, the principles here remain the same: keep your editor local, keep your AI agent remote, and let git be the bridge.

Back to Blog
["developer hosting", "AI pair programming", "git workflow", "SSH", "remote development"]