Repository navigation
feat(claude-dev): ✨ add optional Remote Control server - #117
Merged
Merged
Conversation
✅ PR Validation Passed
📋 Pipeline Status
🤖 Generated by @helpers4 CI • 2026-10-26 |
New remoteControl option (off by default) keeps `claude remote-control` running in a detached tmux session, started by a new postStartCommand after the ~/.claude volume is linked. Sessions can then be started and driven from claude.ai/code or the Claude app, one server per devcontainer, named after the org. - claude-rc command: start, stop, restart, attach, status - name: option, $CLAUDE_RC_NAME, org-workspace org, origin owner, folder - directory: /workspaces with org-workspace, workspace folder otherwise - waits for a claude.ai login, restarts with backoff, never fails start - remoteControl implies installCli and installs tmux - with_remote_control scenario; test.sh checks the default-off no-op Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012mZ8FT5QWA9pqZovdU4pKJ
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012mZ8FT5QWA9pqZovdU4pKJ
The tmux pane runs the restart loop, not a shell: typing `claude auth login` there, as the message and README said, did nothing. `claude-rc login` runs the login from any terminal of the devcontainer; the loop picks it up within 30s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012mZ8FT5QWA9pqZovdU4pKJ
Log in and trust the repo from the Claude extension, nothing else: - the loop answers "Enable Remote Control?" itself and declines "Trust <dir>?" (retried every 30s until the extension has trusted the folder) - the server runs in the workspace folder, the directory the extension trusts, not /workspaces (untrusted, not a git repo, holds symlinks to sibling repos) - CLAUDE_CONFIG_DIR points at the volume so ~/.claude.json (account, trust, confirmation) survives rebuilds; seeded from an existing ~/.claude.json Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
answer_prompts reads the visible tmux pane, which still showed the previous run's "Trust …? [y/N]" after a retry. Once the directory was trusted, the next run's watcher typed "n" + Enter into the running server. Clear the pane before each run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012mZ8FT5QWA9pqZovdU4pKJ
Claude Code asks "Trust this folder?" before `claude remote-control` starts, and the Claude extension never answers it for the CLI. With the option on, the loop answers yes for the server's folder; off (default), it answers no, tells the user to run `claude` once in the folder, and retries every 30s. Documented, examples set it to true. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude Code labels the environment in claude.ai/code with the git repository name; remoteControlName only titles the first session and prefixes the others. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
baxyz
force-pushed
the
feat/claude-dev-remote-control
branch
from
October 26, 2026 12:22
de79bd4 to
7ffe32d
Compare
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
New
remoteControloption forclaude-dev(off by default). When on, the devcontainer keeps a Claude Code Remote Control server (claude remote-control) running in a detached tmux session, so sessions can be started and driven in this devcontainer from claude.ai/code or the Claude mobile app — with no VS Code window open on it.First start: log in from the Claude extension, nothing else
The loop waits for the login, then answers the two one-time questions
claude remote-controlasks, by reading the tmux pane:Enable Remote Control? (y/n)→ yes (you asked for it withremoteControl);Trust <folder>? [y/N]→ yes withremoteControlAutoTrust, otherwise no, retried every 30 s until you runclaudeonce in the folder and accept. The Claude extension never sets this trust (it relies on VS Code's Workspace Trust), so it can't be left to the extension.No
claude-rc attach, noclaude auth login: the extension login is enough (checked on a fresh devcontainer).How
postStartCommand: claude-rc start --lifecycle— runs afterpostCreateCommandhas linked~/.claudeto the volume. Silent no-op when the option is off; never fails the container start (missing CLI/tmux → warning).claude-rc(/usr/local/bin):start(idempotent),stop,restart,login,attach(debug),status. Restartsclaude remote-controlforever, backing off up to 5 min when it keeps exiting right away, 15 s otherwise.CLAUDE_CONFIG_DIR=/mnt/h4claude(containerEnv):~/.claude.json(account, trust, confirmation) lives outside~/.claude, so the symlink didn't cover it and it was lost on rebuild. It now lives in the volume; an existing home-level file is seeded into it. This applies to everyclaude-devuser, not onlyremoteControl.remoteControlDir→ the workspace folder. Not/workspaceswithorg-workspace: trust is per directory, and/workspacesis neither the folder opened in VS Code nor a git repository.remoteControlName→$CLAUDE_RC_NAME→org-workspace'sorg→ origin owner → folder → hostname. It titles the first session and prefixes the others; the environment label in claude.ai/code is the git repository name, which Claude Code doesn't let us set.remoteControlSpawn(same-dir/worktree),remoteControlPermissionMode.remoteControlimpliesinstallCliand installs tmux (apt).Not covered
A headless host (no screen) needs something to run
devcontainer upat boot:postStartCommandonly runs when devcontainer tooling starts the container, not on a plaindocker restart.Tests
test.sh(defaults):claude-rcinstalled,RC_ENABLED=falsebaked, loop not running.with_remote_controlscenario: CLI implied, tmux installed, options baked,CLAUDE_CONFIG_DIRset, loop running afterpostStartCommand, name"h4 test"sanitized toh4-test.org-workspacesibling repos): fresh volume, extension login only → server connected and listed in claude.ai/code. Not run:devcontainer features test(no containers under DooD here) — CI is the first run of the test scripts; shellcheck wasn't available either.Version: 1.3.1 → 1.4.0 (new options). README (feature + root) and AGENTS.md table updated.
🤖 Generated with Claude Code