Skip to content

v0.30.0 | CC 2.1.72

Choose a tag to compare

@guess guess released this 11 Mar 04:23
· 94 commits to main since this release

Breaking release — This release reorganizes the public API and module structure for long-term clarity. See the Changed section for a migration summary.

Added

New features

  • 9 new content block typesServerToolUseBlock, ServerToolResultBlock, MCPToolUseBlock, MCPToolResultBlock, ImageBlock, DocumentBlock, RedactedThinkingBlock, CompactionBlock, and ContainerUploadBlock for parsing all CLI content types.
  • Forward-compatible message parsing — Unknown content block types and message types are now preserved as maps instead of being silently dropped.
  • Extensible parser registries — Application config options :content_parsers, :message_parsers, and :system_parsers allow registering custom parser functions for new CLI types.
  • New control API functionsClaudeCode.Session.set_mcp_servers/2, mcp_reconnect/2, mcp_toggle/3, and stop_task/2 for runtime session control.
  • Initialize response accessorssupported_commands/1, supported_models/1, supported_agents/1, and account_info/1 return typed structs from the initialization handshake.
  • Typed response structs — New SlashCommand, Model.Info, AgentInfo, AccountInfo, and MCP.Status structs.
  • Inbound control request handlingAdapter.Port now handles CLI-initiated elicitation and cancel requests.
  • :dry_run option for ClaudeCode.Session.rewind_files/2
  • ClaudeCode.cli_version/0 — Returns the configured CLI version.
  • ClaudeCode.Model.Effort module — Shared type and parse/1 for effort levels.

New struct fields (CLI 2.1.72 sync)

  • FilesPersisted — Added failed and processed_at fields.
  • RateLimitEvent — Added overage_status, overage_resets_at, overage_disabled_reason, is_using_overage, surpassed_threshold, and rate_limit_type fields.
  • Sandbox — Added enable_weaker_network_isolation field.
  • TaskProgress — Added optional :summary field.
  • TaskStarted — Added optional :prompt field.
  • Model.Info — Added optional :supports_auto_mode field.

Fixed

  • Race condition in ClaudeCode.Session queued request error handling.
  • Atom-safe map key conversion from CLI JSON payloads (prevents atom table exhaustion).
  • AssistantMessage now parses :refusal stop reason.
  • Streaming docs/examples corrected for partial-message behavior.

Changed

API restructure and module reorganization

The top-level ClaudeCode module is now slimmed to 4 core functions: start_link/1, stream/3, query/2, stop/1. All session management, runtime configuration, MCP management, and introspection functions moved to ClaudeCode.Session.

Module moves (old → new):

Old location New location
ClaudeCode.get_session_id/1 ClaudeCode.Session.session_id/1
ClaudeCode.get_mcp_status/1 ClaudeCode.Session.mcp_status/1
ClaudeCode.get_server_info/1 ClaudeCode.Session.server_info/1
ClaudeCode.Types Extracted to Session.PermissionMode, Session.PermissionDenial, Model.Usage, Usage
ClaudeCode.StopReason Inlined into ClaudeCode.Message
ClaudeCode.PermissionMode ClaudeCode.Session.PermissionMode
ClaudeCode.PermissionDenial ClaudeCode.Session.PermissionDenial
ClaudeCode.AccountInfo ClaudeCode.Session.AccountInfo
ClaudeCode.AgentInfo ClaudeCode.Session.AgentInfo
ClaudeCode.SlashCommand ClaudeCode.Session.SlashCommand
ClaudeCode.McpServerStatus ClaudeCode.MCP.Status
System message subtypes ClaudeCode.Message.SystemMessage.* namespace

Other changes

  • server_info/1 returns atom-keyed map instead of string keys.
  • mcp_status/1 returns [MCP.Status.t()] directly instead of %{"servers" => [...]}.
  • rewind_files/2 returns a typed map instead of a raw map.
  • Model.Info boolean fields default to false instead of nil.
  • Upgraded bundled CLI to 2.1.72.

Removed

  • ClaudeCode.Types module — extracted to dedicated modules.
  • McpSetServersResult and RewindFilesResult structs — replaced with typed maps.
  • set_max_thinking_tokens control-plane function — use :thinking session option instead.