Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Claude Hooks Sdk Laravel Package

beyondcode/claude-hooks-sdk

A Laravel/PHP SDK for building Claude Code hooks with clean, typed classes instead of raw shell scripts. Register hooks, handle events, and integrate Claude Code automation directly into your Laravel apps with minimal boilerplate.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This package lives at the developer-tooling layer, never in an application request path. Claude Code hooks are short-lived CLI processes spawned by Anthropic's agent on lifecycle events (PreToolUse, PostToolUse, Notification, Stop, SessionStart), each receiving a JSON payload on stdin and replying with a decision via exit codes and optional stdout JSON. The SDK is a thin adapter over that contract: it parses stdin into typed event objects and gives you a fluent API to return allow/block/context decisions. For a PHP/Laravel-centric org, that is the strategic value — agent guardrails become typed, testable PHP owned by the team you already have, instead of scattered shell scripts nobody reviews. Model it as workstation and CI developer tooling, and keep it out of require for anything serving production traffic.

Integration feasibility. Composer-installable, MIT-licensed, small surface area, PHP 8+, with first-class Laravel ergonomics (service provider auto-discovery, publishable config, artisan-friendly install/scaffold command). The binding constraint is environmental rather than code-level: Claude Code must be installed and a PHP binary must exist on every developer machine and CI runner that fires a hook. That portability requirement — not the SDK — drives most of the rollout friction and should be scoped explicitly in the plan.

Technical risk. Treat this as early-stage. 68 stars, zero dependents, a single July 2025 release, and a low composite score are maturity and bus-factor signals rather than a quality verdict; Beyond Code has a credible Laravel track record. The substantive risk is contractual: the hook schema is owned by Anthropic and will evolve, so the SDK is a wrapper tracking a moving target. Pin an exact version, wrap it behind one internal interface, and carry a fork-or-shell fallback from day one. Budget roughly a day to spike against the current schema and design every hook so it can be replaced by raw shell if the package stalls.

Key questions. Which hook events does the SDK cover versus the full Claude Code surface? Is the stdin schema versioned, and does the parser tolerate unknown fields after an agent upgrade? Does it assume a Unix shell, and how does it behave on Windows runners? What is the release cadence and issue-response time? Who owns the guardrail policy internally, and which metric proves it is working — blocked actions, audit coverage, or time-to-onboard?

Integration Approach

Stack fit. Strong for Composer/PHP 8+ and idiomatic Laravel — config publishing, Artisan, existing HTTP client, existing logging and metrics pipeline. Frame the value as repository- and workstation-level guardrails: a secret/infra write-blocker, a destructive-command blocker, lint-and-static-analysis gates on edits, audit logging, branch/ticket context injection, and notifications on Stop. All are independently shippable and independently measurable. Poor fit for anything on a production request path.

Migration path. Adopt it as a replaceable adapter, not a foundation. Define a small internal contract in your own codebase — one interface plus a DTO for the hook payload, or a thin wrapper over the SDK's typed events — and let the package be the single implementation behind it. If it stalls or Anthropic changes the schema, the swap is contained to one class rather than smeared across every hook.

Compatibility. Verify the PHP version constraint against your support matrix, confirm no conflicting Symfony/PSR constraints against an existing Laravel lockfile, and test against the exact OS images your CI uses. Pin to an exact version and validate upgrades against a matrix of Claude Code versions, because the SDK and the agent move on independent schedules.

Sequencing. (1) Spike in one repo with no CI wiring to confirm payload shape and event coverage. (2) Ship one low-risk, fail-open hook into a real workflow — audit logging is the safest first candidate. (3) Codify the pattern into a shared template repo so teams adopt a known-good configuration. (4) Only then consider org-wide rollout. Each step should be independently reversible and carry a stated success criterion before the next is funded.

Operational Impact

Maintenance. Low code volume, but the burden is version-tracking two moving targets at once. Budget a quarterly review, assign a named owner, and assume you may vendor or fork if upstream goes quiet. Zero dependents means your team is the early adopter absorbing debugging a mature ecosystem would have already done — plan for that in the estimate.

Support. Community-only: no SLA, no escalation path, no completed security review trail. That is acceptable for developer tooling and disqualifying for anything gating a production deploy. State this expectation to stakeholders before rollout so nobody assumes vendor-backed coverage.

Scaling. Effectively flat from an infrastructure standpoint — cost scales with developer count and CI job volume, not user traffic. The constraint that actually bites is latency: blocking hooks add wall-clock time to every agent interaction, so keep handlers fast, bound them with hard timeouts, and stay non-blocking wherever the protocol allows.

Failure modes. Schema drift after a Claude Code upgrade silently breaks payload parsing; a crashing or hanging hook degrades or blocks the agent session; a misconfigured hook simply never fires and nobody notices it is a no-op. Mitigate with fail-open exit codes, hard timeouts, invocation telemetry, and an upgrade canary in staging. Residual risk is supply-chain exposure from an under-audited transitive dependency — an SBOM entry plus a lockfile audit covers most of it.

Ramp-up. Small surface area and idiomatic PHP mean an experienced Laravel developer is productive in well under a day. The genuine learning cost sits in the Claude Code hook model — event semantics, payload contents, exit-code contract, matcher configuration — not in the SDK itself, and that knowledge transfers to whatever implementation you end up using. Budget a one-day spike per adopting team, and capture the output as internal documentation. Instrument from day one: hook invocations per repo, blocked-action count and reason, false-positive/override rate, p95 hook latency per interaction, and percentage of repos with a hook config committed — adoption on those metrics is the leading indicator for a governed AI rollout.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels