eyaltoledano/claude-task-master · warning
Warning: Invalid Claude Code settings in config: ${error.mes
Error message
Warning: Invalid Claude Code settings in config: ${error.message}. Falling back to default. What it means
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.
Source
Thrown at scripts/modules/config-manager.js:406
const CommandSpecificSchema = z
.record(z.string(), BaseSettingsSchema)
.refine(
(obj) =>
Object.keys(obj || {}).every((k) => AI_COMMAND_NAMES.includes(k)),
{ message: 'Invalid command name in commandSpecific' }
);
// Define the full settings schema with commandSpecific
const SettingsSchema = BaseSettingsSchema.extend({
commandSpecific: CommandSpecificSchema.optional()
});
let validatedSettings = {};
try {
validatedSettings = SettingsSchema.parse(settings);
} catch (error) {
console.warn(
chalk.yellow(
`Warning: Invalid Claude Code settings in config: ${error.message}. Falling back to default.`
)
);
validatedSettings = {};
}
return validatedSettings;
}
/**
* Validates Codex CLI provider custom settings
* Mirrors the ai-sdk-provider-codex-cli options
* @param {object} settings The settings to validate
* @returns {object} The validated settings
*/
function validateCodexCliSettings(settings) {View on GitHub (pinned to c0c98d367c)
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
Example fix
// before (.taskmasterconfig)
"claudeCodeSettings": { "permissions": "allow-all" }
// after
"claudeCodeSettings": { "permissions": { "allow": ["Bash"] } } Defensive patterns
Strategy: validation
Validate before calling
import { z } from 'zod';
// reuse the library's schema before writing config
const parsed = SettingsSchema.safeParse(config.claudeCodeSettings);
if (!parsed.success) {
console.error('Invalid claudeCodeSettings:', parsed.error.issues.map(i => i.path.join('.')));
} Type guard
function claudeSettingsAreValid(settings) {
return SettingsSchema.safeParse(settings).success;
} Try / catch
const config = configManager._loadAndValidateConfig();
const claude = config.claudeCodeSettings ?? {};
if (Object.keys(claude).length === 0) {
console.warn('claudeCodeSettings failed validation and defaults were applied');
} Prevention
- 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
When it happens
Trigger: Calling _loadAndValidateConfig (or validateClaudeCodeSettings directly) when the claudeCodeSettings object in .taskmasterconfig contains fields of wrong types, unknown keys, or malformed nested values.
Common situations: 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.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- Warning: Invalid Codex CLI settings in config: ${error.messa
- projectRoot is required in args to resolve project paths
- CONFIG_ERROR
- MISSING_CONFIGURATION
- CONFIG_ERROR
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/086c3a1b4a74476b.
Report an issue: GitHub.