Show HN: Claude Agent SDK for Laravel – Build AI Agents with Claude Code in PHP
1 points
1 hour ago
| 0 comments
| github.com
| HN
Hi HN, I built a Laravel package that wraps the Claude Code CLI as a library for PHP applications.

The problem: Claude Code is powerful (file ops, bash, code editing, subagents, MCP) but it's a CLI tool. If you want to use those capabilities from a web app, there wasn't a clean PHP interface.

This SDK communicates with Claude Code via subprocess, parses the streaming JSON output, and provides a fluent PHP API with full type safety.

Technical highlights: - Generator-based streaming (memory efficient) - Full message/content block parsing with typed classes - Subagent orchestration (delegate tasks to specialized agents) - MCP server integration (stdio + SSE) - JSON schema structured output - Session resume and fork for multi-turn conversations - PHP 8.1+ with readonly properties, enums, named args

It's MIT licensed. Would love feedback on the architecture and API design.

No one has commented on this post.