{"record":{"id":"086c3a1b4a74476b","repo":"eyaltoledano/claude-task-master","slug":"warning-invalid-claude-code-settings-in-config","errorCode":null,"errorMessage":"Warning: Invalid Claude Code settings in config: ${error.message}. Falling back to default.","messagePattern":"Warning: Invalid Claude Code settings in config: (.+?)\\. Falling back to default\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"scripts/modules/config-manager.js","lineNumber":406,"sourceCode":"\tconst CommandSpecificSchema = z\n\t\t.record(z.string(), BaseSettingsSchema)\n\t\t.refine(\n\t\t\t(obj) =>\n\t\t\t\tObject.keys(obj || {}).every((k) => AI_COMMAND_NAMES.includes(k)),\n\t\t\t{ message: 'Invalid command name in commandSpecific' }\n\t\t);\n\n\t// Define the full settings schema with commandSpecific\n\tconst SettingsSchema = BaseSettingsSchema.extend({\n\t\tcommandSpecific: CommandSpecificSchema.optional()\n\t});\n\n\tlet validatedSettings = {};\n\n\ttry {\n\t\tvalidatedSettings = SettingsSchema.parse(settings);\n\t} catch (error) {\n\t\tconsole.warn(\n\t\t\tchalk.yellow(\n\t\t\t\t`Warning: Invalid Claude Code settings in config: ${error.message}. Falling back to default.`\n\t\t\t)\n\t\t);\n\n\t\tvalidatedSettings = {};\n\t}\n\n\treturn validatedSettings;\n}\n\n/**\n * Validates Codex CLI provider custom settings\n * Mirrors the ai-sdk-provider-codex-cli options\n * @param {object} settings The settings to validate\n * @returns {object} The validated settings\n */\nfunction validateCodexCliSettings(settings) {","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/config-manager.js#L388-L424","documentation":"ConfigManager.validateClaudeCodeSettings parses the claudeCodeSettings section of .taskmasterconfig with SettingsSchema (Zod). On schema validation failure it warns with the Zod error message and falls back to an empty/default settings object instead of throwing.","triggerScenarios":"Calling _loadAndValidateConfig (or validateClaudeCodeSettings directly) when the claudeCodeSettings object in .taskmasterconfig contains fields of wrong types, unknown keys, or malformed nested values.","commonSituations":"Hand-editing .taskmasterconfig and mistyping a setting; schema changes after upgrading task-master making old keys invalid; copying config snippets from docs of a different version.","solutions":["Read the Zod error in the message and correct the offending field in .taskmasterconfig","Compare your claudeCodeSettings against the SettingsSchema for your installed version","Remove the invalid section to accept defaults, then re-add settings incrementally","Run `task-master models --setup` or equivalent to regenerate a valid config"],"exampleFix":"// before (.taskmasterconfig)\n\"claudeCodeSettings\": { \"permissions\": \"allow-all\" }\n// after\n\"claudeCodeSettings\": { \"permissions\": { \"allow\": [\"Bash\"] } }","handlingStrategy":"validation","validationCode":"import { z } from 'zod';\n// reuse the library's schema before writing config\nconst parsed = SettingsSchema.safeParse(config.claudeCodeSettings);\nif (!parsed.success) {\n  console.error('Invalid claudeCodeSettings:', parsed.error.issues.map(i => i.path.join('.')));\n}","typeGuard":"function claudeSettingsAreValid(settings) {\n  return SettingsSchema.safeParse(settings).success;\n}","tryCatchPattern":"const config = configManager._loadAndValidateConfig();\nconst claude = config.claudeCodeSettings ?? {};\nif (Object.keys(claude).length === 0) {\n  console.warn('claudeCodeSettings failed validation and defaults were applied');\n}","preventionTips":["Validate .taskmasterconfig with a JSON schema editor before saving","Re-check settings after upgrading task-master (schemas can change)","Add settings incrementally, re-running the command after each change","Keep config under version control to diff against known-good versions"],"tags":["config","schema-validation","zod","claude"],"backgroundTag":"schema-validation-failed","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}