Why I deleted my custom Laravel AI coding guidelines
AI coding rules shrink as models mature
For months, developers maintained extensive lists of custom rules to keep AI agents from breaking Laravel codebases. Early models stumbled on PHP enums, generated duplicate migration timestamps, and ignored frontend builds. Today, frontier LLMs like Claude 3.5 Sonnet and GPT-4o have improved to the point where many manual constraints are obsolete. They handle basic casting, migration ordering, and self-debugging out of the box. Instead of writing passive rule files, we can now offload safety checks to automated tooling and robust planning phases.
Prerequisites
To get the most out of this modern workflow, you should have a solid grasp of:
- PHP 8.x and Laravel framework architecture
- AI CLI tools like Claude Code or Codex CLI
- Basic bash scripting and JSON configuration
Key libraries and tools
- Laravel Boost: An official tool by Ashley Hindel that injects deep, context-aware Laravel rules directly into your agent files.
- Vasque: A managed websocket alternative to Laravel Reverb or Pusher, also built by Hindel, perfect for handling heavy real-time data efficiently.
- context7: A global CLI documentation tool used as a fallback source when looking up Laravel docs.

Let hooks run your frontend builds
One persistent headache with AI agents is their tendency to modify Blade templates or Tailwind styles without rebuilding assets. Instead of begging the LLM to run npm run build in a text file, you can enforce this behavior using post-tool execution hooks in Claude Code or Codex CLI.
Here is how you configure a two-stage bash script check inside your global Claude directory.
First, create the change detector script (front_end_detect.sh):
#!/bin/bash
# Detect changes in frontend assets
if git diff --name-only | grep -E '\.(blade\.php|css|js)$' > /dev/null; then
touch .claude_frontend.flag
fi
Next, create the execution script (front_end_build.sh):
#!/bin/bash
# Run build if flag exists
if [ -f .claude_frontend.flag ]; then
echo "Frontend changes detected. Rebuilding..."
npm run build
rm .claude_frontend.flag
fi
Configuring settings and hook files
To execute these scripts automatically, register them in your tool's configuration.
For Claude Code, add this to your settings.json:
{
"hooks": {
"post_tool_use": {
"write_file": "/path/to/front_end_detect.sh",
"edit_file": "/path/to/front_end_detect.sh"
},
"stop": "/path/to/front_end_build.sh"
}
}
For Codex CLI, define the absolute paths in hooks.json:
{
"post_tool_use": {
"command": "/absolute/path/to/front_end_detect.sh"
},
"stop": {
"command": "/absolute/path/to/front_end_build.sh"
}
}
Keep rules for niche ecosystems
While standard Laravel patterns are baked deeply into modern models, niche ecosystems still need help. Filament v3 remains a challenge. LLMs often fallback to obsolete v2 patterns, like placing forms and tables directly inside resource files instead of separating them into distinct classes. For these specialized packages, keep your custom guidelines active until training data catches up.
- Laravel
- 33%· products
- Claude Code
- 20%· products
- Codex CLI
- 20%· products
- Ashley Hindel
- 7%· people
- Filament
- 7%· products
- Other topics
- 13%

I Deleted My Custom Laravel AI Guidelines. Here’s Why.
WatchLaravel Daily // 19:35