[FEATURE] Add a /shell escape command for interactive/sensitive terminal execution in Remote Control Mode
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When using Claude Code locally, users can run custom commands using the ! prefix (e.g., ! ssh-add ...). If an interactive prompt requires user input or authentication (like a passphrase), the user can easily exit Claude Code, run the command locally, and resume the session.
However, when using Claude Code in Remote Control / Remote Mode, users often do not have direct SSH or shell access to the remote host. This makes it impossible to perform essential system tasks that require interactive input or elevated credentials—such as adding SSH keys (ssh-add), entering passphrases, executing sudo command or refreshing session credentials.
Proposed Solution
Introduce a dedicated /shell <command> escape command within the Remote Control panel/interface.
This command would allow users to execute short shell tasks directly on the host with two key security & usability controls:
- Secure Input Masking: Support interactive stdin (e.g., password/passphrase prompts) directly through the remote UI without leaking secrets/passwords into Claude’s conversation context.
- Log Privacy: Option to hide or mute execution output/logs from Claude to protect sensitive tokens or outputs.
- Execution Guardrails: Limit this functionality to short, interactive commands (or restrict allowed commands via an explicit allowlist/configuration file to prevent abuse).
Alternative Solutions
Currently when i have the possibility I connect to my pc/server using something like moonlight/rdp/parsec (for windows) or I have some ssh keys on my phone (connecting via tailscale) but this is a convoluted setup just to refresh creds. And it is really impractical if i want to analyze the logs or to securely use a password manager.
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
- Running
ssh-addto unlock an SSH key with a passphrase in a remote environment. - Re-authenticating credentials (AWS SSO, GCP login, OAuth tools) that require interactive user input.
- Running out-of-directory utility scripts without giving raw terminal control or sensitive credentials to the AI model.
- Executing sudo (like sudo apt install) command when you have password protected sudo
Additional Context
_No response_