Guide
What you get: Claude Code (and Codex, if you save it as AGENTS.md) starts each session knowing your Laravel app's name, stack, Artisan commands, folder layout and conventions. Best for Developers using Claude Code or Codex on a Laravel app..
Before you start
- A Laravel app
- Claude Code or Codex installed
- Laravel Pint installed if you keep the lint line
Worked example (Oct 17, 2026, Claude Code 2.1.296; Codex 0.151.0 (gpt-5.6-sol))
Input
Filled with: project_name=Brindle Clinic Booker, what_it_does=books appointments for a chain of veterinary clinics, php_version=8.3, laravel_version=12, database=MySQL 8.4, frontend=Livewire 3. Question: Without reading any files, answer from the project instructions you were given at startup: what is this project called, what exact command runs the tests, and name one rule you must follow. If you have no such instructions, say so.
Result
Claude Code: "Project: Brindle Clinic Booker, which books appointments for a chain of veterinary clinics. Test command: `php artisan test` One rule: Never skip or delete a failing test to make the suite pass." Codex: "Project: Brindle Clinic Booker / Tests: `php artisan test` / Rule: Never commit secrets or `.env` files."
Fresh copy of a Next.js 16 starter repo (the stack in the file does not exist; this checks that the file is loaded, not that the commands run). Claude Code: file saved as CLAUDE.md, run headless in plan mode; a second run in JSON mode reported 1 turn, so no files were read. Codex: same text saved as AGENTS.md in a separate fresh copy, read-only sandbox; its log shows no commands run. The user's global ~/.claude/CLAUDE.md was also loaded for Claude Code. Both answers were correct on the first try. After this test the dev-server line became its own fill-in field ({{dev_command}}) and inputs got hints.
How to check it worked
- Start a new session in the project folder and ask, without letting it read files, what the project is called and what command runs the tests. It should repeat your CLAUDE.md back.
- In Claude Code, run /memory to see which instruction files are loaded.
- If you also use Codex, save the same text as AGENTS.md (or have CLAUDE.md import it) and ask Codex the same question.
Common problems
- The agent answers with generic Laravel advice instead of your values: the file isn't being loaded. Check it's named exactly CLAUDE.md (Codex needs AGENTS.md) and sits at the repo root, then start a new session; edits don't reach a session that's already running.
- Leftover {{placeholders}}: the agent will repeat them literally. Search the file for '{{' before saving.
- The file describes commands that don't match the repo (for example a different test runner). The agent trusts the file, so keep it in sync with package/tooling changes.
- The Run line puts two commands in one code span: `php artisan serve (or composer run dev)`. Keep the one your app uses.
Log in to join the discussion.