
AI-assisted development has become a core part of most PHP workflows — but if you've been running Claude Code, Cursor, or similar tools against a Laravel project for a while, you've probably felt the costs creeping up and the usage limits arriving at inconvenient times.
The root cause is usually noise. Laravel is expressive by design, and that expressiveness produces verbose output. Test runners, static analysis, Artisan commands — they're all built to look great in a terminal, with colour codes, box-drawing characters, and human-readable formatting. Great for developers. Expensive for an AI that has to read every character and fit it into a context window.
The good news: there are specific tools that fix this. Here's what to do, ordered from easiest to most involved.
This one costs nothing and takes about 30 seconds. Most AI tools let you choose which model powers your session, and the default is often the most capable — and most expensive — option.
Flagship models like Claude Opus or GPT-4o are brilliant for complex, open-ended problems. But for the bulk of day-to-day Laravel work — generating a migration, writing a test, debugging a query — a mid-tier model handles it just as well at a fraction of the cost.
Similarly, most agents let you set an effort level (sometimes called "thinking" or "reasoning" mode). The highest setting burns significantly more tokens on extended reasoning before responding. It's worth it for genuinely tricky architectural decisions, but for routine tasks, medium effort is almost always enough.
A simple habit: ask yourself whether a task is truly complex before reaching for the most powerful settings. Most of the time, it isn't.
No installation required — but this might deliver the biggest return of anything on this list.
Every AI agent works from a set of instructions: a CLAUDE.md, a .cursorrules file, a system prompt. These tell the agent how to behave, what your project looks like, and what conventions to follow. If they're vague, outdated, or bloated, every single session pays the price in extra back-and-forth and corrections.
Sharp, specific guidelines mean the agent gets things right the first time. A practical starting point:
# Project: [Your App Name]
## Stack
Laravel 11, PHP 8.3, PostgreSQL, Redis
Pest for testing, PHPStan level 8
## Conventions
- Repository pattern for data access
- DTOs for service layer inputs
- API responses always use JsonResource
- Models use UUIDs, never auto-increment IDs
## Testing
- Always write Pest tests for new features
- Use factories, never raw model creation
- Feature tests for controllers, unit tests for services
A few things worth doing regularly: replace vague instructions like "use best practices" with specific ones, define what "done" looks like for common tasks, and audit for outdated conventions — stale rules still consume tokens on every request.
If your agent supports skills, use them to encode patterns that come up repeatedly: your auth flow, your API response structure, your error handling approach. The agent will apply them consistently without you having to repeat yourself.
laravel-boost is a package built specifically to make Laravel projects more AI-friendly. It covers a range of improvements in a single install — helping agents navigate your codebase more efficiently, reducing unnecessary back-and-forth, and improving the quality of signals the AI works from.
It runs in the background. You don't need to change how you work.
→ Get started with laravel-boost
AI agents can be surprisingly chatty. They narrate their actions, explain their reasoning, and restate context that's already in the window. Useful when you're reading along — expensive when you're paying per token.
The Caveman plugin tells your agent to cut the commentary and focus on the essentials: what it did, what the result was, and any errors. Less narration, more action.
For Claude Code, add it to your project's .claude config:
{
"plugins": ["caveman"]
}
For Cursor, add the equivalent to your .cursorrules file. Check the Caveman docs for your specific agent.
PHPUnit, Pest, PHPStan, Rector, and Laravel Artisan all produce output designed for humans — colours, Unicode borders, progress indicators. When an AI agent runs your test suite, it has to process all of that formatting before it gets to the actual result.
Laravel PAO (PHP Agent Output) fixes this automatically. It detects when your tools are running inside an agent context and switches to compact, structured JSON instead. Zero config — just install it and it works across Claude Code, Cursor, Devin, Gemini CLI, and others.
Before PAO:
FAILED Tests\Unit\UserTest > it creates a user
────────────────────────────────────────────────
Expected true but got false.
After PAO:
{"status":"failed","test":"Tests\\Unit\\UserTest::it_creates_a_user","message":"Expected true but got false"}
Same information. A fraction of the tokens. Works with any PHP project — not just Laravel.
→ Get started with Laravel PAO
rtk is a single Rust binary that sits between your terminal commands and your AI agent, filtering and compressing output before it ever hits the context window. It supports 100+ commands out of the box and adds less than 10ms overhead — you won't notice it's there, but your token usage will.
Commands like git log, docker ps, and npm ls can produce output many times larger than the information the agent actually needs. rtk strips it to the signal and discards the rest, freeing up context for real work.
None of these require a big time investment. Start with the model and effort settings — that's free and immediate. Then work through the list at your own pace, beginning with the areas causing the most friction.
Used together, they tackle the problem from every angle: leaner tool output, quieter agents, sharper instructions, and smarter model usage. The result is a faster, cheaper AI workflow that actually scales as your project grows.
Published May 1st, 2026 by Jacob Fitzpatrick
Receive news about new and exciting packages.
Our newsletter isn't quite ready just yet, enter your email above to be the first in line.
© 2026 Laragist
Laragist is an unofficial site and not affiliated with Laravel Holdings Inc
By @JacobFitzp and @carolinepixels