feat: enable Remote Control by default with a project-named prefix - #15
Merged
intech merged 1 commit intoAug 3, 2026
Merged
Conversation
`--remote-control` is now passed on every session by the entrypoint instead of being opt-in; opt out with `CLAUDE_REMOTE_CONTROL=0`. There is no settings.json key that turns Remote Control on (only `disableRemoteControl` to turn it off), so the CLI flag is the only way to default it on. Also pass `--remote-control-session-name-prefix`. The CLI default for the prefix is the hostname, which inside a container is a throwaway hex id. The prefix comes from `CLAUDE_REMOTE_CONTROL_PREFIX`; `run_claude.sh` and the generated `claude-box` launcher default it to the host project directory name, and the entrypoint falls back to `claude-box`. It is sanitised to `[[:alnum:]._-]` and truncated to 40 chars, so a prefix containing spaces or shell metacharacters cannot split into extra argv entries. Honest limitation, verified not assumed: with the inference-only `CLAUDE_CODE_OAUTH_TOKEN` this image normally runs with, the flag is inert. `claude doctor` in the built image reports verbatim: Remote Control requires a full-scope login token. Long-lived tokens (from claude setup-token or CLAUDE_CODE_OAUTH_TOKEN) are limited to inference-only for security reasons. Run claude auth login to use Remote Control. - Sign-in is missing the user:profile scope To keep this from being a silent dead knob, the entrypoint prints that caveat at startup whenever `CLAUDE_CODE_OAUTH_TOKEN` is set, and names both remedies (`claude auth login`, or `CLAUDE_REMOTE_CONTROL=0`). SECURITY.md now describes Remote Control as a default-on remote-input channel into an agent that has read-write access to the project, with the opt-out. Verified against the rebuilt image by stubbing `claude` on PATH and inspecting the argv the entrypoint produces: - default + token set -> --remote-control --remote-control-session-name-prefix <prefix>, INACTIVE notice - CLAUDE_REMOTE_CONTROL=0 -> no Remote Control flags at all - no token -> flags passed, plain "Remote Control on" notice - prefix "my proj/../x!;rm -rf" -> "my-proj-..-x--rm--rf", still a single argv token - empty prefix -> falls back to claude-box and end to end through the real entrypoint: `claude -p` returns normally with both flags accepted. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Stacked on #14 (
deps/bump-toolchain-2026-08) because it needs claude-code 2.1.220 to be verified against. Merge #14 first; this PR's base can then be retargeted tomain.What
Remote Control is now on by default for every session, with session names prefixed by the project.
--remote-controlis passed by the entrypoint unconditionally. Opt out withCLAUDE_REMOTE_CONTROL=0(previously it was opt-in viaCLAUDE_REMOTE_CONTROL=1).--remote-control-session-name-prefixis passed too. The CLI default for the prefix is the hostname, which inside a container is a throwaway hex id. It now comes fromCLAUDE_REMOTE_CONTROL_PREFIX;run_claude.shand the generatedclaude-boxlauncher default it to the host project directory name, and the entrypoint falls back toclaude-box.There is no settings.json key that enables Remote Control (only
disableRemoteControlto turn it off), so a CLI flag is the only way to default it on.Limitation — verified, not assumed
With the inference-only
CLAUDE_CODE_OAUTH_TOKENthis image normally runs with, the flag is inert.claude doctorin the built image says so verbatim:To keep this from being a silent dead knob, the entrypoint prints the caveat at startup whenever
CLAUDE_CODE_OAUTH_TOKENis set, and names both remedies (claude auth logininside the container, orCLAUDE_REMOTE_CONTROL=0):Security posture change
SECURITY.mdpreviously described Remote Control as opt-in and off. It now describes it as a default-on remote-input channel into an agent that has read-write access to the project, and states the opt-out. This is a deliberate loosening of the default; reviewers should read that section.Prefix sanitisation
The prefix is stripped to
[[:alnum:]._-]and truncated to 40 chars. That matters becauseEXTRA_ARGSis word-split onexec— a prefix containing spaces would otherwise become extra argv entries.Verification
Built the image, then stubbed
claudeonPATHto print the argv the entrypoint produces:--remote-control --remote-control-session-name-prefix <prefix>+ INACTIVE noticeCLAUDE_REMOTE_CONTROL=0my proj/../x!;rm -rfmy-proj-..-x--rm--rf, still a single argv tokenclaude-boxCLAUDE_BYPASS_PERMISSIONS=1combinedEnd to end through the real entrypoint:
claude -preturns normally, so the real CLI accepts both flags.bash -npasses onrun_claude.sh,install.sh, and theclaude-boxlauncher extracted from its heredoc.Not verified locally: arm64 (no qemu binfmt on the build host) — covered by the
pull_requestCI job.🤖 Generated with Claude Code