My Claude Code Setup for Laravel Development
I've been using Claude Code as my primary AI coding assistant for several months now. Not the IDE extension - the CLI tool that runs in your terminal and has direct access to your project files. After plenty of trial and error, I've landed on a setup that works well for Laravel development. Here's what I'm running and why.
- Laravel Boost: CLAUDE.md and MCP Tools in One Package
- Global Plugins
- Custom Skills: Domain-Specific Knowledge on Demand
- Permission Allowlists
- Settings That Matter
- What Actually Changed
Laravel Boost: CLAUDE.md and MCP Tools in One Package
The single most impactful thing you can do with Claude Code is write a solid CLAUDE.md file. This file lives in your project root and gets loaded into every conversation. Claude reads it before doing anything, so every response follows your rules.
For Laravel projects, you don't have to write this from scratch. The laravel/boost package handles both sides of the equation: it generates a CLAUDE.md tailored to your project and ships an MCP server that gives Claude live access to your application. One dev dependency, two major capabilities.
The CLAUDE.md Side
Laravel Boost detects your installed packages, their versions, and produces guidelines specific to your stack. Boost is Laravel's official package for AI-assisted development. My generated CLAUDE.md covers framework versions (PHP 8.5, Laravel 12, Tailwind CSS v3, PHPUnit 11), code conventions, testing enforcement, and formatting rules. Claude won't suggest deprecated APIs or patterns from older versions when it knows exactly what you're running. You can customize it further with your own conventions on top of what Laravel Boost provides.
A few rules that made the biggest difference:
- Testing enforcement. Every change must be tested. Write a new test or update an existing one, then run the affected tests. This is non-negotiable - Claude will write PHPUnit tests for every feature and bugfix without me asking.
- Code formatting. Claude runs
vendor/bin/pint --dirty --format agentafter modifying PHP files. Pint enforces consistent code style, and the--dirtyflag means it only formats changed files. Every file Claude touches matches the project's style automatically.
The MCP Server Side
MCP (Model Context Protocol) servers give Claude Code access to live tools that interact with your application. Boost ships with tools specifically designed for Laravel apps. The ones I use most:
search-docs- Searches version-specific Laravel documentation. Before making any code change, Claude queries this tool to get current docs for the packages I'm using. It catches version mismatches I'd otherwise miss.database-schema- Inspects table structure directly. When Claude needs to write a migration or update a model, it checks the actual schema first instead of guessing based on the model file alone.database-query- Runs read-only queries against the database. Useful for debugging data issues without switching context to a database client.list-routes- Shows registered routes. Claude checks existing routes before suggesting new ones, which prevents conflicts and keeps naming consistent.last-error- Retrieves the most recent application error. When something breaks, Claude can read the actual exception instead of guessing what went wrong.
Boost isn't the only MCP server I run. I also use @smartbear/mcp for BugSnag integration. Claude can pull the latest errors and crash reports directly from BugSnag, see which bugs are trending, and read full stack traces - all without me opening the BugSnag dashboard. When I ask Claude to fix a bug, it checks BugSnag first, finds the exact error, and suggests a fix based on the real stack trace instead of my description of what went wrong.
The combination of CLAUDE.md rules and live MCP tools means Claude understands your project's conventions, checks real schemas before writing migrations, and reads actual errors instead of guessing. It stops generating code in isolation.
Global Plugins
Beyond project-level configuration, I run five global plugins that apply across all projects:
- Superpowers - Adds structured workflows for planning, code review, TDD, brainstorming, and debugging. Instead of Claude diving straight into code, these skills enforce a think-first approach. The brainstorming skill alone has saved me from several poor architectural decisions.
- Context7 - Automatically fetches current documentation for any library or framework I'm working with. When I ask about a specific API, Claude pulls the latest docs instead of relying on training data that might be outdated.
- Playwright - Browser automation. Claude can navigate to pages, take screenshots, fill forms, and inspect network requests. Useful for verifying frontend changes without leaving the terminal.
- Code Simplifier - Reviews recently modified code for clarity and maintainability. I run this after completing a feature to catch unnecessary complexity while it's still fresh.
- Frontend Design - Generates polished UI code that avoids the generic "AI-generated" look. Particularly useful for one-off components where I need something that looks good without spending time on design.
Custom Skills: Domain-Specific Knowledge on Demand
Skills are markdown files that Claude Code loads when relevant. They're like specialized instruction sets that activate based on context. I use a mix of project-level and global skills:
/laravel-best-practices(view skill) - This is the big one. It contains 20+ rule files covering everything from N+1 query prevention and eager loading patterns to security practices, caching strategies, and Eloquent conventions. When Claude writes a query, it checks for N+1 issues. When it creates a controller, it follows the same authorization patterns I use everywhere else./tailwindcss-development(view skill) - Activated whenever I'm working on frontend components. It covers responsive grid layouts, dark mode variants, spacing conventions, and common pitfalls. Keeps Claude from generating utility classes that don't exist in Tailwind v3 or using patterns that only work in v4./medialibrary-development(view skill) - I usespatie/laravel-medialibraryfor file uploads. This skill teaches Claude the correct API for associating files with models, defining media collections and conversions, and retrieving URLs. Without it, Claude tends to hallucinate method names or use outdated syntax./seo-audit(view skill) - Audits pages for technical SEO issues, meta tags, and ranking problems. I run this after building or changing any public-facing page./copywriting(view skill) - Guides Claude through writing marketing copy with proven frameworks. Covers headlines, CTAs, page structure, and voice. I used it to write this blog post./page-cro(view skill) - Conversion rate optimization for any marketing page. Analyzes layout, copy hierarchy, and CTA placement to identify what's hurting conversions./content-strategy(view skill) - Helps plan what content to create, topic clusters, and editorial calendars. Useful when deciding what to write about next./analytics-tracking(view skill) - Sets up and audits event tracking, UTM parameters, and conversion funnels. Makes sure I'm actually measuring what matters.
These skills turn Claude Code into more than a coding tool. The marketing and SEO skills are particularly useful for solo developers who handle both the product and the growth side.
Permission Allowlists
Claude Code asks for permission before running commands or accessing tools. This is a good security default, but it gets tedious fast. I maintain allowlists at both the global and project level so common operations run without interruption.
At the project level, I've allowlisted:
php artisancommandsgit add/commit/checkout/logcomposer update/requirenpm runvendor/bin/pint- Playwright MCP tools
At the global level:
- Common read operations (
grep,ls,find) - Web fetches to specific domains
- All Laravel Boost MCP tools
The pattern I follow: start restrictive, then allowlist commands as they prove safe and frequent.
Settings That Matter
- Always thinking enabled. Claude Code has an extended thinking mode where it reasons through problems before responding. I keep this on permanently. The responses are slower but significantly better, especially for debugging and architectural decisions.
- Effort level set to medium. This balances response quality with speed. High effort is available for complex tasks, but medium handles 90% of daily development work well.
- Custom status bar. Claude Code lets you replace the default status line with a custom shell script. Mine shows the current project directory, model name, effort level, a context window usage bar that changes color from green to yellow to red as it fills up, the current git branch, and lines added/removed. It's a small thing, but having context usage visible at all times helps me decide when to start a fresh conversation before hitting limits.
- Remote control from mobile. Claude Code supports remote connections - start a session on your machine and control it from your phone through the Claude app. Kick off a task from the couch, review what Claude built while waiting for coffee, approve a commit from the parking lot. Your phone is just the interface; the dev server keeps running on your machine.
- Voice enabled. Instead of typing every prompt, I can dictate instructions to Claude Code. Useful when I'm explaining a complex task that's easier to say than type.
What Actually Changed
Before this setup, I was using Claude Code like a fancy autocomplete - quick questions, short code snippets, lots of corrections. After investing time in configuration, the dynamic shifted. The corrections I used to make repeatedly - wrong Tailwind classes, missing eager loads, outdated API calls, inconsistent naming - mostly don't happen anymore.
The setup took time. Writing good CLAUDE.md guidelines, creating skills from repeated corrections, configuring MCP tools and permissions - none of it is instant. But it compounds. Every rule you add prevents future mistakes across every conversation. I've spent many hours building this setup over time. It saves me more than that every week.