Skip to content

v0.16.10

Choose a tag to compare

@ya-luotao ya-luotao released this 04 Jun 05:58
· 673 commits to main since this release

Added

  • ClaudeAgentOptions#strict_mcp_config (--strict-mcp-config) — when true, the CLI uses only the MCP servers passed via mcp_servers, ignoring project .mcp.json, user/global settings, and plugin-provided servers, for a fully deterministic server set. Defaults to false. (Parity with Python SDK #915)
  • ClaudeAgentOptions#include_hook_events (--include-hook-events) — when true, the CLI emits hook lifecycle events into the message stream, parsed as HookStartedMessage / HookProgressMessage / HookResponseMessage. Defaults to false. (Parity with Python SDK #917)
  • SandboxNetworkConfig#denied_domains (deniedDomains) and #allow_mach_lookup (allowMachLookup) — complete the sandbox network field set. denied_domains blocks domains even when matched by allowed_domains; allow_mach_lookup is a macOS-only list of XPC/Mach service names to allow (supports a trailing wildcard). (Completes Python SDK #893)
  • Orphaned-subprocess cleanup — SubprocessCLITransport tracks live CLI subprocesses and registers an at_exit handler that sends SIGTERM to any still running when the parent Ruby process exits, preventing leaked claude processes 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