v0.36.0 | CC 2.1.76
Added
-
:inherit_envoption — Controls which system environment variables are inherited by the CLI subprocess. Defaults to:all(inherit everything exceptCLAUDECODE, matching Python SDK behavior). Set to a list of exact strings or{:prefix, "..."}tuples for selective inheritance, or[]to inherit nothing. See Secure Deployment. -
:envnow acceptsfalsevalues — Setting a key tofalsein the:envoption unsets that variable in the CLI subprocess, leveraging Erlang Port's native env unsetting. Useful for removing sensitive inherited vars:env: %{"RELEASE_COOKIE" => false}.
Fixed
- Hardened timing-sensitive tests — Replaced
Process.sleepcalls acrossClaudeCode.SessionTest,ClaudeCodeTest, andClaudeCode.SupervisorTestwith deterministic synchronization (MockCLI.poll_until/2,Process.monitor+assert_receive, synchronous:sys.get_statecalls). Corrected two supervisor tests that assumed empty config would crash the child —api_keyis now optional (defaults toANTHROPIC_API_KEYenv var), so the child starts successfully; tests now assertcount == 1to reflect current behavior.
Changed
-
MCP tool DSL — Tool descriptions moved from a positional argument into the block. This is a breaking change. ([44573a7])
# Before tool :add, "Add two numbers" do ... end # After tool :add do description "Add two numbers" ... end
-
Port spawning refactored to direct
spawn_executable—ClaudeCode.Adapter.Portnow spawns the CLI binary directly via Erlang's native:spawn_executablewith:args,:env, and:cdport options, replacing the previous/bin/sh -capproach that required hand-rolled shell escaping. This eliminatesClaudeCode.Adapter.Port.shell_escape/1,build_shell_command/4, and the@shell_safe_patternmodule attribute entirely. Environment variables, arguments, and paths with special characters (e.g.!,#,<,>,[,]) are now handled natively by the Erlang runtime without shell interpretation.
Fixed
-
CLI arg ordering for
:plugins,:add_dir, and:file— Flag/value pairs were reversed (e.g.,/path --plugin-dirinstead of--plugin-dir /path), causing the CLI to misinterpret arguments. -
Flaky
health/1provisioning test —ClaudeCode.Adapter.PortIntegrationTestnow accepts both{:unhealthy, :provisioning}and{:unhealthy, :not_connected}during startup, fixing a race condition where fast CI runners could resolve the CLI before the assertion.