[BUG] SSH remote connection fails with 'failed to upload file: no such file' when Windows username contains spaces
Summary
Claude Code desktop app (Windows) fails to upload its agent binary to a remote SSH server when the Windows username contains spaces.
Environment
- OS: Windows 11
- App version: 2.1.165 (desktop)
- Username path:
C:\Users\John Doe\AppData\Roaming\Claude\claude-code\2.1.165\claude.exe
Steps to Reproduce
- Install Claude Code desktop on Windows with a username containing a space (e.g.
John Doe) - Configure an SSH remote connection (Settings → SSH)
- Attempt to connect
Error
failed to upload file: no such file
Root Cause
The claude agent binary is stored at:
C:\Users\John Doe\AppData\Roaming\Claude\claude-code\2.1.165\claude.exe
The path contains a space due to the Windows username. When Claude Code constructs the SCP/SFTP upload command internally, the path is not properly quoted/escaped, causing the shell to interpret the second part of the username as a separate argument.
Proof the SSH connection itself works: connecting to the same server via ssh -i C:\ssh\keyfile admin@server succeeds from PowerShell.
Workaround
None available without a Windows reinstall with a username without spaces. The %APPDATA% path is used internally and cannot be overridden via junction or symlink since the app resolves it natively.
Expected Behavior
The upload path should be properly quoted when constructing the SSH upload command, handling Windows usernames with spaces.