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.
Go to Settings → Hooks. The page reads the user-level
This example calls a local script before a tool runs:
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.jsonfor shared project configuration.${project}/.qoder/settings.local.jsonfor project configuration used only on the current device.
Handler types
| Type | Use |
|---|---|
command | Run a local command or script. |
http | Send the event to an HTTP service. |
prompt | Use a prompt to decide whether execution can continue. |
agent | Ask an Agent to process the event and return a result. |
Supported events
| Event | Trigger |
|---|---|
SessionStart / SessionEnd | A task starts / ends |
UserPromptSubmit | The user submits an instruction |
PreToolUse | Before a tool runs |
PostToolUse / PostToolUseFailure | After a tool succeeds / fails |
PermissionRequest / PermissionDenied | Permission is requested / denied |
Stop / StopFailure | Before the Agent stops / stop fails |
SubagentStart / SubagentStop | A subagent starts / stops |
PreCompact / PostCompact | Before / after context compaction |
Notification | A notification is produced |
InstructionsLoaded | Instructions are loaded |
ConfigChange | Configuration changes |
CwdChanged | The current working directory changes |
FileChanged | A file changes |
WorktreeCreate / WorktreeRemove | A worktree is created / removed |
Elicitation / ElicitationResult | Information is requested / returned |
Configuration example
This example calls a local script before a tool runs:
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.