#Php
55% of the improvements an agent proposed for its own harness fixed one failure and broke something that worked. A PHP tutorial for a self-improving harness with the piece that makes it engineering: the regression gate. Git-versioned rules, failure mining, minimal rules, protected cases, provisional promotion and pruning.
An agent that runs across several context windows forgets everything each session. The pattern Anthropic, Manus and LangChain converged on: move state out of the window and into files. A JSON feature list that only accepts status changes, a progress log, a session start ritual and offloading large results with a restorable pointer, all with PHP code.
A subagent isn't a job title, it's a context window. When to use subagents (and when one agent is enough), the difference between isolated and fork modes, the numbers from Anthropic and Cognition, and how to implement both in a PHP harness straight on the Claude API, no framework.
An artisan command, a queue and Claude Code in headless mode (claude -p) generating 11 sites inside the subscription. How to orchestrate the agent from PHP, where the math works out, and how to plug in Higgsfield as an asset step with a budget controlled by code.
The internet treats the Laravel AI SDK and Prism PHP as competitors and keeps repeating that the official SDK uses Prism under the hood. The composer.json says otherwise. In this post: what each package actually does, the code side by side, the table of what only exists in one of them, the release cadence of both, and a decision guide by concrete case. No "it depends".
The Laravel AI SDK is Laravel's first-party AI package: agents as PHP classes, tool calling, structured output, streaming, embeddings with pgvector and fakes for testing without burning tokens. A practical guide from composer require to your first running agent, covering what the SDK solves, what it doesn't, and the limitations nobody tells you about.
Vibe coding with an agent in Laravel works until the feature has business rules. Then the agent makes things up. Spec-Driven Development fixes that by turning the specification into the source of truth. In this post we walk through the PRD, spec, plan, tasks, code and tests cycle on a feature that looks silly: exporting a sales report as a PDF. PHP stack, Claude Code and Spec Kit, from scratch.