{"record":{"id":"17a57874de065e88","repo":"Kuberwastaken/claurst","slug":"unsupported-hooks-event-name","errorCode":null,"errorMessage":"unsupported hooks event: {name}","messagePattern":"unsupported hooks event: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src-rust/crates/core/src/import_config.rs","lineNumber":759,"sourceCode":"                    tool_filter: if matcher == \"*\" { None } else { Some(matcher.clone()) },\n                    blocking: false,\n                });\n            }\n        }\n        out.insert(event, hook_entries);\n    }\n    Ok(out)\n}\n\nfn parse_hook_event(name: &str) -> Result<HookEvent> {\n    match name {\n        \"PreToolUse\" => Ok(HookEvent::PreToolUse),\n        \"PostToolUse\" => Ok(HookEvent::PostToolUse),\n        \"Stop\" => Ok(HookEvent::Stop),\n        \"PostModelTurn\" => Ok(HookEvent::PostModelTurn),\n        \"UserPromptSubmit\" => Ok(HookEvent::UserPromptSubmit),\n        \"Notification\" => Ok(HookEvent::Notification),\n        _ => Err(anyhow!(\"unsupported hooks event: {name}\")),\n    }\n}\n\nfn skip_reason_for_key(key: &str) -> &'static str {\n    match key {\n        \"env\" => \"contains sensitive environment variables and is not imported automatically\",\n        \"ANTHROPIC_AUTH_TOKEN\" | \"apiKey\" | \"providers\" => \"auth and provider credentials are not migrated automatically\",\n        \"enabledPlugins\" => \"plugin config structure differs from the current program\",\n        \"disabledMcpServers\" => \"the current program has no matching field\",\n        \"extraKnownMarketplaces\" => \"the current program has no matching field\",\n        \"skipAutoPermissionPrompt\" => \"the current program has no matching field\",\n        \"autoDreamEnabled\" => \"the current program has no matching field\",\n        \"codemossProviderId\" => \"the current program has no matching field\",\n        \"effortLevel\" => \"the current program has no stable persistence mapping\",\n        _ => \"the current program does not support this field\",\n    }\n}\n","sourceCodeStart":741,"sourceCodeEnd":777,"githubUrl":"https://github.com/Kuberwastaken/claurst/blob/b0637c97ec34144387cbf2f74f65df6d16a6cef1/src-rust/crates/core/src/import_config.rs#L741-L777","documentation":"parse_hook_event maps hook event key names to HookEvent variants and only accepts the known set: PreToolUse, PostToolUse, Stop, PostModelTurn, UserPromptSubmit, Notification. Any other key inside the hooks object produces this error and the import aborts.","triggerScenarios":"Importing hooks keyed by an event name outside the supported set, e.g. \"SessionStart\", \"SubagentStop\", \"PreCompact\", or lowercase/case-mismatched names like \"pretooluse\".","commonSituations":"Config written for a newer version of Claude Code with additional hook events, custom event names, or typos/case errors in event keys.","solutions":["Rename the unsupported event key to one of the supported events (PreToolUse, PostToolUse, Stop, PostModelTurn, UserPromptSubmit, Notification)","Remove the unsupported event entry before importing (or downgrade the source config to supported events)","Fix casing — event names are matched exactly and are case-sensitive"],"exampleFix":"// before\n{ \"hooks\": { \"SubagentStop\": [ { \"hooks\": [ { \"command\": \"cleanup.sh\" } ] } ] } }\n// after\n{ \"hooks\": { \"Stop\": [ { \"hooks\": [ { \"command\": \"cleanup.sh\" } ] } ] } }","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['PreToolUse','PostToolUse','Stop','PostModelTurn','UserPromptSubmit','Notification'];\nfor (const ev of Object.keys(cfg.hooks ?? {})) if (!SUPPORTED.includes(ev)) throw new Error(`unsupported hooks event: ${ev}`);","typeGuard":"const isSupportedEvent = (ev) => ['PreToolUse','PostToolUse','Stop','PostModelTurn','UserPromptSubmit','Notification'].includes(ev);","tryCatchPattern":"try { importConfig(path) } catch (e) { const m = String(e).match(/unsupported hooks event: (\\S+)/); if (m) { dropOrRemapEvent(path, m[1]); } else { throw e; } }","preventionTips":["Only use the six supported event names, spelled exactly (case-sensitive)","Map newer Claude Code events (SessionStart, SubagentStop, PreCompact) to supported ones or drop them before import","Check event names against the importer's supported list after tool version upgrades"],"tags":["hooks","config-import","enum","unsupported"],"backgroundTag":"unsupported-enum-value","analyzedSha":"b0637c97ec34144387cbf2f74f65df6d16a6cef1","analyzedAt":"2026-09-10T00:24:58.650Z","contentChangedAt":"2026-09-10T00:24:58.650Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}