Amp — Hooks
- File format
- JSON
- Discovery path
.amp/settings.json- Syllago install method
- JSON merge
- Symlink support
- No
- Config file
.amp/settings.json- Handler types
command
Hook events
Amp supports hooks, but syllago does not yet map its hook event names. Hook conversion to and from Amp is best-effort.
Features
How each feature converts to syllago's canonical format. See format conversion for what these statuses mean.
Fields
Native frontmatter or config fields this provider exposes. The first column is the provider's own field name; the canonical key column links to syllago's cross-provider equivalent.
| Provider field | Conversion | Canonical key | Summary |
|---|---|---|---|
action | TranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more → | handler_types | command-only: hook 'action' field runs a shell command; no HTTP, LLM, or agent handler types documented |
action | TranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more → | — | The hook 'action' field invokes a shell command (declarative pre-execute 'send-user-message' and post-execute 'redact-tool-input' actions); no HTTP, LLM, or agent handler types are documented. |
event | TranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more → | — | Two events: 'tool:pre-execute' (before tool runs) and 'tool:post-execute' (after); each event accepts only specific actions. Canonical mapping: before_tool_execute → tool:pre-execute, after_tool_execute → tool:post-execute. |
input.contains | TranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more → | matcher_patterns | Amp hooks filter firing via 'input.contains' — exact literal substring match against tool input |
input.contains | TranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more → | — | Filter hook firing by exact literal substring match in tool input — no regex or glob support. |
action | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | — | Delegate decisions to an external program named in the rule's 'to' field (must be on $PATH). Amp pipes tool parameters as JSON to stdin and exports AMP_THREAD_ID, AGENT_TOOL_NAME, and AGENT=amp env vars. Exit status: 0=allow, 1=ask operator, ≥2=reject (stderr surfaced to the model). Plugin API is the documented successor; a compatibility plugin enforcing amp.permissions rules is planned. |
action.type | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | — | Pre-execute action that injects a user message and cancels the pending tool call to enforce behavioral constraints. |
action.type | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | — | Post-execute action that redacts tool input fields after execution to avoid storing sensitive arguments. |
amp.hooks | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | — | Hooks are stored as an array under the 'amp.hooks' key inside '.amp/settings.json' (workspace) or user-scope settings; they are not a standalone hooks file. |
amp.hooks | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | — | Hook definitions live as an array in Amp settings files (.amp/settings.json or user-scope settings). |
amp.permissions | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | — | Ordered first-match-wins rule system under 'amp.permissions' with allow/reject/ask/delegate actions and per-context defaults. |
context | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | — | Optionally scopes a rule to main thread, sub-agent only, or both (omitted); defaults differ by context. |
matches | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | — | Match values support glob patterns ('*'), regex (strings starting and ending with '/'), arrays (OR across entries), literals (boolean/number/null/undefined as exact match), and nested objects (deep property matching with dot notation for objects and numeric strings for array indices). Tool name field also accepts globs (e.g., 'Bash', 'mcp__playwright__*'). |
message | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | — | A 'reject' rule may carry a 'message' string returned to the model; when set, the rejection continues the conversation with that feedback instead of halting it. |
Other features
Behaviors, conventions, and capabilities that aren't tied to a single named field — things like path-based activation, discovery rules, and lifecycle behavior.
| Feature | Conversion | Summary |
|---|---|---|
decision_control | TranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more → | Pre-execute 'send-user-message' action cancels the pending tool call and injects a user message; exit code 0 = allow, non-zero = block |
permission_control | TranslatedConversion type: TranslatedActively mapped to the target provider’s equivalent field during conversion.Learn more → | amp.permissions ordered first-match-wins rule list returns one of allow / reject / ask / delegate for every tool invocation before execution; default fallback is ask on the main thread and reject in sub-agents |
| Default action when no rule matches | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | If no user rule and no built-in rule matches, Amp asks the operator on the main thread and rejects the call in sub-agents. Built-in rules (e.g., allowing 'ls' via Bash) are consulted after user rules. |
| Permissions CLI (amp permissions) | Not portableConversion type: Not portableUnique to this provider — can’t be carried across providers.Learn more → | 'amp permissions' subcommands manage rules in a UNIX-shell-style text format without editing JSON: 'list' (with '--builtin' for built-ins only), 'add' (e.g., 'add reject web_search'), 'edit' (opens $EDITOR; also accepts STDIN), and 'test' (dry-runs a tool+args call and prints the matched rule, action, and source). Single/double-quoted strings supported; unquoted true/false/null/numbers parsed as JSON literals; values containing '*' must be quoted. |
Sources
| Source |
|---|
| https://ampcode.com/manual/appendix/permissions-reference.md |