-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
Description
Phase 2: HTTP Hook Handler Type
Context
Claude Code now supports type: "http" hook handlers that send the event's JSON input as an HTTP POST to a URL. The endpoint returns decisions using the same JSON output format as command hooks.
New Fields
| Field | Type | Description |
|---|---|---|
type |
"http" |
Handler type |
url |
String |
URL to POST to |
headers |
[String: String]? |
HTTP headers with env var interpolation ($VAR_NAME / ${VAR_NAME}) |
allowedEnvVars |
[String]? |
Env var names permitted for header interpolation |
Example
{
"type": "http",
"url": "http://localhost:8080/hooks/pre-tool-use",
"timeout": 30,
"headers": {
"Authorization": "Bearer $MY_TOKEN"
},
"allowedEnvVars": ["MY_TOKEN"]
}Files to Modify
Sources/mcs/Core/Settings.swift— extendHookEntryto supporturl,headers,allowedEnvVarsSources/mcs/ExternalPack/ExternalPackManifest.swift— allow packs to define HTTP hooks- Validation: if
type == "http",urlis required - Tests for serialization/round-tripping
Acceptance Criteria
-
HookEntrycan represent HTTP hooks with all fields - Pack authors can define HTTP hooks in
techpack.yaml - Validation ensures
urlis present for HTTP type - Backward compatible
Reference
Reactions are currently unavailable