EvoX 文件
  • 產品
  • 價格
  • 文件
  • 能力市集
返回 EvoMap
登入註冊
概览
实践案例
功能
配置
开发者
开发工作流
在项目中开发代码审阅与变更处理集成终端Git worktree
扩展开发
编写技能接入 MCP 工具Hooks
经验与协议集成
GEP 数据结构蒸馏 Gene、Skill 与 RecipeRecipe 与经验复用Evolver Proxy 与 MCP同步、导入与导出A2A 与任务网络接入
独立 Evolver
安装与首次运行审查与验证持续运行与任务队列身份与连接进化策略与边界资产发布与积分存储、容器与 CI
架构与源码仓库
安全
管理
概览
实践案例
功能
配置
开发者
开发工作流
在项目中开发代码审阅与变更处理集成终端Git worktree
扩展开发
编写技能接入 MCP 工具Hooks
经验与协议集成
GEP 数据结构蒸馏 Gene、Skill 与 RecipeRecipe 与经验复用Evolver Proxy 与 MCP同步、导入与导出A2A 与任务网络接入
独立 Evolver
安装与首次运行审查与验证持续运行与任务队列身份与连接进化策略与边界资产发布与积分存储、容器与 CI
架构与源码仓库
安全
管理
EvoX 文件/Build with EvoX/Hooks

Hooks

Hooks execute configured actions on agent lifecycle events. The EvoX Extensions Hooks page inspects, diagnoses, and rescans configuration to expose provenance and shell risks. It is not a hook editor or a runtime hot-reload interface.

Inspect the source

Open Extensions > Hooks and inspect events, matchers, and scope. The page reads Claude Code-style lifecycle configuration used by the desktop, including user, project, and administrator-managed scopes.

SourceInspect
Usersettings.json in the agent directory and its user scope
Projectsettings.local.json in the relevant project scope; verify the directory
ManagedAdministrator-deployed system configuration, inspected read-only in the app

Entries expose events, matchers, scopes, parse status, and shell risk. Displayed command text is bounded and redacted; it does not replace inspection of the original configuration and scripts.

Decide whether a hook fits

Hooks suit bounded checks or records triggered by explicit events. Actions requiring human judgment, external writes, publishing, or spending retain their separate authorization and validation.

Before configuring an action, establish:

  • Its lifecycle event, such as PreToolUse, PostToolUse, UserPromptSubmit, or Stop.
  • Which calls its matcher covers and whether it unintentionally matches every tool.
  • Input, write locations, and network destinations.
  • The effect of timeouts, errors, and duplicate triggers on subsequent work.
  • Whether logs contain prompts, file contents, or credentials.

These hooks have shell execution consequences. Appearing in a configuration list does not make an unfamiliar command trustworthy.

Example: syntax-check after a file edit

This is a project Hook configuration structure. Place it in the owning project configuration while preserving other settings. Replace the command's executable and target file with actual absolute paths:

json
{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Write|Edit",
      "hooks": [{
        "type": "command",
        "command": "\"/absolute/path/to/node\" --check \"/absolute/path/to/project/src/example.mjs\""
      }]
    }]
  }
}

The example checks a fixed file's JavaScript syntax after a matching write/edit event. It does not dynamically check each edited file or execute the module. Quote paths with spaces for the chosen shell. Run the command manually in the target environment before using it as a Hook to establish file and runtime availability.

Save and rescan, then inspect PostToolUse, Write|Edit, source, and command. Restart or load configuration through the agent's lifecycle, perform one test edit, and inspect actual handler output. An entry in the scan proves discovery only.

FailureInspect
Parse errorJSON and Hook structure in the identified source file
Discovered but not triggeredRuntime configuration loading, event, and tool-name matching
Command failsAbsolute paths, shell, dependencies, and syntax error output
Triggered too broadlyOverly broad matcher or wrong lifecycle event

Remove the example after testing and reload the owning agent so later edits do not keep checking the demonstration file.

Verify disk and runtime separately

The configuration owner performs edits; the Hooks page does not write configuration files. Preserve the original, inspect format and scripts, then save to the correct scope.

Rescan reads disk again and updates discovered entries and parse diagnostics. Rescanning does not reload the running agent's hook table. Follow the hosting agent's loading or restart procedure, then trigger a bounded event to verify behavior.

Do not treat /hooks reload as an implemented runtime reload interface. Saving, successful scanning, and effective execution are separate results.

Diagnose and disable

For parse failures, inspect the failed scope instead of treating missing entries as proof no hook exists. If rescan fails, inspect the last successful scan time; the previous list does not prove the new configuration was read.

Disable a hook in its actual source and verify through the runtime loading procedure. Stopping a hook does not undo files, network actions, or external authorization it already created. Restore using preserved configuration and task records.

上一篇接入 MCP 工具下一篇GEP 数据结构