◉CLAUDE LABJP
●2.1.302 — Fork subagents are now on by default in claude -p, the Agent SDK and the desktop app. Turn them off with CLAUDE_CODE_FORK_SUBAGENT=0 (10/16)●2.1.301 — Unattended retries now stop on their own when a usage limit is hit instead of waiting (10/15). Latest is 2.1.304 (10/19)●SONNET 4.5 — Retires on the Claude API on 11/30, 40 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…●2.1.302 — Fork subagents are now on by default in claude -p, the Agent SDK and the desktop app. Turn them off with CLAUDE_CODE_FORK_SUBAGENT=0 (10/16)●2.1.301 — Unattended retries now stop on their own when a usage limit is hit instead of waiting (10/15). Latest is 2.1.304 (10/19)●SONNET 4.5 — Retires on the Claude API on 11/30, 40 days left. Migrate to Sonnet 5.5●WINDOWS — Reports say hooks break silently only on Japanese-locale Windows; check the character encoding first●FAST MODE — Opus 5.5 fast mode is out of research preview and no longer needs the beta header (10/15)●NEW — I Put a Ten-Line Promise File at the To…
Articles/Claude Code
⟐ Claude Code/2026-04-01Advanced

Claude Code HTTP Hooks × GitHub Actions Integration Guide — Production Patterns for Automated Code Review, Testing, and Deployment

A deep dive into integrating Claude Code HTTP Hooks with GitHub Actions to build production-grade pipelines for automated code review, quality checks, and deployment — with detailed code examples throughout.

Claude Code270HTTP HooksGitHub Actions12CI/CD19automation109code review4DevOps3

✦ Premium Article

How HTTP Hooks Transform Development Workflows

Claude Code's hook system is a powerful mechanism for connecting AI agent behavior to external systems. HTTP Hooks in particular unlock "cloud-native automation" that simply isn't possible with local-process stdio hooks.

Combining GitHub Actions with HTTP Hooks enables workflows like these:

  • The moment a pull request is opened, Claude Code automatically reviews the code
  • Every commit triggers security scanning and quality checks in real time
  • When tests fail, Claude Code analyzes the error log and posts a fix suggestion directly on the PR
  • After a staging deployment, Claude Code runs regression tests autonomously

This article explains these patterns as production-ready implementations — not toy examples. We assume familiarity with stdio hooks and basic CI/CD, and go deep on HTTP Hooks-specific design considerations and implementation patterns.


Understanding the HTTP Hooks Architecture

How HTTP Hooks Differ from stdio Hooks

Claude Code supports two kinds of hooks:

  • stdio hooks: Runs as a local process, communicating via stdin/stdout JSON
  • HTTP hooks: POSTs JSON to a specified URL (Webhook endpoint) and reads the response

While Claude Code Hooks and Automation covers the basics of stdio hooks, HTTP Hooks go a step further by enabling real-time integration with external services.

HTTP Hooks execution flow

[Claude Code] -- JSON payload --> [HTTP endpoint]
                                         |
                              [External service calls]
                              (GitHub / Slack / Jira / etc.)
                                         |
                              [Response JSON] --> [Claude Code decides next action]

Hook Events and When to Use Each

The events available to HTTP Hooks are:

  • PreToolUse: Before a tool runs (e.g., before a file write or bash command)
  • PostToolUse: After a tool runs (trigger follow-up processing on results)
  • Notification: Notifications from Claude (progress updates on long tasks)
  • Stop: When Claude ends a session
  • SubagentStop: When a subagent ends its session

For CI/CD integration, PostToolUse and Stop are the most critical. A practical pattern is: use PostToolUse to detect file changes and run quality checks in real time, then use Stop to finalize a report and post it to GitHub.

Configuring HTTP Hooks via CLAUDE.md

HTTP Hooks are configured in .claude/settings.json or CLAUDE.md.

// .claude/settings.json
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Write|Edit|MultiEdit",
        "hooks": [
          {
            "type": "http",
            "url": "https://your-webhook-server.example.com/hooks/file-changed",
            "method": "POST",
            "headers": {
              "Authorization": "Bearer ${CLAUDE_HOOK_SECRET}",
              "Content-Type": "application/json"
            },
            "timeout": 10000
          }
        ]
      }
    ],
    "Stop": [
      {
        "hooks": [
          {
            "type": "http",
            "url": "https://your-webhook-server.example.com/hooks/session-complete",
            "method": "POST",
            "headers": {
              "Authorization": "Bearer ${CLAUDE_HOOK_SECRET}",
              "Content-Type": "application/json"
            },
            "timeout": 30000
          }
        ]
      }
    ]
  }
}

Environment variable interpolation like ${CLAUDE_HOOK_SECRET} is handled automatically by Claude Code. In local development, define variables in a .env file; in CI, use GitHub Actions Secrets.


✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦Understand HTTP Hooks architecture and implement bidirectional integration with GitHub Actions
✦Master production-grade pipeline design for automating code review, testing, and deployment with Claude Code
✦Learn how to build a robust Webhook server with security, authentication, and error-retry patterns
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

⟐ Claude Code2026-05-04
Build a Pipeline Where Docs Update Automatically Every Time Your Code Changes
Build a CI/CD pipeline that auto-generates README, CHANGELOG, and API docs whenever code changes. Use Claude Haiku 4.5 for cost-efficient classification and Sonnet 4.6 for quality output — cutting API costs by up to 70% while keeping documentation accurate.
⟐ Claude Code2026-09-02
Two hooks that record every model switch and stop the ones you never agreed to
Build a PostModelSwitch hook that logs every model change and a PreModelSwitch hook that blocks unapproved switches during unattended runs. Complete scripts, measured timings, and the reason the two jobs must stay separate.
⟐ Claude Code2026-08-31
Half of My Scheduled Runs Vanished Without a Single Error
A batch job set to run twice a day was only firing once. No errors, no failure alerts. Here is how to expand your own schedule, count expected runs, and reconcile them against execution records to catch silent misses.