Set up Laravel Boost for Claude Code, Cursor and Codex

Laravel Boost setup for Claude Code, Cursor and Codex. Install, boost:install, the files it writes, keeping guidelines current, skills, and safety.

Updated

On this page

Laravel Boost gives AI coding agents what they need to work on a Laravel app: an MCP server that can inspect the running application, guidelines written by the Laravel team, and on-demand skills. Setting up Laravel Boost for Claude Code, Cursor or Codex takes two commands: composer require laravel/boost --dev, then php artisan boost:install. This guide covers what those commands write, how to keep the guidance current, how to add your own skills, and how to stop an agent from running destructive database commands.

What Laravel Boost is

Boost has three parts.

The MCP server. Started with php artisan boost:mcp, usually by the agent itself through its MCP config. It exposes tools that read the application: app info (PHP and Laravel versions, packages, models), database connections, schema and queries, log entries, the last error, browser logs, absolute URLs, and a documentation search across more than 17,000 pieces of Laravel ecosystem documentation, matched to your installed package versions. Recent releases add a tool for recording project rules.

Guidelines. Composable instructions loaded upfront into the agent's context file: Laravel conventions, plus version-specific guidance for the packages you actually have installed (Pest, Livewire, Inertia, Tailwind, Sail, Pint and others).

Skills. Focused knowledge modules in the Agent Skills format, loaded only when the task needs them. Boost installs them based on your composer.json; for example pest-testing when Pest is present. Guidelines are always in context; skills keep the rest out until needed.

Install

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

Under Sail, prefix both with vendor/bin/sail:

vendor/bin/sail composer require laravel/boost --dev
vendor/bin/sail artisan boost:install

boost:install is interactive. It asks which features to install (guidelines, skills, MCP config) and which agents you use. To skip the feature question, pass them as flags:

php artisan boost:install --guidelines --skills --mcp

If CLAUDE.md or AGENTS.md already exists, Boost only replaces the content inside its <laravel-boost-guidelines> block. Anything you wrote outside that block is kept.

Choosing agents

Boost v2 supports Claude Code, Cursor, Codex, GitHub Copilot, Junie, Zed, OpenCode, Amp, Antigravity, Kiro, Factory, Pi and Grok Build. Pick every agent anyone on the team uses. Each one gets its own guideline file, MCP config and skills directory.

Your choices are saved in boost.json. This is the one from this site's own project:

{
    "agents": [
        "claude_code",
        "cursor"
    ],
    "cloud": false,
    "guidelines": true,
    "mcp": true,
    "nightwatch": false,
    "sail": true,
    "skills": [
        "laravel-best-practices",
        "pest-testing"
    ]
}

sail: true matters: it makes Boost write MCP configs that start the server through Sail, so the agent talks to the app inside the container.

What files it writes

The defaults for the four most common agents:

Agent Guidelines MCP config Skills
Claude Code CLAUDE.md .mcp.json .claude/skills/
Cursor AGENTS.md .cursor/mcp.json .cursor/skills/
Codex AGENTS.md .codex/config.toml .agents/skills/
GitHub Copilot AGENTS.md .vscode/mcp.json .github/skills/

Plus boost.json in the project root. For a Sail project, the generated .mcp.json for Claude Code looks like this:

{
    "mcpServers": {
        "laravel-boost": {
            "command": "vendor/bin/sail",
            "args": [
                "artisan",
                "boost:mcp"
            ]
        }
    }
}

Without Sail, the command is php and the args are ["artisan", "boost:mcp"]. If your editor needs the server registered by hand, those are the values to use.

Connecting each agent

  • Claude Code usually picks up .mcp.json on its own. If not, register it from the project directory: claude mcp add -s local -t stdio laravel-boost php artisan boost:mcp.
  • Cursor: open the command palette, run "/open MCP Settings", and turn on laravel-boost.
  • Codex is usually automatic. If not: codex mcp add laravel-boost -- php "artisan" "boost:mcp".
  • GitHub Copilot in VS Code: command palette, "MCP: List Servers", select laravel-boost, "Start server".

Commit or gitignore

The Laravel docs say you may gitignore the generated files (.mcp.json, CLAUDE.md, AGENTS.md, boost.json), since boost:install and boost:update regenerate them. The trade-off: gitignored files mean every developer runs boost:install after cloning. Committed files mean the agent works on a fresh clone, at the cost of regenerated diffs. Pick one and be consistent. Your own custom guidelines and skills under .ai/ belong in Git either way.

Keeping guidelines and skills updated

Boost writes whatever guidance the installed release bundles. Refresh it with:

php artisan boost:update

By default boost:update also looks for newly installed packages and offers their guidelines and skills. Add --no-discover to only refresh what is already there.

To refresh on every dependency update, add it to post-update-cmd in composer.json. Run from a Composer script, it is non-interactive and skips the discovery prompt:

{
    "scripts": {
        "post-update-cmd": [
            "@php artisan vendor:publish --tag=laravel-assets --ansi --force",
            "@php artisan boost:update --ansi"
        ]
    }
}

Custom guidelines and skills

Your own guidance lives in .ai/ and is merged with Boost's:

  • .ai/guidelines/*.md or *.blade.php — custom guidelines, added on boost:install. A file at the same path as a built-in guideline overrides it.
  • .ai/skills/{skill-name}/SKILL.md — custom skills, installed on boost:update. Same name as a built-in skill overrides it.

Package authors can ship guidelines in resources/boost/guidelines/core.blade.php and skills in resources/boost/skills/{name}/SKILL.md; Boost picks them up when users install.

Adding skills from GitHub repositories

Skills shared across projects belong in a repository. boost:add-skill installs them:

php artisan boost:add-skill acme/boost-skills --list
php artisan boost:add-skill acme/boost-skills --all
php artisan boost:add-skill acme/boost-skills --skill=billing --skill=tenancy

--list shows what the repository offers. --all installs everything; --skill picks by name and can repeat. --force overwrites skills that are already installed. The command runs a security audit on what it fetches; --skip-audit turns that off, which you should only do for repositories you control. php artisan boost:list-skills shows what is installed.

Guarding destructive commands when an agent drives the app

Once an agent can run Artisan, it can run migrate:fresh. Agents do this to "reset state" more often than you would like, and your local data is gone.

Laravel already has the switch: DB::prohibitDestructiveCommands() blocks db:wipe and migrate:fresh, refresh, reset and rollback. The starter kits turn it on in production. The missing piece is detecting an agent. laravel/pao provides AgentDetector, which recognizes Claude Code, Cursor, Codex, Copilot, Gemini and others.

A dedicated provider:

<?php

declare(strict_types=1);

namespace App\Providers;

use Illuminate\Support\Facades\DB;
use Illuminate\Support\ServiceProvider;
use Laravel\AgentDetector\AgentDetector;

class AgentGuardServiceProvider extends ServiceProvider
{
    public function boot(): void
    {
        DB::prohibitDestructiveCommands($this->app->isProduction() || $this->isAgent());
    }

    protected function isAgent(): bool
    {
        if (! class_exists(AgentDetector::class)) {
            return false;
        }

        return AgentDetector::detect()->isAgent;
    }
}

The class_exists() check matters because laravel/pao is a dev dependency. A production deploy with composer install --no-dev removes it, and production is covered by isProduction() anyway.

Register it last in bootstrap/providers.php. prohibitDestructiveCommands() is a static setter and the last call wins. The starter kits' AppServiceProvider already calls it with app()->isProduction(); if your guard boots first, that call resets it to false and the guard does nothing. Details in /troubleshooting/ai-agent-guard-does-nothing.

The alternative is one line in the existing AppServiceProvider:

DB::prohibitDestructiveCommands(app()->isProduction() || AgentDetector::detect()->isAgent);

Verify it for real: ask the agent to run php artisan migrate:fresh. It must warn and refuse.

When boost:install says there are no boost commands

ERROR  There are no commands defined in the "boost" namespace.

This means laravel/boost is not actually installed, so its service provider was never discovered. Check that laravel/boost appears in composer.json under require-dev. We have seen composer require laravel/boost --dev report "Nothing to install, update or remove" without adding the package. Running the same composer require again has fixed it every time so far. If it persists, run composer dump-autoload to rerun package discovery, and clear any cached config with php artisan optimize:clear. Full write-up: /troubleshooting/boost-no-commands-defined.

Doing all of this in one run

Kalimera installs Boost as part of scaffolding a new app, unattended. You pick the agents upfront; kalimera writes boost.json with them, runs boost:install --guidelines --skills --mcp --no-interaction, pulls skills from the GitHub repositories you list with boost:add-skill <owner/repo> --all, and finishes with boost:update --no-discover --no-interaction so the guidance is the latest rather than what the release bundled. It also installs the agent guard above, registered last. See /guides/laravel-project-setup-checklist for everything else a new project needs.

Kalimera also ships its own Agent Skill. Symlink it into Claude Code once:

ln -s ~/.composer/vendor/welldigit/kalimera/skills/kalimera ~/.claude/skills/kalimera

Then /kalimera in any session has the agent ask kalimera's prompts in its own interface (starter kit, Sail services, packages, Boost agents), write them into a config JSON, and run the installer with --defaults. It verifies the result and resumes failed runs. The skill is plain Markdown in the Agent Skills format, so Cursor, Codex and other skills-aware tools can use it too: copy or symlink skills/kalimera/ into their skills directory.

All of it, in one unattended run.

kalimera makes these choices once, upfront, then scaffolds a fresh Laravel app with every piece wired and committed.

$ composer global require welldigit/kalimera

Read the docs