Repository navigation
v0.16.10
Added
ClaudeAgentOptions#strict_mcp_config(--strict-mcp-config) — whentrue, the CLI uses only the MCP servers passed viamcp_servers, ignoring project.mcp.json, user/global settings, and plugin-provided servers, for a fully deterministic server set. Defaults tofalse. (Parity with Python SDK #915)ClaudeAgentOptions#include_hook_events(--include-hook-events) — whentrue, the CLI emits hook lifecycle events into the message stream, parsed asHookStartedMessage/HookProgressMessage/HookResponseMessage. Defaults tofalse. (Parity with Python SDK #917)SandboxNetworkConfig#denied_domains(deniedDomains) and#allow_mach_lookup(allowMachLookup) — complete the sandbox network field set.denied_domainsblocks domains even when matched byallowed_domains;allow_mach_lookupis a macOS-only list of XPC/Mach service names to allow (supports a trailing wildcard). (Completes Python SDK #893)- Orphaned-subprocess cleanup —
SubprocessCLITransporttracks live CLI subprocesses and registers anat_exithandler that sendsSIGTERMto any still running when the parent Ruby process exits, preventing leakedclaudeprocesses when callers crash or exit before reaching#close. The handler is lock-free (never blocks interpreter shutdown), shares one registry across subclasses, and deregisters reaped children. (Parity with Python SDK #916)
Usage
options = ClaudeAgentSDK::ClaudeAgentOptions.new(
strict_mcp_config: true, # use only your mcp_servers, ignore inherited config
include_hook_events: true, # surface hook lifecycle events in the message stream
sandbox: ClaudeAgentSDK::SandboxSettings.new(
network: ClaudeAgentSDK::SandboxNetworkConfig.new(
allowed_domains: ['api.example.com'],
denied_domains: ['ads.example.com'], # blocked even if allowed above
allow_mach_lookup: ['com.apple.system.*'] # macOS XPC/Mach service names
)
)
)What's changed
- #36 Port Python v0.2.x quick-wins: strict_mcp_config, include_hook_events, sandbox net fields, at_exit cleanup — @ya-luotao
Full Changelog: v0.16.9...v0.16.10
gem install claude-agent-sdk -v 0.16.10