Automate actions with hooks changedhooks-guide
Upstream edited this page at 29 Nov 2026 00:01 UTC, give or take a minute or two: the time comes from Anthropic’s own sitemap rather than from a commit. This site recorded the change at 29 Nov 2026 00:07 UTC.
Upstream edited
Recorded here
Lines+4added
Lines−2removed
From line
899
where the diff opens
First seen
14 Aug 2026
this site's first read of the page
Recorded edits67to this page, all time
The whole hunk
from line 899, old and new numbered
/
from line 899
899899
900900Use `type: "http"` hooks to POST event data to an HTTP endpoint instead of running a shell command. The endpoint receives the same JSON that a command hook would receive on stdin, and returns results through the HTTP response body using the same JSON format.
901901
902HTTP hooks are useful when you want a web server, cloud function, or external service to handle hook logic, such as a team's shared audit service. The configuration below posts every successful tool call to a local logging service:
902HTTP hooks are useful when you want a web server, cloud function, or external service to handle hook logic, such as a team's shared audit service.
903903
904The configuration below sends [`PostToolUse`](https://code.claude.com/docs/en/hooks#posttooluse) events to an audit service, authenticating with a token from the `MY_TOKEN` environment variable:
905
904906```json theme={null}
905907{
906908 "hooks": {
from line 911
909911 "hooks": [
910912 {
911913 "type": "http",
912 "url": "http://localhost:8080/hooks/tool-use",
914 "url": "https://hooks.example.com/tool-use",
913915 "headers": {
914916 "Authorization": "Bearer $MY_TOKEN"
915917 },
No line in this hunk matches that.