[BUG] SendUserFile never delivers files from sessions a `claude remote-control` server spawns
What's wrong
In a session spawned by claude remote-control, every SendUserFile call returns not delivered: this session is not on a project thread, so it has nowhere to place a file. The card still shows up in the iOS app, but it's greyed out and won't open. It happens for any file, including a small PNG at the root of the session's own worktree.
From reading the 2.1.280 bundle, it looks like the upload lane selector never picks a route for these sessions. The spawned child gets CLAUDE_CODE_ENVIRONMENT_KIND=bridge, replBridgeEnabled is false, and none of CLAUDE_CODE_BRIEF_UPLOAD, CLAUDE_CODE_REMOTE_ENVIRONMENT_TYPE or CLAUDE_CODE_REMOTE is set, so the lane is none. A terminal session with /remote-control turned on gets the repl lane and uploads fine.
What should happen
A file sent from a server-spawned session should upload and open in the app, the same as from a terminal session with Remote Control on. The tools reference says SendUserFile is available whenever a Remote Control client is connected.
Steps to reproduce
- In a git repo, run
claude remote-control --spawn worktree. - Start a new session on that environment from the iOS app.
- Ask Claude to send any image in the working directory with SendUserFile.
- The tool result says "not delivered", and the card in the app is greyed out.
Error
1 file could NOT be delivered to the user:
<worktree>/test.png (0.0 MiB): not delivered: this session is not on a project thread, so it has nowhere to place a file
Workaround
Setting CLAUDE_CODE_BRIEF_UPLOAD=1 in the server's environment moves spawned sessions to the env_brief_upload lane. The file uploads and opens on iOS. It isn't documented, so I'd rather not depend on it.
Related
#90455 looks adjacent (cards that report success but break when the source path goes away). Separately, when a client asks the session for a file that wasn't uploaded, readFileForRemote refuses any real path outside the session's start directory (read denied: <path>), so files in temp or scratchpad directories can't be opened that way either.
Environment
- Claude Code 2.1.280
- macOS, server run under launchd
- claude.ai login (Anthropic API)
- Regression: don't know
- Model: not model-specific
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗