通过配置 hooks 让 Claude Code 提醒你该授权啦,活干完啦~
- ⚠️注意:
请更换为你自己的 sk, 如果还没有 token 信息。可前往 令牌管理 页面获取 - ⚠️注意:mac 用到了
terminal-notifier发送通知,需要安装一下brew install terminal-notifier - ⚠️注意:配置的通知是 mac 中的使用方式,如果使用的 windows 请自行查阅一下应该如和让
claude code发送通知。
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"env": {
"ANTHROPIC_AUTH_TOKEN": "sk-xxxx",
"ANTHROPIC_BASE_URL": "https://ai-router.plugins-world.cn",
"API_TIMEOUT_MS": "3000000",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
},
"includeCoAuthoredBy": false,
"permissions": {
"allow": [],
"deny": [],
"defaultMode": "plan"
},
"hooks": {
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "terminal-notifier -message 'Claude Code 所有任务已完成,正在休息中' -title 'Claude Code' -sound Hero"
}
]
}
],
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "terminal-notifier -message '任务完成' -title 'Claude Code' -sound Funk"
}
]
}
],
"SubagentStop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "terminal-notifier -message '任务完成' -title 'Claude Code' -sound Funk"
}
]
}
],
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [
{
"type": "command",
"command": "afplay /System/Library/Sounds/Glass.aiff"
}
]
}
]
},
"alwaysThinkingEnabled": false,
"feedbackSurveyState": {
"lastShownTime": 1754660473005
}
}
https://discuss.plugins-world.cn/post/aFAtX2yr
Claude Code