Skip to content

Commit d12499c

Browse files
authored
docs: Add hooks to the-agent-format.md
1 parent 8cd08c6 commit d12499c

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

docs/the-agent-format.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,23 @@ Resources are data and content that your agent has access to. As of today, only
145145
}
146146
```
147147

148+
### The `hooks` field
149+
150+
The `hooks` field invokes functions at specific trigger points. The output of these functions is persisted into context according to the lifetime rules of the trigger. Hooks that run once, on `agentSpawn` for example, will be added to persistant context while shorter lived hooks like `userPromptSubmit` exist inside of the rolling context window.
151+
152+
```json
153+
{
154+
"hooks": {
155+
"agentSpawn": {
156+
"command": "git status",
157+
},
158+
"userPromptSubmit": {
159+
"command": "ls",
160+
}
161+
}
162+
}
163+
```
164+
148165
## Complete Example
149166

150167
Here's a complete example of an agent manifest:

0 commit comments

Comments
 (0)