Background
Claude Code v2.1.71 tightened validation on ~/.claude/settings.json hook entries.
The matcher field now must be a string (glob/regex pattern or empty string "").
The new documented format is:
{
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [{ "type": "command", "command": "agentlog hook" }]
}
]
}
Hooks with matcher set to an object (old format used by some tools) now produce validation errors like:
Invalid Settings
~/.claude/settings.json
└ hooks
├ PostToolUse
│ └ 0
│ └ matcher: Expected string, but received object
└ PreToolUse
├ 0
│ └ matcher: Expected string, but received object
Hooks use a new format with matchers. Example:
{"PostToolUse": [{"matcher": {"tools": ["BashTool"]}, ...}]}
Learn more: https://code.claude.com/docs/en/hooks
Agentlog Status
agentlog's HOOK_ENTRY (src/claude-settings.ts) currently registers:
export const HOOK_ENTRY = {
matcher: "", // ✅ empty string — likely valid
hooks: [
{ type: "command", command: "agentlog hook" },
],
};
matcher: "" is an empty string, which should satisfy the new validation. However, this needs verification against the latest Claude Code release.
Tasks
Reference
/cc Affects agentlog init, agentlog uninstall, and the doctor subcommand.
Background
Claude Code v2.1.71 tightened validation on
~/.claude/settings.jsonhook entries.The
matcherfield now must be a string (glob/regex pattern or empty string"").The new documented format is:
{ "UserPromptSubmit": [ { "matcher": "", "hooks": [{ "type": "command", "command": "agentlog hook" }] } ] }Hooks with
matcherset to an object (old format used by some tools) now produce validation errors like:Agentlog Status
agentlog's
HOOK_ENTRY(src/claude-settings.ts) currently registers:matcher: ""is an empty string, which should satisfy the new validation. However, this needs verification against the latest Claude Code release.Tasks
matcher: ""is accepted by Claude Code 2.1.71+ (runclaude doctorafteragentlog init)HOOK_ENTRYto match the new required formatagentlog doctorcheck that validates the registered hook passes Claude Code's built-in settings validationReference
claude --versionorclaude doctorto confirm)/cc Affects
agentlog init,agentlog uninstall, and thedoctorsubcommand.