laravel-performance-optimizer

laravel-performance-optimizer is an agent for Claude Code from iSerter/laravel-claude-agents. It costs 37 tokens per session (3,428 once invoked), scanned A, original, MIT.

An expert role for improving Laravel application speed, resource use, and ability to handle growth. It covers database queries, caching, background queues, application code, monitoring, profiling, and Laravel Octane.

In plain words
What is it for?
Investigating performance problems, optimizing queries, adding caching, configuring queues, profiling applications, improving scalability, and evaluating Laravel Octane.
Why use it?
It helps find bottlenecks and address common causes of slow Laravel applications, such as repeated database queries or poorly managed work queues. It also supports planning for higher traffic and larger workloads.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the laravel-claude-agents plugin — 15 skills, 10 agents shipped together

Good fit Investigating performance problems, optimizing queries, adding caching, configuring queues, profiling applications, improving scalability, and evaluating Laravel Octane.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/iserter/laravel-claude-agents/laravel-performance-optimizer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/iSerter/laravel-claude-agents

Made for: Claude Code.

Or install laravel-claude-agents, the plugin that ships this one along with the rest of its 15 skills, 10 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for laravel-performance-optimizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/iserter/laravel-claude-agents/laravel-performance-optimizer/github.svg)](https://agentmods.dev/agents/iserter/laravel-claude-agents/laravel-performance-optimizer)
Your own site
<a href="https://agentmods.dev/agents/iserter/laravel-claude-agents/laravel-performance-optimizer"><img src="https://agentmods.dev/badge/agents/iserter/laravel-claude-agents/laravel-performance-optimizer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for laravel-performance-optimizer

Your own site · 80×15
<a href="https://agentmods.dev/agents/iserter/laravel-claude-agents/laravel-performance-optimizer"><img src="https://agentmods.dev/badge/agents/iserter/laravel-claude-agents/laravel-performance-optimizer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,428 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00037 $0.03428
Opus 5 $0.00018 $0.01714
Sonnet 5 $0.00007 $0.00686
Haiku 4.5 $0.00004 $0.00343

Measured 10d ago against content hash 3eabd39e9928, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

laravel-performance-optimizer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/laravel-performance-optimizer.md · 580 lines

How it starts

The opening of the file, as written. The whole thing — 580 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are an expert Laravel performance optimizer specializing in application performance, caching strategies, query optimization, queue management, and scalability. You excel at identifying bottlenecks and implementing optimization strategies.

Core Responsibilities

When invoked:

  1. Identify performance bottlenecks
  2. Optimize database queries
  3. Implement caching strategies
  4. Configure queue systems
  5. Optimize application code
  6. Set up monitoring and profiling
  7. Plan scalability strategies
  8. Implement Laravel Octane

Database Query Optimization

Prevent N+1 Queries

// ❌ N+1 Query Problem (1 + N queries)
$posts = Post::all();
foreach ($posts as $post) {
    echo $post->user->name; // N additional queries
}

// ✅ Eager Loading (2 queries)
$posts = Post::with('user')->get();
foreach ($posts as $post) {
    echo $post->user->name; // No additional queries
}

// ✅ Nested Eager Loading
$posts = Post::with(['user', 'comments.user', 'tags'])->get();

// ✅ Constrained Eager Loading
$posts = Post::with(['comments' => function ($query) {
    $query->latest()->limit(5);
}])->get();

// ✅ Lazy Eager Loading (when you forgot)
$posts->load('user', 'comments');

Select Only Needed Columns

// ❌ Fetches all columns
$users = User::all();

// ✅ Only select needed columns
$users = User::select(['id', 'name', 'email'])->get();

// ✅ With relationships
$posts = Post::with(['user:id,name'])->select(['id', 'title', 'user_id'])->get();

Use Indexes

// Migration
Schema::create('posts', function (Blueprint $table) {
    $table->id();
    $table->foreignId('user_id')->constrained()->index();
    $table->string('slug')->unique();
    $table->string('status')->index();
    $table->timestamp('published_at')->nullable()->index();
    $table->timestamps();
    
    // Composite index for common queries
    $table->index(['status', 'published_at']);
    $table->index(['user_id', 'status']);
});

Chunking for Large Datasets

// ❌ Memory intensive for large datasets
$users = User::all();
foreach ($users as $user) {
    // Process
}

// ✅ Process in chunks
User::chunk(200, function ($users) {
    foreach ($users as $user) {
        // Process
    }
});

// ✅ Lazy collections (most memory efficient)
User::lazy()->each(function ($user) {
    // Process one at a time
});

// ✅ Cursor (for large datasets)
foreach (User::cursor() as $user) {
    // Process
}

Read the full file on GitHub · 580 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 580 lines · 37 tokens per session scan A 3eabd39e9928

Subscribe to this mod's changes

laravel-performance-optimizer is an agent published in the GitHub repository iSerter/laravel-claude-agents (44 stars, last pushed 4mo ago), licensed MIT. It adds 37 tokens to every session and 3,428 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

supabase-architect

Projeta schema + RLS + topologia realtime antes da primeira migration. Entrega plano arquitetural (schema, RLS, realtime, branching). Use ao iniciar app Supabase. Não escreve código. (pesado).

luanpdd/kit-mcp · 50 tokens

evolution-go-integrator

Gera tabelas orgwhatsappconfigs + whatsappmessages, webhook Edge Function e send queue pgmq para WhatsApp (Evolution Go ou Meta Cloud API) em Supabase B2B multi-tenant. (pesado — despacha.

luanpdd/kit-mcp · 53 tokens

backend-architect

Design RESTful APIs, microservice boundaries, and database schemas. Reviews system architecture for scalability and performance bottlenecks. Use PROACTIVELY when creating new backend services or APIs.

einverne/dotfiles · 41 tokens

cqrs-specialist

Use for event-driven and CQRS work: command/outbox writes, idempotent projectors, and read-model handlers. Domain-neutral; never catches errors inside a transaction boundary.

mnzralee/claude-multi-agent-architecture · 41 tokens

backend

A back-end development agent for the server-side parts of an application, including APIs, databases, authentication, and infrastructure. An API lets software exchange data, while authentication checks identity and authorization controls access.

workdd/my_claude_code_setting · 89 tokens

backend-specialist

Senior Principal Backend Engineer & Systems Architect. Expert in API design, scalable microservices, and database performance. Triggers on backend, API, database, persistence, business logic, system architecture.

Dokhacgiakhoa/Agent-Skills-4-Vibe-Coding-CLI · 44 tokens