AI coding tools are becoming a normal part of software development. I also use AI tools for coding, debugging, understanding code, and working on Laravel projects.
But there is one problem that is easy to miss.
AI agents need to read a lot of command-line output.
When I run tests or static analysis myself, I can quickly understand colorful terminal output, tables, progress indicators, and other information.
An AI agent does not need all of that.
It mainly needs the important information:
- What failed?
- Which file has the problem?
- Which line has the problem?
- What is the error?
- How many tests passed or failed?
- What should be fixed next?
This is the problem Laravel PAO is trying to solve.
What Is Laravel PAO?
PAO means PHP Agent-Optimized Output.
Laravel PAO changes the output of common PHP development tools when they are being used by an AI coding agent.
Instead of giving the agent long human-friendly terminal output, PAO provides compact and structured information.
Laravel says PAO currently supports:
- PHPUnit
- Pest
- Paratest
- PHPStan
- Rector
- Laravel Artisan
It can detect AI-agent environments such as Claude Code, Cursor, Devin, Gemini CLI, and others.
Why Normal Terminal Output Is a Problem for AI
Imagine running a large PHPUnit test suite.
A human might see:
- Test progress
- Colors
- Dots
- Timing
- Formatting
- Summary
- Failure details
For a human this is fine.
But an AI agent has to process all that text before it can decide what to do.
For example, a project may have hundreds or thousands of tests.
Most of those tests may pass.
The agent does not really need a huge list showing every successful test.
It mainly needs the failures.
This is where structured output becomes useful.
What PAO Does for Test Results
With PHPUnit, Pest, and Paratest, Laravel PAO provides compact structured results.
The information can include:
- Total tests
- Passed tests
- Failed tests
- Errors
- Skipped tests
- Warnings
- Notices
- Deprecations
- Duration
- Failure information
This gives an AI agent a much cleaner result to work with.
For example, instead of processing a large terminal output, the agent can receive information that is much closer to:
Tests: 247
Passed: 241
Failed: 6
Duration: 18.4sThen it can focus on the six failures instead of reading everything that happened during the test run.
PAO Does Not Change How Developers Use the Terminal
This is probably one of the most important parts.
Laravel PAO is designed to work differently for humans and AI agents.
When I run a command normally in my terminal, I can continue to see the usual output.
When an AI agent runs the same supported command, PAO can provide the cleaner output.
So developers don't have to sacrifice the terminal experience just to make AI coding tools work better.
Laravel specifically designed PAO so the normal human terminal workflow remains unchanged.
PHPStan Output Becomes Easier to Process
PHPStan is commonly used to find type-related and code-quality problems.
A normal PHPStan result can contain many lines of information.
In a large Laravel project, this can become difficult for an AI agent to process efficiently.
PAO normalizes PHPStan output into structured JSON.
The useful information includes the number of errors and details about the files and problems that need to be fixed.
This fits very well with AI coding workflows.
Instead of asking an AI tool to interpret a formatted terminal message, we can give it structured information.
Rector Output Is Also Supported
Rector is used for automated refactoring and code modernization.
An AI coding agent may need to understand:
- Which files changed
- What was changed
- Which Rector rule was applied
- What diff was generated
PAO makes this information easier for an agent to process.
This is useful when an AI agent is doing larger refactoring work.
For example:
Analyze → Refactor → Run Tests → Read Failures → Fix → Run Tests Again
That is a very common AI-assisted development workflow.
What About Artisan?
Artisan works slightly differently.
Laravel PAO does not turn every Artisan command into JSON.
Instead, it removes unnecessary terminal formatting when an AI agent is running an Artisan command.
For example, Artisan commands can contain:
- Colors
- Box characters
- Decorative tables
- Extra spacing
- Formatting designed for humans
PAO removes this extra decoration while keeping the useful information.
Commands such as:
php artisan about
php artisan db:show
php artisan migrate:statuscan therefore become easier for an AI agent to understand.
How Laravel PAO Works
One thing I found interesting is that PAO does not require developers to learn a completely new command system.
You don't need to replace:
phpunitwith another command.
You don't need to create a separate workflow for:
phpstanor:
php artisanPAO hooks into the existing PHP tooling through Composer's autoloader.
It detects whether the current process is running inside an AI-agent environment.
If it is not, it exits without changing the normal workflow.
If an agent is detected, PAO activates the appropriate output handling.
I like this approach because the developer does not have to think about it every time.
Installation
For an existing Laravel application, the official package can be installed as a development dependency:
composer require laravel/pao --devAccording to the current Laravel PAO repository, it requires PHP 8.3 or newer and supports Laravel 12+, along with current versions of PHPUnit, Pest, Paratest, PHPStan, and Rector.
New Laravel applications also include PAO as a development dependency by default, according to Laravel's announcement.
Why Structured Output Is Important for AI Agents
This is bigger than just Laravel.
AI agents work by observing information, making a decision, running a tool, and then observing the result again.
For example:
AI agent workflow
- Read the application
- Change some code
- Run PHPUnit
- Read the result
- Find the failing test
- Open the file
- Fix the problem
- Run PHPUnit again
The cleaner the output is, the easier this loop becomes.
That is why structured output is becoming important for AI development tools.
Humans can understand messy terminal output.
Machines work better with structured data.
Does This Make AI Coding Better?
PAO does not make the AI model itself smarter.
It does something different.
It gives the AI agent better information.
That distinction is important.
Suppose the agent receives:
500 lines of terminal outputbut only five lines actually contain useful failure information.
The model has to process a lot of unnecessary information.
Now suppose it receives structured information containing only the important result.
The agent can spend more of its reasoning on the actual problem.
So I see PAO as a developer workflow improvement, not an AI model improvement.
PAO and Large Laravel Applications
This becomes even more useful when working on large applications.
A small Laravel project might have:
- 20 tests
- 10 controllers
- 10 models
The amount of command output is manageable.
But a real enterprise application can have:
- Hundreds or thousands of tests
- Many modules
- Large static-analysis output
- Many migrations
- Multiple queues
- Large Eloquent models
- Hundreds of services and actions
When AI agents are working on these projects, the amount of terminal information can become very large.
Reducing unnecessary output can therefore make the development workflow more efficient.
PAO Is Not Only for Laravel
Another interesting point is that Laravel PAO is not limited to Laravel applications.
The official repository says PAO can work with other PHP projects, including Symfony, Laminas, and vanilla PHP projects, as long as they use supported tools such as PHPUnit, Pest, Paratest, PHPStan, or Rector.
So although the package comes from Laravel, the idea is much broader.
It is really about making PHP tooling easier for AI agents to consume.
Human-Friendly Output vs Agent-Friendly Output
There is a difference between these two goals.
Human-friendly output usually focuses on:
- Readability
- Colors
- Formatting
- Tables
- Visual progress
- Helpful decoration
Agent-friendly output focuses more on:
- Structured data
- Important errors
- File paths
- Line numbers
- Counts
- Machine-readable results
- Minimal unnecessary text
Neither is better for every situation.
Humans and AI agents simply have different requirements.
PAO lets the same tools serve both workflows.
My View as a Laravel Developer
After working with PHP and Laravel for around ten years, I don't think every AI-related Laravel feature needs to be a huge new framework feature.
Sometimes a small developer-experience improvement can be more useful in daily work.
Laravel PAO is a good example.
I already use tools like PHPUnit, PHPStan, Rector, and Artisan.
The commands are not new.
The improvement is in how their output is presented to AI coding tools.
That makes sense because the development process is changing.
Today we are not only writing code ourselves. We are also giving coding agents tasks such as:
- Fix this bug
- Run the tests
- Find the problem
- Refactor this service
- Fix PHPStan errors
- Update this code
- Check the migration
- Run the test suite again
For these workflows, the agent needs clean feedback.