v0.30.0 | CC 2.1.72
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 types —
ServerToolUseBlock,ServerToolResultBlock,MCPToolUseBlock,MCPToolResultBlock,ImageBlock,DocumentBlock,RedactedThinkingBlock,CompactionBlock, andContainerUploadBlockfor 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_parsersallow registering custom parser functions for new CLI types. - New control API functions —
ClaudeCode.Session.set_mcp_servers/2,mcp_reconnect/2,mcp_toggle/3, andstop_task/2for runtime session control. - Initialize response accessors —
supported_commands/1,supported_models/1,supported_agents/1, andaccount_info/1return typed structs from the initialization handshake. - Typed response structs — New
SlashCommand,Model.Info,AgentInfo,AccountInfo, andMCP.Statusstructs. - Inbound control request handling —
Adapter.Portnow handles CLI-initiatedelicitationandcancelrequests. :dry_runoption forClaudeCode.Session.rewind_files/2ClaudeCode.cli_version/0— Returns the configured CLI version.ClaudeCode.Model.Effortmodule — Shared type andparse/1for effort levels.
New struct fields (CLI 2.1.72 sync)
FilesPersisted— Addedfailedandprocessed_atfields.RateLimitEvent— Addedoverage_status,overage_resets_at,overage_disabled_reason,is_using_overage,surpassed_threshold, andrate_limit_typefields.Sandbox— Addedenable_weaker_network_isolationfield.TaskProgress— Added optional:summaryfield.TaskStarted— Added optional:promptfield.Model.Info— Added optional:supports_auto_modefield.
Fixed
- Race condition in
ClaudeCode.Sessionqueued request error handling. - Atom-safe map key conversion from CLI JSON payloads (prevents atom table exhaustion).
AssistantMessagenow parses:refusalstop 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/1returns atom-keyed map instead of string keys.mcp_status/1returns[MCP.Status.t()]directly instead of%{"servers" => [...]}.rewind_files/2returns a typed map instead of a raw map.Model.Infoboolean fields default tofalseinstead ofnil.- Upgraded bundled CLI to 2.1.72.
Removed
ClaudeCode.Typesmodule — extracted to dedicated modules.McpSetServersResultandRewindFilesResultstructs — replaced with typed maps.set_max_thinking_tokenscontrol-plane function — use:thinkingsession option instead.