惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
罗磊的独立博客
F
Fortinet All Blogs
人人都是产品经理
人人都是产品经理
量子位
V
Visual Studio Blog
Blog — PlanetScale
Blog — PlanetScale
M
MIT News - Artificial intelligence
B
Blog RSS Feed
腾讯CDC
博客园_首页
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
博客园 - Franky
S
SegmentFault 最新的问题
N
Netflix TechBlog - Medium
小众软件
小众软件
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LINUX DO - 热门话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
D
Docker
P
Privacy & Cybersecurity Law Blog
S
Securelist
V
V2EX
Jina AI
Jina AI
阮一峰的网络日志
阮一峰的网络日志
T
Tor Project blog
The Hacker News
The Hacker News
Microsoft Azure Blog
Microsoft Azure Blog
AWS News Blog
AWS News Blog
The GitHub Blog
The GitHub Blog
有赞技术团队
有赞技术团队
T
The Exploit Database - CXSecurity.com
Help Net Security
Help Net Security
酷 壳 – CoolShell
酷 壳 – CoolShell
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 叶小钗
Recent Announcements
Recent Announcements
Cloudbric
Cloudbric
Y
Y Combinator Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Latest news
Latest news
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Recorded Future
Recorded Future
V2EX - 技术
V2EX - 技术

J.D. Hodges

Mac Prices Went Up June 2026: What Changed and What to Buy How to Enable Wake-on-LAN on Synology NAS | Quick Guide Is the BCBS Settlement Payment Email Legit? (May 2026) How to Fix the VMware Workstation "mksSandbox" Crash (ISBRendererComm Error) - J.D. Hodges How to Check Codex Usage: CLI Status Line and Web Page How to Check Your Codex Usage on ChatGPT (Plus and Pro) MacBook Neo GPU vs Snapdragon X2, Radeon, Arc, RTX 5060 ThinkPad History: IBM 700C to Lenovo AI Workstations Codex /goal: How It Works, Setup, and What I Tested The BeBox: BeOS Hardware, Photos, and the Apple Deal That Wasn't Unable to Load Usage Limits in Claude? Use /usage Mother-In-Law Method for Claude Code Review (Honest Take) Best Laptop for Claude Code (2026) Best Way to Cook Corn on the Cob | Milk and Butter Boil Best Computer for ChatGPT (2026) | Laptops, Desktops, Budget Picks How to Use GPT-5.5 Today via Your Codex Subscription Remove McAfee WebAdvisor on Windows: Stop the Popup Codex Sandbox Error on Ubuntu 24.04: The AppArmor Fix WD19TBS Mouse Lag Fix: Dell Firmware Update Worked Claude Opus 4.6 vs 4.7 Max: WordPress Task Graded Claude Code Opus 4.7: Terminal + VS Code Upgrade Instructions Claude Code Rate exceeded. - J.D. Hodges Chuwi MiniBook X vs MacBook Neo: The $399 Laptop That Refuses to Throttle - J.D. Hodges Meta Muse Spark: The Honest Scorecard (3 Wins Out of 20) Who Reads This Blog? Traffic by OS - J.D. Hodges Can MacBook Neo Run Claude Code? $599 Benchmark Test Minisforum MS-01 Proxmox Review: 2 Months Off-Grid on Solar Claude vs ChatGPT vs Gemini for Coding: Real Benchmark Results Claude Code /buddy: How to Preview, Hatch, and Reroll Your Terminal Pet Claude code source code analysis - J.D. Hodges
How to Set Up a SSH Connection in Claude Code Desktop
J.D. H. · 2026-05-25 · via J.D. Hodges

Summary: Claude Code’s desktop app can SSH into a remote machine and run sessions there against your repo, MCP servers, and ~/.claude config. Setup is a four-field dialog, assuming ssh user@host (where user is your username and host is the hostname or IP) already works from your terminal. The non-obvious caveat: session history is siloed. The desktop app, the CLI on the remote, and the VS Code extension (if you use it) on the remote each keep separate session lists.

Details and use cases

I generally use a Windows desktop or laptop and a Linux dev VM, sometimes with a Mac thrown into the mix. The repo, the MCP servers, and the ~/.claude config with all my custom instructions and skills live on a dedicated development environment on the Linux VM. The Windows or Mac machines are the comfortable daily drivers that I use VS Code on, with remote SSH access to the Linux VM.

I also want to be up to date on Anthropic’s desktop app situation. The desktop app’s SSH option supports exactly what I like: an easy desktop interface for remote Claude Code instances. (You can do the same thing with Codex and their Codex desktop app.) The setup for a SSH connection in Claude Code Desktop is straightforward:

First, if you haven’t already, install Claude Desktop for Windows or Mac.

Claude Code desktop app installer progress bar at 25 percent (52 of 209 MB downloaded)
First-time launch pulls the desktop app down before the connection dialogs appear.

Here are the key ingredients:

  • Claude Code desktop app installed on Windows or Mac, signed in with a Claude account that has Claude Code access
  • A remote machine reachable over SSH on port 22 (or whatever port you use for SSH)
  • A SSH key pair on your local machine whose public half is in ~/.ssh/authorized_keys on the remote
  • The remote user, hostname or IP

If ssh user@host already works from your terminal, you are done with prereqs. The desktop app handles installing Claude Code on the remote automatically the first time you connect, so the claude binary does not need to exist there yet.

Walk-through

1. Open the desktop app and pick where Claude runs

The app opens to a “Welcome back” screen. Below the prompt box at the bottom is a small environment selector labeled “Where Claude runs.” Click it.

Claude Code desktop app with a 'Where Claude runs' popover open below the prompt box, showing Local and Select folder options
The environment selector lives below the prompt input. Easy to miss the first time.

The popover shows Local, Cloud, Remote Control, and SSH sections. Click Add SSH host… under SSH.

Close-up of the 'Where Claude runs' menu with the 'Add SSH host' option under the SSH section highlighted by a red box
The SSH section sits below Local, Cloud, and Remote Control.

2. Fill in the SSH connection dialog

The Add SSH connection dialog with four fields: Name, SSH Host, SSH Port, and Identity File (Private Key)
Four fields. Only Name and SSH Host are strictly required.
  • Name: anything readable that makes sense to you. Shows in your environment list.
  • SSH Host: user@hostname-or-ip (fill these in with your details)
  • SSH Port: leave blank for 22.
  • Identity File: leave blank if your default OpenSSH key is already authorized on the remote.

Heads Up

If you leave the SSH Host as just an IP like 192.168.1.10 without the user@ prefix, Claude Code likely defaults to your local username (Windows username or Mac short name). On a Linux box where the remote account is named something else, the connection fails and you get a password prompt that no password can satisfy, because the username itself is wrong. Always prepend the remote user.

3. Verify SSH itself before you commit

Before saving the dialog, you can also confirm SSH key auth works from your terminal:

ssh youruser@192.168.1.10 "uname -s && whoami"

Expected output: Linux on its own line, then the username you connected as. No password prompt. If you do get a password prompt, the usual cause is that OpenSSH cannot find your key in its default location: C:\Users\<you>\.ssh\ on Windows or ~/.ssh/ on macOS. It usually looks for id_ed25519 or id_rsa. Either point the Identity File field at the real key path, or move the key to the default location. If the key is in the right place and you still get prompted, the next thing to check is whether your public key is actually in ~/.ssh/authorized_keys on the remote.

Note: do not test for the claude binary at this stage. The desktop app installs Claude Code on the remote during the first connection, so a clean remote will not have it yet.

4. Pick a folder

Claude Code 'Welcome back' screen with the 'Select folder' button highlighted near the bottom of the window
This picks the working directory on the remote, not on your local machine.

The folder you pick is on the remote machine, the same place you would cd to in a terminal. That path becomes the working directory for the session and the root that Claude’s tools operate against.

5. Trust the workspace

A 'Trust this workspace' confirmation dialog noting that Claude Code may read, write, or execute files in the selected directory
If a .claude/settings.local.json exists in the folder, the app surfaces it here.

If you have used Claude Code in that folder before, a .claude/settings.local.json already exists and the app shows it. Click Trust Workspace.

That is the happy path. You can prompt the session like any local Claude Code window.

The sessions issue

Here is the part that might catch you off guard. The CLI on the remote, the desktop app on the local machine, and the VS Code extension all have different session histories. Same dev machine, same ~/.claude/ config, same .jsonl files on disk. So you might expect some coherency between sessions, but that is not the case:

Per Anthropic’s own sessions documentation: “The desktop app, Claude Code on the web, and the VS Code extension each maintain their own session history.”

This is not a big deal b/c you should have plenty of documentation in your projects to get going with new sessions etc. But it can still be a bit of a pain if you just want to hop between sessions. A quick handoff prompt and you will hopefully be fine. 💪

Claude Code desktop app showing the error '/resume isn't available in this environment' after typing /resume at the prompt, with a sparse Recents list visible in the left sidebar
The /resume command is CLI-only. The desktop app rejects it and falls back to its own Recents sidebar.

In practice:

  • Historical sessions on the remote (from CLI and VS Code work) do not appear in the desktop app’s Recents.
  • /resume, the CLI command for picking a past session, is not available in the desktop app. I tried. The reply was literally: “/resume isn’t available in this environment.”
  • The desktop app starts a fresh Recents list from its own usage.

What does still merge across surfaces:

  • The repo and your files on the remote (same disk).
  • The ~/.claude/ config: CLAUDE.md, settings, auto-memory, MCP servers, plugins.
  • Git state.
  • Anthropic API quota and billing.

So the silo is purely the conversation history list. To browse historical sessions, you still need a terminal on the remote and claude --resume, or the VS Code extension’s resume picker.

Quality-of-life upgrades

DHCP reservation

If your remote is on DHCP, its IP can change after a reboot and silently break your saved SSH connection. Open your router admin, set a reservation for the remote’s MAC at its current IP, and the IP stays put through future leases.

If you get stuck

Hit a snag I did not cover? Visit with your own Claude session. Hand it the error message, point it at this post for context, and ask it to walk through your specific setup. 👍

One tip that matters: tell Claude to research before advising. App versions ship with new dialogs, defaults change, and a Claude that verifies the current state of things beats one pattern-matching from training data. Something like “check the current docs and confirm before answering” goes a long way.

The End

If ssh user@host already works from your terminal, the desktop app’s SSH connection is four fields and a folder selection. The interesting part is the session-history silo: desktop, CLI, and VS Code each keep their own Recents list, so claude --resume on the remote will not populate the desktop app’s sidebar. Happy coding!

Sources and Further Reading


Accurate at time of writing. Something off? Drop a comment.