Skip to main content
Extensions

Hooks

Run automated handlers at Qoder CN task lifecycle events.

Qoder CN uses Hooks compatible with Qoder CN CLI. They can run deterministic checks or actions for task, tool, permission, subagent, context, configuration, file, and worktree events. Qoder CN supports the same event and handler types as the CLI.
Hooks can access local files or external services. Review commands, service addresses, and configuration sources before running a task.

View current configuration

Go to Settings → Hooks. The page reads the user-level ~/.qoder/settings.json file and groups configured Hooks by event. It reflects configuration on disk; a visible entry does not prove that the Runtime loaded or successfully executed it. Projects can also use:
  • ${project}/.qoder/settings.json for shared project configuration.
  • ${project}/.qoder/settings.local.json for project configuration used only on the current device.
Hooks from all sources are merged.

Handler types

TypeUse
commandRun a local command or script.
httpSend the event to an HTTP service.
promptUse a prompt to decide whether execution can continue.
agentAsk an Agent to process the event and return a result.

Supported events

EventTrigger
SessionStart / SessionEndA task starts / ends
UserPromptSubmitThe user submits an instruction
PreToolUseBefore a tool runs
PostToolUse / PostToolUseFailureAfter a tool succeeds / fails
PermissionRequest / PermissionDeniedPermission is requested / denied
Stop / StopFailureBefore the Agent stops / stop fails
SubagentStart / SubagentStopA subagent starts / stops
PreCompact / PostCompactBefore / after context compaction
NotificationA notification is produced
InstructionsLoadedInstructions are loaded
ConfigChangeConfiguration changes
CwdChangedThe current working directory changes
FileChangedA file changes
WorktreeCreate / WorktreeRemoveA worktree is created / removed
Elicitation / ElicitationResultInformation is requested / returned

Configuration example

This example calls a local script before a tool runs:
{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "~/.qoder/hooks/check-command.sh"
          }
        ]
      }
    ]
  }
}
matcher narrows the trigger. After saving the configuration, reopen Settings → Hooks, refresh the page, and run a low-risk task that triggers the event. Check both the task result and the handler's own logs or output. For matching rules, input and output schemas, and complete handler configuration, see Qoder CLI CN Hooks Reference.