C.W.K.
Stream
Lesson 02 of 06 · published

SSH Direct — The Setup That Always Works

~16 min · remote, ssh, ed25519, config

Level 0🌱 Novice
0 XP0/70 lessons0/11 achievements
0/120 XP to next level120 XP to go0% complete

Reuse your SSH stack, no proprietary tunnels

SSH Direct is the most common Remote setup. It uses your existing SSH infrastructure — keys, ~/.ssh/config, jump hosts — with no Anthropic-proprietary agents or custom protocols. If you can SSH to a machine, you can hand off a Claude session to it.

Prereqs: Claude Code installed and authenticated on both sides, key-based SSH (don't use passwords for Remote — payloads contain your code), and a ~/.ssh/config entry that names the target. ed25519 keys are the recommended default; RSA still works.

The setup flow: install Claude Code on the remote, generate or reuse an SSH key, add the public key to the remote, write a ~/.ssh/config entry, register the destination in Claude Code Desktop (or via claude remote add), dry-run with claude remote ping + claude remote check, then hand off for real.

Code

End-to-end SSH Direct setup·bash
# 1. Install Claude Code on the remote
ssh user@remote-host
npm install -g @anthropic-ai/claude-code
export ANTHROPIC_API_KEY=sk-ant-...
claude --login           # or set the env var permanently
exit

# 2. Generate / reuse an ed25519 key
ssh-keygen -t ed25519 -C "claude-remote" -f ~/.ssh/claude_remote
ssh-copy-id -i ~/.ssh/claude_remote.pub user@remote-host

# 3. ~/.ssh/config
cat >> ~/.ssh/config <<'EOF'
Host my-dev-server
    HostName 192.168.1.50
    User ubuntu
    IdentityFile ~/.ssh/claude_remote
    ServerAliveInterval 30
    ServerAliveCountMax 3
EOF

# 4. Register and verify
claude remote add my-dev-server
claude remote ping  my-dev-server
claude remote check my-dev-server     # version compatibility
Real handoff·bash
# Hand off the current session
claude remote handoff my-dev-server

# Hand off and immediately resume on the remote (new terminal)
claude remote handoff --resume my-dev-server

# Hand off targeting a specific project path
claude remote handoff --remote-path /home/ubuntu/myproject \
                      my-dev-server

# Hand back to local
claude remote handoff --back local

External links

Exercise

Set up SSH Direct end-to-end against a real remote machine (a homelab box, a cheap cloud VM, even another Mac on your LAN). Run claude remote ping and claude remote check. Hand off a session, do something on the remote, hand back. Capture the timings.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.