fix: tolerate object-style hook entries in config parser#3000
fix: tolerate object-style hook entries in config parser#3000justcode049 wants to merge 4 commits into
Conversation
The official Claude Code settings format uses structured hook objects
({matcher, hooks: [{type, command}]}) but the parser only accepted
plain string arrays, causing a parse error on any machine with
standard hook configuration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
This PR has merge conflicts with the latest main. Please rebase on |
…mented format
Pinpoint: claw-code expects {hooks:{PreToolUse:['cmd-string']}} while
Claude Code docs specify {hooks:{PreToolUse:[{matcher,hooks:[{type,command}]}]}}.
Users copy-pasting from Claude Code docs get the cryptic 'must be an
array of strings, got an array' error. PR #3000 already addresses
this but is conflicting and unmerged. Siblings: unknown hook event
rejects entire hooks config (#440 pattern); first-error-only halting;
kind:unknown catch-all (13th occurrence).
code-yeongyu
left a comment
There was a problem hiding this comment.
This PR has merge conflicts. Please rebase onto main and resolve conflicts.
|
Please rebase onto |
|
Applied an equivalent, focused implementation in Verification: |
Summary
field PreToolUse must contain only stringswhen the user's~/.claude/settings.jsoncontained the official Claude Code hook format (structured objects withmatcher,hooks: [{type, command}])optional_string_arraynow gracefully handles both plain string arrays and object-style hook entries, extractingcommandstrings from the latterTest plan
config_report_supports_section_views,config_report_uses_sectioned_layout,status_context_reads_real_workspace_metadata) now passcargo build --workspacesucceeds🤖 Generated with Claude Code