Triggers
Define slash commands that invoke agents or actions in your topology
Triggers
The triggers block defines slash commands that users can invoke interactively. Triggers let users kick off specific agents, run scripts, or start sub-flows on demand.
Basic Syntax
triggers {
/deploy {
pattern: "/deploy"
argument: "ENVIRONMENT"
}
/review {
pattern: "/review"
}
}Field Reference
| Field | Type | Required | Description |
|---|---|---|---|
pattern | string | Yes | The slash command pattern (e.g. "/deploy") |
argument | string | No | Named argument in UPPERCASE format |
Argument Format
Arguments use UPPERCASE names to indicate a required user-provided value:
triggers {
/deploy {
pattern: "/deploy"
argument: "ENVIRONMENT"
}
}When the user types /deploy production, the value production is passed as the ENVIRONMENT argument.
Multiple Triggers
Define as many triggers as your topology needs:
triggers {
/analyze {
pattern: "/analyze"
argument: "FILE_PATH"
}
/fix {
pattern: "/fix"
argument: "ISSUE_ID"
}
/status {
pattern: "/status"
}
}Connecting Triggers to Agents
Triggers work with agents that have invocation: manual. When a trigger fires, it activates the associated agent:
topology dev-tools : [pipeline] {
agent analyzer {
model: sonnet
tools: [Read, Grep]
invocation: manual
}
agent fixer {
model: sonnet
tools: [Read, Write]
invocation: manual
}
triggers {
/analyze {
pattern: "/analyze"
argument: "FILE_PATH"
}
/fix {
pattern: "/fix"
argument: "ISSUE_ID"
}
}
}Tips
- Trigger patterns always start with
/. - Argument names should be descriptive and use UPPERCASE with underscores (e.g.
FILE_PATH,BRANCH_NAME). - Triggers are especially useful in interactive environments like Claude Code where users can type commands directly.
- An agent with
invocation: autodoes not need a trigger — it runs automatically as part of the flow.