From b428baf70bec9cb778c1fdbf2e3e5e8fc422d2d4 Mon Sep 17 00:00:00 2001 From: ntduc Date: Wed, 22 Jul 2026 14:13:30 +0700 Subject: [PATCH] docs(hooks): document script context injection --- docs/agent-hooks.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/agent-hooks.md b/docs/agent-hooks.md index 9514d286..1612500a 100644 --- a/docs/agent-hooks.md +++ b/docs/agent-hooks.md @@ -87,6 +87,18 @@ Hooks resolve in priority order, highest first. A single `block` decision short- ``` - Non-JSON 2xx → allow. +### script + +Custom ES5.1 scripts may return `additionalContext` with an `allow` decision. +For `user_prompt_submit`, GoClaw appends that text to the current run's extra +system prompt without changing the original user message. + +```javascript +function handle(event) { + return { decision: "allow", additionalContext: "Call the required tool before answering." }; +} +``` + ### prompt ```json