-
Notifications
You must be signed in to change notification settings - Fork 299
Description
System Info / 系統信息
Environment
Platform: z.ai API (not Anthropic API)
Claude Code Version: v1.0.120
Operating System: Windows
Who can help? / 谁可以帮助到您?
No response
Information / 问题信息
- The official example scripts / 官方的示例脚本
- My own modified scripts / 我自己修改的脚本和任务
Reproduction / 复现过程
1.export ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic
export ANTHROPIC_AUTH_TOKEN=your_zai_api_token_here
2.Create settings.json with hooks
Create ~/.claude/settings.json with valid hook configuration:
{
"hooks": [
{
"matcher": "Edit|Write",
"hooks": [
{
"type": "command",
"command": "echo 'File modified'"
}
]
}
]
}
3.claude /status
⚠ Found invalid settings files: .claude\settings.json. They will be ignored.
Expected behavior / 期待表现
Bug Description
When using Claude Code with z.ai API instead of Anthropic's official API, the settings validation system incorrectly flags valid settings.json files as invalid, causing them to be ignored. This affects both hook configurations and environment variables.
Current Behavior
With z.ai + hooks configuration:
bashclaude /status
Results in:
⚠ Found invalid settings files: .claude\settings.json. They will be ignored.
With z.ai + minimal env configuration:
Even with just basic environment configuration:
json{
"env": {
"ANTHROPIC_MODEL": "glm-4.5"
}
}
Still produces the same validation error.
Workaround that "works":
Empty settings.json file: No validation errors, but hooks don't work
With Anthropic API: Same settings file works perfectly