r/PHPhelp • u/judgej2 • Jan 11 '26
Laravel Herd + Claude code + Windows: how can it be made to just work?
I'm running herd under Windows, and that itself works fine. I bring up a Powershell window and can run herd php commands without a problem.
However, trying to get Claude Code to run through herd is just about impossible. I can find no documentation or articles on how to do it. Claude just tries thrashing around in the dark looking for executables, paths, etc, and sometimes finds what it needs, but will not document what it has done, so we are back to square one the next day, or the next session.
How can these things be made to work?
I'm just running in the Windows environment, and not WSL2 (WSL broke updates in my last laptop, running the CPU at nearly 100%, and burnt something out in the hardward, so reluctant to go down that route if I can avoid it).
2
u/colshrapnel Jan 11 '26
May I ask, why do you want to connect Claude with Herd? Can't you just open your favorite browser and run whatever php you just wrote?
2
u/snoogazi Jan 12 '26
IDK about Herd, but under MacOS and Linux, I run Sail. I told Claude "whenever you run artisan commands, use sail php artisan" and it's done it ever since.
I'd say give Sail a shot and see if it works for you.
2
u/acobrerosf Jan 28 '26
Hey! I just found a way to get it working!! Check my tutorial here: https://www.reddit.com/r/laravel/comments/1qpcjdz/laravel_herd_opencode_on_windows_11/
1
u/Csysadmin Jan 12 '26
Claude doesn't need to see/use herd. I feel like you're doing it wrong?
Claude shouldn't be wasting itself on handling the serving up of pages for you. It's Claude Code, not Claude Server Manager.
Throw it all into Terminal tabs in VS Code, have a tab with Claude running, have another with "npm run dev" (or whatever). Either tell Claude to prompt YOU to run any commands it needs. or, tell Claude that you have "npm run dev" running, or have another process handling x, y or z.
1
u/MateusAzevedo Jan 12 '26
A quick peek into Herd docs indicates that you don't need to run
herd php, justphpshould work too.In this case, you probably need to do as u/snoogazi said and tell Claude to just use
php artisan.1
u/acobrerosf Jan 28 '26
I might be late to this conversation but I had this same problem with OpenCode. What I did was to create a global AGENTS.md file in the opencode config folder with the following instructions: https://www.markdownpaste.com/document/opencode-laravel-herd-windows
It has improved a lot how opencode now interacts with php in my windows machine. Hopefully one day it will support powershell.
EDIT: make sure to change {user} in the paths for the actual user name in your machine
1
u/tom_swiss Jan 11 '26
Trying to use a bullshit generator to write good code without the intervention of a knowledgeable human is not something that can "just work".
Bullshit generators can be useful to summarize existing sample code, absolutely -- a neater version of "typing in things from StackExchange". (Or before that, "typing in things from USENET", sometimes.)