feat: phone-pickup Claude Code Remote Control for local folders on link - #138
Merged
Merged
Conversation
Owner
Author
|
CI note: the The job fails during Evidence it predates this branch:
So this isn't fixable from within this PR — it needs the Generated by Claude Code |
Add one Restart=always systemd user service per local project folder on `link` (modelled on openclaw-gateway), each hosting a Claude Code Remote Control session rooted in a real local folder. The phone's Claude app is a window into these local sessions, so folders like the OpenClaw workspace are always pickable from mobile without pushing anything to GitHub. The launcher auto-detects the installed claude's Remote Control surface: `claude remote-control` server mode when present, else the interactive `--remote-control` flag under a `script` PTY so it runs headless. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPtXx5e689U6QVbyzPgi13
Multipixelone
force-pushed
the
claude/multi-folder-local-access-8warrt
branch
from
July 23, 2026 22:35
fb92be7 to
195ec6e
Compare
~/Documents/Git/openclaw was a guess and does not exist on link, so the unit would crash-loop. Use OPENCLAW_STATE_DIR (~/.openclaw) instead -- the same root openclaw-gateway runs in -- so the session sees the config files alongside workspace/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Goal: keep Claude Code "always open" in several truly local project folders on
link(the OpenClaw workspace + a fixed list) and pick any of them up from the phone — without pushing anything to GitHub.The mechanism is Claude Code Remote Control (research preview; Pro/Max), not the cloud "Claude Code on the web" product. A Remote Control session runs on
linkagainst the real local filesystem; the phone's Claude app Code tab / claude.ai/code is just a window into it. The one catch that shapes the design: the localclaudeprocess must stay alive, so "always pick up from my phone" becomes "keep one process running per folder onlink" — exactly what the existingopenclaw-gatewayuser service already does.Change
New auto-discovered module
modules/link/claude-remote-control.nix:Restart=alwayssystemd user service per folder (claude-rc-<name>), modelled onmodules/link/openclaw.nix,WorkingDirectoryrooted in that folder.writeShellApplicationlauncher that auto-detects the installedclaude's Remote Control surface and picks the right invocation, so it's robust to version drift:remote-controlsubcommand (server mode) → use it (stays running headless, no PTY);--remote-controlflag under ascriptPTY so it runs under systemd. (Theclaudebuild checked here — 2.1.218 — only has the flag, not the subcommand.)CLAUDE_REMOTE_CONTROL_SESSION_NAME_PREFIX; the folder list is a clearly-markedfoldersattrset at the top of the file.One-time setup that can't be codified in Nix
Remote Control state lives in
~/.claudeand there is nosettings.jsonkey to enable it, so onlinkastunnel:claude→/loginonce (full-scope OAuth;setup-token/CLAUDE_CODE_OAUTH_TOKENare rejected). Re-/loginwhen the token expires.claudeonce inside each listed folder to accept workspace trust.loginctl enable-linger tunnelonly if sessions must run while logged out (may already hold).Pre-flight verified: nothing in this repo exports
ANTHROPIC_API_KEY/ANTHROPIC_BASE_URLintotunnel's env (the only Anthropic key is the standalonepremtweetdaemon secret), so the main Remote Control blocker is absent. The service also clears them defensively viaUnsetEnvironment.To confirm before merge
folderslist is seeded withopenclawandinfra— confirm the real OpenClaw workspace path (its dev folder isn't referenced elsewhere in the repo;~/Documents/Git/openclawis a guess from the$PROJECTS_DIRconvention) and add the rest of the fixed set.link, confirm which Remote Control surface this build has (claude remote-control --help) and, for server mode, whether--spawn same-diris needed.Verify
Then: Claude app → Code tab → the folder session appears (green dot) → open it → run
pwd/ a small edit → confirm it acts onlink's local files. Repeat for a second folder to confirm they list separately.Caveats
openclaw-gateway.link).Generated by Claude Code