Work on any remote cluster from a single local Claude Code session. Just say "work on dev1" and Claude connects on-demand via SSH — no server or Claude Code install needed on the remote.
Local Claude Code
│
└── remote-claude CLI
│ SSH (ControlMaster)
└── Remote: lightweight read/edit scripts + shell commands
Everything goes through the remote-claude CLI via SSH:
- Read/Edit — small Python scripts auto-deployed to
~/.cache/remote-claude/on the remote on first use. Drop-in replacements for Claude Code's local Read and Edit tools (same args, same output format). - All other operations (bash, glob, grep, write) — standard Linux commands run directly via SSH.
No MCP server, no remote daemon, no Claude Code on the remote. Just SSH + Python.
git clone git@github.com:mxinO/remote-claude.git && cd remote-claude
./install.shThis will:
- Install the Python package (
remote-claude-mcp+remote-claudeCLI) - Register the MCP server with Claude Code (for
use_clusterconnection management) - Generate
~/.config/remote-claude-mcp/clusters.yamlfrom your~/.ssh/config - Install a
SessionStarthook for per-session isolation ($CLAUDE_SESSION_ID) - Add usage instructions to
~/.claude/CLAUDE.md
Restart Claude Code to load.
Edit ~/.config/remote-claude-mcp/clusters.yaml:
clusters:
dev1:
host: dev-cluster-01.example.com
user: myuser
# jump_proxy: bastion.example.com
# ssh_key: ~/.ssh/id_rsa
# port: 22
prod1:
host: prod-cluster-01.example.com
user: myuserSSH config (ProxyJump, ControlMaster, etc.) is respected automatically.
Just talk to Claude naturally:
> Let's work on dev1, the project is in /home/me/myapp
> Fix the bug in server.py on prod-cluster-01.example.com
> Search for TODO comments on dev1 under /home/me/project
> Switch to prod1 and check the logs
Claude automatically connects to the cluster, sets the working directory, and uses remote tools. Relative paths work when a working directory is set. No special syntax needed.
| Operation | Command | Notes |
|---|---|---|
| Read files | remote-claude read <file> [--offset N] [--limit N] |
cat -n format, same as local Read |
| Edit files | remote-claude edit <file> '<old>' '<new>' [--replace-all] |
Same as local Edit |
| Run commands | remote-claude <cmd> |
Any shell command |
| Find files | remote-claude find . -name '*.py' |
Standard Linux |
| Search code | remote-claude rg 'pattern' |
Standard Linux |
| Write files | remote-claude tee file <<< 'content' |
Standard Linux |
| Background | Bash("remote-claude <cmd>", run_in_background=true) |
Local harness notifications |
- Local: Python 3.10+, Claude Code
- Remote: Python 3 (for read/edit scripts), SSH access
No Claude Code installation needed on remote hosts. The read/edit scripts are auto-deployed on first use via SSH.
- Zero remote setup — no server, no daemon, no Claude Code install on remote
- Drop-in Read/Edit — same arguments and output as Claude Code's local tools
- Natural language — just say "work on dev1" and Claude handles the rest
- Per-session isolation — multiple sessions work independently via
$CLAUDE_SESSION_ID - Background tasks —
run_in_backgroundworks with local harness notifications - Working directory — relative paths work; auto-detects remote
$HOME - Auto-deploy — read/edit scripts deployed to remote on first use (atomic, cached)
- Read-before-edit — enforces read tracking, same safety as local Edit tool
- Ad-hoc hosts — use any hostname, not just configured clusters
- SSH config import — installer reads
~/.ssh/configto bootstrap cluster config - MFA support — works with ControlMaster sessions for hosts requiring MFA
The MCP server (remote-claude-mcp) handles only connection management (use_cluster, list_clusters). All file operations go through the remote-claude CLI:
use_cluster()writes active cluster state to a session-scoped JSON fileremote-claudeCLI reads that state and SSHes to the active clusterread/editsubcommands call deployed scripts on the remote- All other args are passed as shell commands via SSH
For the previous MCP-based approach (proxying through claude mcp serve), see the mcp-version branch.
- Python 3.10+ (local)
- Python 3 (remote — for read/edit scripts only)
mcpPython SDK,pyyaml(local)- SSH access to remote clusters