Source: https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-ai-agents/
Language: zh-CN

# 如何在 Mac 上卸载 AI 编程工具中的 Hook（总览指南）

完整指南：在 macOS 上检查、区分并一键卸载 Codex、Claude Code、Cursor、Gemini CLI、Windsurf、Copilot 等 110+ 款 AI 工具中的隐藏 Hook。

AI Agent bar · 更新日期 2026年11月19日

许多运行在 Mac 上的 AI 编程工具支持在后台加载 **Hook**，这些规则分布在用户主目录隐藏文件夹、项目仓库以及系统策略目录中，通常不会显示在对话窗口里。

## AI 编程工具中的 Hook 分为两类

Hook 会在发送提示词、调用终端命令、读写文件等事件发生时触发外部脚本，常见来源包括：

1.  **个人配置（Self Configured）**：你自己添加的工作流脚本，例如代码格式化工具或任务结束提醒。
2.  **管理员安装（Admin Installed）**：企业终端管理或安全合规软件写入受保护系统目录的规则，常用于记录提问内容、命令历史或访问路径。

![在 AI Agent bar 菜单栏总览所有 AI 工具的 Hook](<https://aiagentbar.com/optimized/panel-native-overview-720.webp>)

## 主流 AI 工具的 Hook 配置路径对照表

| AI 工具 | 常见个人配置路径 | AI Agent bar 一键卸载支持 |
| --- | --- | --- |
| [OpenAI Codex](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-codex/>) | `~/.codex/hooks.json` | 支持（个人配置与管理员安装） |
| [Claude Code](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-claude/>) | `~/.claude/settings.json` | 支持（个人配置与管理员安装） |
| [Cursor](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-cursor/>) | `~/.cursor/hooks.json` | 支持（个人配置与管理员安装） |
| [Gemini CLI](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-gemini-cli/>) | `~/.gemini/settings.json` | 支持（个人配置与管理员安装） |
| [Windsurf](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-windsurf/>) | `~/.codeium/windsurf/hooks.json` | 支持（个人配置与管理员安装） |
| [GitHub Copilot CLI](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-copilot/>) | `.github/hooks/*.json` · `~/.copilot/` | 支持（个人配置与管理员安装） |
| [Google Antigravity](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-antigravity/>) | `~/.gemini/antigravity/` | 支持（个人配置与管理员安装） |
| [Devin](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-devin/>) | `~/.devin/` | 支持（个人配置与管理员安装） |

此外，**AI Agent bar** 还能自动发现 Mac 上超过 **110 款本地 AI 工具**（包括 Cline、Kiro、OpenCode、Roo Code、Continue、Aider、Goose、Zed、Warp、JetBrains AI 等）。

## 为什么直接“强制卸载”比手动修改更可靠

*   **配置分散多层**：同一款 AI 工具往往同时读取项目目录、用户主目录及 `/Library/Application Support/`、`/etc/` 下的多层配置，容易漏查。
*   **容易改坏格式**：JSON 或 TOML 文件一旦出现语法错误，会导致 AI 工具启动异常。
*   **后台静默写回**：企业后台管理服务常会监控系统目录中的配置，手动删除后几秒内便会自动还原。

下载 [Mac 版 AI Agent bar](<https://aiagentbar.com/releases/1.0.25/AIagentbar-macOS-arm64.pkg>)，或查看 [价格方案](<https://aiagentbar.com/zh-CN/#pricing>) 与 [本地 CLI 文档](<https://aiagentbar.com/zh-CN/cli/>)。

## 继续阅读

*   [如何在 Mac 上卸载 OpenAI Codex 中的 Hook](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-codex/>)
*   [如何在 Mac 上卸载 Claude Code 中的 Hook](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-claude/>)
*   [如何在 Mac 上卸载 Cursor 中的 Hook](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-cursor/>)
*   [如何在 Mac 上卸载 Gemini CLI 中的 Hook](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-gemini-cli/>)
*   [如何在 Mac 上卸载 Windsurf 中的 Hook](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-windsurf/>)
*   [如何在 Mac 上卸载 GitHub Copilot CLI 中的 Hook](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-copilot/>)
*   [如何在 Mac 上查看并移除 Google Antigravity 中的 Hook](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-antigravity/>)
*   [如何在 Mac 上卸载 Devin 中的 Hook](<https://aiagentbar.com/zh-CN/guides/how-to-uninstall-hooks-in-devin/>)
*   [AI Agent bar 工作原理](<https://aiagentbar.com/zh-CN/how-it-works/>)
*   [在 Mac 上安装与激活 AI Agent bar](<https://aiagentbar.com/zh-CN/install/>)
*   [AI Agent bar 本地命令行工具（CLI）](<https://aiagentbar.com/zh-CN/cli/>)
*   [版本发布与校验和验证](<https://aiagentbar.com/zh-CN/releases/>)
*   [关于 AI Agent bar](<https://aiagentbar.com/zh-CN/about/>)
