Skip to content

v0.32.0 | CC 2.1.76

Choose a tag to compare

@guess guess released this 14 Mar 22:05
· 68 commits to main since this release

Added

  • ClaudeCode.Hook.DebugLogger module — A diagnostic hook that logs every invocation with event name, tool name, and available input keys. Register it for any hook event to observe what the CLI sends. Includes ClaudeCode.Hook.DebugLogger.Permissive variant for :can_use_tool that returns :allow. ([9d75ed8])
  • Restored :can_use_tool option — Single permission callback invoked before every tool execution. Simpler alternative to PreToolUse hooks when you don't need matchers. Accepts a module implementing ClaudeCode.Hook or a 2-arity function. Mutually exclusive with :permission_prompt_tool. See the Hooks guide.
  • ClaudeCode.Hook.Output module family — Structured hook output types replacing the flat ClaudeCode.Hook.Response module. Each hook event has a dedicated output struct (ClaudeCode.Hook.Output.PreToolUse, ClaudeCode.Hook.Output.PostToolUse, etc.) with to_wire/1 for CLI serialization. Includes ClaudeCode.Hook.Output.coerce/2 for mapping shorthand returns (:ok, {:allow, opts}, {:deny, opts}, etc.) to the correct wire format.
  • ClaudeCode.Hook.PermissionDecision.Allow / ClaudeCode.Hook.PermissionDecision.Deny — Permission decision structs shared by :can_use_tool and PermissionRequest hooks.
  • mix claude_code.setup_token task — New mix task that runs claude setup-token to configure an OAuth token via an interactive browser flow. Allocates a PTY to support the CLI's terminal UI on both macOS and Linux. ([aff71ca])
  • ClaudeCode.Plugin module — Plugin management functions wrapping claude plugin CLI commands: list/1, install/2, uninstall/2, enable/2, disable/2, disable_all/1, update/2.
  • ClaudeCode.Plugin.Marketplace module — Marketplace management functions wrapping claude plugin marketplace CLI commands: list/1, add/2, remove/1, update/1.
  • ClaudeCode.Plugin.CLI module — Shared CLI execution helper for plugin and marketplace commands.

Changed

  • Breaking: hermes_mcp is now a required dependency (was optional). It was already required at compile time for ClaudeCode.MCP.Server. If your project does not use MCP features, you will now pull in hermes_mcp as a transitive dependency — no code changes are needed.
  • Breaking: Removed ClaudeCode.MCP.available?/0 and ClaudeCode.MCP.require_hermes!/0 — no longer needed with hermes_mcp required.
  • Bumped bundled CLI version to 2.1.76. ([15fdff2])

Fixed

  • MCP parameter validationClaudeCode.MCP.Router now validates tool parameters against their schema using Hermes/Peri before execution, returning JSONRPC -32602 errors for invalid input. Previously, invalid parameters were passed directly to execute/2.
  • MCP PreToolUse hooksPreToolUse hooks now apply to in-process MCP tool calls, matching the mcp__<server>__<tool> naming convention. Previously, MCP tools bypassed the hook system entirely.
  • ClaudeCode.Adapter.Port buffer overflow false positive — The buffer overflow check now runs after extracting complete lines, not before. Previously, a burst of many small complete JSON messages arriving in a single chunk could trigger a false overflow even though only the remaining incomplete buffer should count against the limit.
  • ClaudeCode.MCP.Router generic notification handling — Handle all JSONRPC 2.0 notification types (notifications/*) instead of only notifications/initialized. Previously, other notification types like notifications/cancelled would crash with a FunctionClauseError because jsonrpc_error/3 requires an "id" field that notifications don't have.
  • ClaudeCode.Test.stub/2 shared ownershipstub/2 now works correctly when the session name has a shared owner, updating the stub instead of raising. ([95524e0])