Skip to content

v0.31.0 | CC 2.1.72

Choose a tag to compare

@guess guess released this 12 Mar 00:43
· 87 commits to main since this release

Added

  • Shorthand syntax for :hooks option — Accept bare modules and 2-arity functions directly in hook lists (e.g., hooks: %{PreToolUse: [MyApp.Guard]}), removing the need for map wrappers in the common case. The full map form remains available for matchers, timeouts, and :where. See ClaudeCode.Options and the Hooks guide.

Removed

  • Breaking: Removed the :can_use_tool option. Use PreToolUse hooks instead, which provide the same permission decision capability through the standard hooks API. The CLI no longer sends can_use_tool control requests — all permission decisions are routed through hook callbacks. Migrate by moving your callback into hooks: %{PreToolUse: [your_callback]}.
  • Removed ClaudeCode.Adapter.ControlHandler.handle_can_use_tool/2
  • Removed ClaudeCode.Hook.Response.to_can_use_tool_wire/1
  • Removed can_use_tool field from the hook registry struct
  • Changed hook registry constructor from arity-2 to arity-1 (no longer accepts a can_use_tool parameter)