Laravel Daily's

Debug Laravel from the Terminal: Telescope 5.24 CLI Commands Meet the Boost AI Debugging Skill

Bright illustration of a Laravel terminal debugging REST API requests with Telescope and an AI coding agent

Laravel Telescope 5.24.0, released on September 8, 2026, adds two Artisan commands for inspecting application telemetry without opening the dashboard.

Laravel Boost 2.8.x adds a stronger foundation for AI-assisted debugging. Together, they give your coding agent structured runtime data, precise filters, and a path from a failing request to a specific query or file and line.

This tutorial uses a REST API example. The same workflow applies to jobs, cache issues, slow queries, and application exceptions.

Install Telescope 5.24.0 and Boost 2.8.x

Telescope remains an elegant debug assistant for the Laravel framework. It records requests, exceptions, queries, cache operations, jobs, logs, and more.

Install or update Telescope with Composer:

composer require laravel/telescope:^5.24

If Telescope is new to the project, publish its installation files and migrate:

php artisan telescope:install
php artisan migrate

Telescope is available through the /telescope route by default in local environments. It can also be installed as a development dependency for local-only debugging. Review the Telescope documentation before enabling it in shared or production environments.

Next, install Laravel Boost:

composer require laravel/boost:^2.8 --dev
php artisan boost:install

When updating an existing installation, refresh its generated guidelines and skills:

php artisan boost:update --discover

Boost 2.8.0 added improvements to skill handling and package guidance. Boost 2.8.1 followed with support for third-party NPM package guidelines and skills, safer skill downloads, and several MCP fixes. See the Boost 2.8 release notes.

Illustration of Telescope data flowing from terminal tables into a precise PHP source location

telescope:list: Inspect entries from the terminal

The new telescope:list command lists recorded Telescope entries. You can omit the type to see the general entry list:

php artisan telescope:list

For a REST API, requests are usually the best starting point:

php artisan telescope:list request

The command shows useful request details, including the UUID, HTTP method, URI, response status, duration, and creation time.

Limit the result set when working on a busy local application:

php artisan telescope:list request --limit=10

You can inspect other entry types in the same way:

php artisan telescope:list exception
php artisan telescope:list query
php artisan telescope:list cache
php artisan telescope:list job

The type is an optional argument, not an option. If you pass an invalid type, Telescope reports the valid entry types.

Filter by tag, batch, or family

Telescope can attach tags to entries automatically. These may include authenticated user IDs and Eloquent model names. You can also define custom tags in TelescopeServiceProvider.

Filter entries by tag:

php artisan telescope:list request --tag=status:500

A batch groups entries recorded during the same request or console command. Use the batch ID from the output to inspect its related entries:

php artisan telescope:list --batch=01JX5WQ8KZ7V6QZ4M2R8H9P3ND

You can also filter by family hash:

php artisan telescope:list --family=8c7a1f4e0d1e2b3c

Tags, batches, and families answer different questions:

  • Tags identify a shared label, such as user:42 or status:500.
  • Batches group telemetry from one request or command.
  • Families help correlate related entries using Telescope’s family hash.

These filters matter when an application produces many similar requests. They reduce the investigation to the runtime path you care about.

Paginate with --before

Telescope uses the entry sequence as a cursor. When the command reports another page, pass the last sequence value with --before:

php artisan telescope:list request --limit=20 --before=1842

You can combine pagination with filters:

php artisan telescope:list exception \
    --tag=user:42 \
    --limit=20 \
    --before=1842

This makes the command suitable for SSH sessions and repeatable debugging scripts. You do not need to load a dashboard or manually scroll through a large table.

telescope:show: Drill into one entry

Once telescope:list gives you a UUID, inspect the complete entry with telescope:show:

php artisan telescope:show 01JX5WQ8KZ7V6QZ4M2R8H9P3ND

The command also supports shortcuts for the newest entry:

php artisan telescope:show latest
php artisan telescope:show latest:exception

The latest:exception form is useful after an API request returns a 500 response. It opens the newest recorded exception without requiring you to copy an identifier.

By default, the output includes the entry and related batch context. For example, showing an exception can include:

  • Exception class and message
  • Source file and line
  • Code context
  • Stack trace
  • Related queries
  • Related cache operations
  • Related logs

Use --type to limit related batch entries:

php artisan telescope:show latest:exception --type=query,cache

This keeps the output focused on database and cache activity around the exception.

Long SQL statements, payloads, and messages are truncated by default. Use --full when you need the complete values:

php artisan telescope:show latest:exception \
    --type=query,cache \
    --full

The result is often enough to distinguish a bad query from a missing cache value or malformed request payload.

Use JSON output with jq

Both commands support machine-readable JSON output. This makes Telescope useful in shell scripts and AI agent workflows.

Print the newest exception as JSON:

php artisan telescope:show latest:exception --json

Extract the important exception fields:

php artisan telescope:show latest:exception --json \
    | jq '.entry.content | {
        class,
        message,
        file,
        line,
        trace
    }'

For a shorter result, show only the class, message, and location:

php artisan telescope:show latest:exception --json \
    | jq '.entry.content | {
        class,
        message,
        location: "\(.file):\(.line)"
    }'

You can also list recent exceptions as JSON:

php artisan telescope:list exception --limit=20 --json \
    | jq '.[] | {
        id,
        message: .content.message,
        file: .content.file,
        line: .content.line
    }'

To find recent HTTP 500 responses, list requests and filter the response status:

php artisan telescope:list request --limit=50 --json \
    | jq '.[] 
        | select(.content.response_status == 500)
        | {
            id,
            method: .content.method,
            uri: .content.uri,
            status: .content.response_status,
            duration: .content.duration,
            created_at: .created_at
        }'

Then pass a matching UUID to telescope:show:

php artisan telescope:show 01JX5WQ8KZ7V6QZ4M2R8H9P3ND --full

Colorful illustration of a REST API debugging flow from a 500 response to a PHP file and line

How Boost changes AI-assisted debugging

An AI coding agent can inspect source code and still miss the real cause. A failing REST endpoint may involve middleware, authorization, validation, a controller, an Eloquent relation, a query scope, and a cache layer.

The new Laravel Boost debugging skill gives the agent a more disciplined workflow. It directs the agent to use Telescope’s runtime evidence instead of guessing from symptoms.

A typical investigation follows this sequence:

  1. List recent requests, exceptions, queries, or cache entries.
  2. Filter by type, tag, batch, or family.
  3. Show the most relevant entry.
  4. Inspect related entries from the same batch.
  5. Follow the stack trace, query source, or request context.
  6. End with a specific query or a file and line.

That final requirement is important. “The endpoint has a database issue” is a symptom. “app/Repositories/OrderRepository.php:74 runs an unscoped query that returns a missing record” is an actionable diagnosis.

Boost skills are activated when relevant, while broader guidelines load up front. This keeps the agent’s context focused. Boost also provides MCP tools for application information, database schema, logs, queries, and documentation. Read the Laravel Boost documentation for setup details.

A practical REST API debugging loop

Suppose you build a REST API with PHP and the GET /api/orders/{order} endpoint begins returning 500 responses.

Start by locating the failures:

php artisan telescope:list request --limit=30

Find the latest exception:

php artisan telescope:show latest:exception \
    --type=query,cache \
    --full

If the exception points to a query, inspect the related SQL and bindings:

php artisan telescope:show latest:exception --type=query --json \
    | jq '.batch[]
        | select(.type == "query")
        | {
            sql: .content.sql,
            bindings: .content.bindings,
            file: .content.file,
            line: .content.line
        }'

The agent can now compare the query’s source location with the endpoint implementation. It can propose a fix against a concrete line, run the relevant test, and repeat the request.

That is faster than asking an agent to search the entire codebase for anything that might produce a 500 response.

Keep Telescope data useful

Telescope data grows quickly. Schedule pruning in your application:

use Illuminate\Support\Facades\Schedule;

Schedule::command('telescope:prune')->daily();

You should also restrict dashboard access outside local development. Telescope’s authorization gate controls access to /telescope in non-local environments.

Telescope 5.24.0 brings that same observability into the terminal. Boost 2.8.x gives AI agents a structured way to use it. Together, they turn debugging from a broad search into a short evidence trail: request, exception, query, file, line.

Previous
Build a Text-to-Speech API with Laravel: Real-Time Audio with the AI SDK
Next
Code Splitting in Inertia 3.x: Lazy-Load Your Laravel + Vue SPA for Faster Boot Times