帖子

通过配置 hooks 让 Claude Code 提醒你该授权啦,活干完啦~

⚠️注意:请更换为你自己的 sk, 如果还没有 token 信息。可前往 令牌管理 页面获取

{
  "$schema": "https://json.schemastore.org/claude-code-settings.json",
  "alwaysThinkingEnabled": true,
  "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
  },
  "feedbackSurveyState": {
    "lastShownTime": 1754660473005
  },
  "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"
          }
        ]
      }
    ],
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "afplay /System/Library/Sounds/Glass.aiff"
          }
        ]
      }
    ]
  },
  "includeCoAuthoredBy": false,
  "permissions": {
    "allow": [],
    "defaultMode": "plan",
    "deny": []
  }
}
https://discuss.plugins-world.cn/post/aFAtX2yr

未登录无法操作

登录 注册

评论 1

今天在测试的时候发现,似乎 claude code 更新后,~/.claude/settings.json 中的 env 配置不再生效。需要使用 export 的方式才有用。不知道是不是个例问题。有点奇怪🤔

https://discuss.plugins-world.cn/comment/qI8R3h4U
上滑加载更多