在 C:\Users\xx\.claude\settings.json 中
api key 这些已经配在环境变量中
Groovy
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -ExecutionPolicy Bypass -Command 'Add-Type -AssemblyName System.Windows.Forms; $notify = New-Object System.Windows.Forms.NotifyIcon; $notify.Icon = [System.Drawing.SystemIcons]::Information; $notify.Visible = $true; $notify.ShowBalloonTip(5000, \"Claude Code\", \"Claude Code 任务完成\", [System.Windows.Forms.ToolTipIcon]::Info); Start-Sleep -Milliseconds 5500; $notify.Dispose()'"
}
]
}
],
"Notification": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -ExecutionPolicy Bypass -Command 'Add-Type -AssemblyName System.Windows.Forms; $notify = New-Object System.Windows.Forms.NotifyIcon; $notify.Icon = [System.Drawing.SystemIcons]::Warning; $notify.Visible = $true; $notify.ShowBalloonTip(5000, \"Claude Code\", \"Claude Code 需要您的关注\", [System.Windows.Forms.ToolTipIcon]::Warning); Start-Sleep -Milliseconds 5500; $notify.Dispose()'"
}
]
}
]
},
"permissions": {
"autoApprove": {
"read": true,
"create": true,
"commands": [
"ohpm",
"npm",
"npm test",
"ls*",
"ohpm install"
]
}
}
}