Ok, it’s a bit of a click-baity title. Laravel Cloud isn’t unoptimised, and reducing your Laravel Cloud spend isn’t so much doing special things for the platform. Instead, it’ll require fixing problems your previous host was subsidising. Being a better developer.
I wanted to write these things down to remind my future self, and maybe help some developer friends save money too.
I have been working relentlessly on reducing my Laravel Cloud spend, ever since deciding to move all my web things to it. I’ve mostly been remembering to fix holes I was able to ignore on old hosts. Locking down which URLs will respond to bot traffic. Making pages send less data over the wire. Using cache in many more places.
There are two things I’d recommend you do:
This post is about the latter. I got tired of looking through each app to find the slowest URLs; so today I made a reusable skill to do the following:
It uses a few tools that are specific to my setup. First, there’s the tool to fetch local paths for a given GitHub repo. This is so that I don’t have to hard-code paths and URLs. I have a dynamic list of these and the tools surface that in a reusable way.
Secondly, I have a series of GitHub and Laravel Cloud MCP-esque tools I have made. The way I like to do this is by keeping the tokens/credentials for these services in an API my agent does not have access to. I have posted about this in the past, but the quickest recap I can give of it is: I made Shell to limit what the bots can do without my permission or with un-scopable credentials.
I have open-sourced Shell, so you can either base your tools on it or self-host it: assertchris/shell.assertchris.dev. Pull requests are welcome, but I will ruthlessly deprecate tools for services I do not actively use. That’s the only way I can maintain good, working software of this nature.
That’s it. The skill is at assertchris/claude-skills. Hope it helps!