Claude Code: Remote Control, Security Hardening & Plugin Registry Support
Claude Code 2.1.51 introduces claude remote-control, a new subcommand that lets external build systems connect to a locally running Claude Code instance β now available to all users. The release also patches a security vulnerability where statusLine and fileSuggestion hook commands could execute in interactive mode without workspace trust being granted, and improves BashTool performance by skipping redundant login shell initialization when a shell snapshot is already available. Plugin infrastructure gains support for custom npm registries, version pinning, and per-plugin default configuration.
Sources & Mentions
3 external resources covering this update
claude remote-control: External Build Integration
Claude Code 2.1.51 ships the claude remote-control subcommand, which exposes a locally running Claude Code instance as a server for external builds. This allows CI systems, editor extensions, and other tooling to connect to and drive an existing Claude Code environment without spawning a new process. The feature is now available to all users β in prior builds it was limited to a subset of configurations.
Security: Workspace Trust Enforcement for Hook Commands
A security issue was patched in 2.1.51: statusLine and fileSuggestion hook commands could previously execute in interactive mode without the user having accepted workspace trust for the project. This created a potential vector for untrusted codebases to execute code on first open, before explicit trust had been granted. The fix ensures these hook types now gate on workspace trust acceptance before executing, consistent with the behavior of other hook types in Claude Code's trust model.
BashTool: Login Shell Skipped by Default
When a shell snapshot is available, BashTool now skips login shell initialization (the -l flag) by default. Previously, users had to explicitly set CLAUDE_BASH_NO_LOGIN=true to suppress this behavior. Since a shell snapshot already captures the environment state that login initialization would provide, the redundant initialization added latency without benefit. This change reduces command execution overhead across all sessions that use shell snapshots, with no change needed from users.
Tool Result Disk Persistence Threshold Lowered
Tool results larger than 50,000 characters are now persisted to disk rather than held in memory. The previous threshold was 100,000 characters. Halving this threshold reduces the in-memory footprint of large tool outputs, decreasing context window usage and improving conversation longevity before compaction becomes necessary β particularly relevant for agentic workflows that read large files or process substantial command output.
Plugin Infrastructure Improvements
The plugin system received several enhancements in 2.1.51:
- Custom npm registries: Claude Code can now install plugins from custom or private npm registries, enabling enterprise registry configurations as plugin sources.
- Version pinning: Specific plugin versions can now be pinned when installing from npm sources, giving teams reproducible and auditable plugin environments.
- Default configuration via settings.json: Plugin authors can now ship a
settings.jsonalongside their plugin to provide sensible defaults, reducing setup burden on end users.
Model Picker Human-Readable Labels
The /model picker now displays human-readable labels β for example, "Sonnet 4.5" β instead of raw internal model ID strings for pinned model versions. When a newer version of a pinned model is available, the picker shows an upgrade hint, making it easier for users to stay current without manually tracking model identifier strings.
Additional Fixes
- Fixed duplicate
control_responsemessages from WebSocket reconnects causing API 400 errors by preventing duplicate assistant messages from entering the conversation. - Added
CLAUDE_CODE_ACCOUNT_UUID,CLAUDE_CODE_USER_EMAIL, andCLAUDE_CODE_ORGANIZATION_UUIDenvironment variables for SDK callers to provide account metadata synchronously, eliminating a race condition where early telemetry events lacked account information. - Fixed slash command autocomplete crashing when a plugin's
SKILL.mddescription is a YAML array or other non-string type. - Fixed file-not-found errors to suggest corrected paths when the model references a path that drops the repository root prefix.
- Fixed verbose mode not updating the thinking block display when toggled via
/configβ memo comparators now correctly detect verbose state changes. - Opus 4.6 in fast mode now includes the full 1M context window.
- Added
/extra-usagecommand support in VS Code sessions. - Fixed several additional memory leaks in
TaskOutput,CircularBuffer, and shell command execution.