Skip to content

v0.36.0 | CC 2.1.76

Choose a tag to compare

@guess guess released this 29 Mar 19:12
· 22 commits to main since this release

Added

  • :inherit_env option — Controls which system environment variables are inherited by the CLI subprocess. Defaults to :all (inherit everything except CLAUDECODE, matching Python SDK behavior). Set to a list of exact strings or {:prefix, "..."} tuples for selective inheritance, or [] to inherit nothing. See Secure Deployment.

  • :env now accepts false values — Setting a key to false in the :env option 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.sleep calls across ClaudeCode.SessionTest, ClaudeCodeTest, and ClaudeCode.SupervisorTest with deterministic synchronization (MockCLI.poll_until/2, Process.monitor + assert_receive, synchronous :sys.get_state calls). Corrected two supervisor tests that assumed empty config would crash the child — api_key is now optional (defaults to ANTHROPIC_API_KEY env var), so the child starts successfully; tests now assert count == 1 to 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_executableClaudeCode.Adapter.Port now spawns the CLI binary directly via Erlang's native :spawn_executable with :args, :env, and :cd port options, replacing the previous /bin/sh -c approach that required hand-rolled shell escaping. This eliminates ClaudeCode.Adapter.Port.shell_escape/1, build_shell_command/4, and the @shell_safe_pattern module 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-dir instead of --plugin-dir /path), causing the CLI to misinterpret arguments.

  • Flaky health/1 provisioning testClaudeCode.Adapter.PortIntegrationTest now 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.