Skip to content
Scalpels home

Sign up now for $10 in credit on a new Laravel Cloud account.

Guide

Continuously improve your software with Scalpels and Solo

What you need

· Ed Grosvenor

The apps

The loop reads two apps. Hone collects your app's telemetry, and Wake collects its logs. Install them through Scalpels and then connect your apps to them. If your apps are hosted on Laravel Cloud or Forge, you can use the Scalpels MCP server to get them connected and reporting in. Here you can read more about how to attach to an existing app.

Give it some time to collect data

Hone rolls raw events up into daily aggregates on an hourly schedule. Every aggregate tool reads the rollup, so an app connected ten minutes ago answers "nothing here" to questions it will answer properly after the next rollup. Wake starts collecting log entries immediately, but if your app doesn't write many logs, it can take a while before it has anything useful to report.

As data is collected and trends emerge, the tools become even more useful. The agent can respond to any metrics that are degrading, even if they wouldn't draw its attention as a snapshot. A route that averages 800 ms might not get flagged at first, but a route that used to average 400 ms and now averages 800 ms will get a look.

A Scalpels token that can set it all up

Most people will hand this guide to an agent and ask it to build the loop for them. That agent has real work to do in Scalpels before the loop reads anything. It has to install Hone and Wake, connect your apps to them, and look up the ids that go in the ledger. Give it a token that can do that work.

Create a token on Agent access (/settings/agent-access) with:

  • Deploy apps, to install Hone and Wake on your Cloud or Forge account.
  • Connect sites, to connect your apps to them. Scalpels writes the keys into each app's environment and opens a draft pull request. Your agent is told to confirm each site with you first.
  • Call installed apps, to use Hone's and Wake's tools as you. It covers everything Read installed apps does, plus the tools that change things.

Install the token in each agent runtime that Solo launches, the way Use Scalpels from your agent describes. One token in one place is the setup people actually keep. Running several copies of the Scalpels MCP side by side, each with a different token for a different role, is more to manage, and it is not much of a boundary either. An agent that can see two connections can use whichever one does what it wants.

What keeps the loop itself in its lane is its orders. The conductor and the investigators only ever use app_read, and they are told so on every run.

Once everything is set up and the loop has run cleanly, reading is all it needs. If the loop has a machine to itself, like the Mac mini below, you can mint a second token with only Read installed apps, install that one on the loop's machine instead, and keep the more capable token wherever you do the setup work. A read token cannot reach Wake's tools that delete logs or rotate credentials, no matter what ends up in an agent's context.

Check the token by hand from a Solo agent before you automate anything:

Using the Scalpels MCP, list my teams, then the installed apps for my team, and tell me which ones are relay ready.

Every app you plan to sweep should come back relay_ready. If one does not, fix that before you automate anything. The conductor cannot read an app it cannot reach, and a sweep that fails on its first call is a confusing thing to debug on a schedule.

One failure mode here looks like a bug and is not. MCP clients cache each tool's output schema for the life of a session. When Scalpels ships an update that changes one, a tool you have already called in that session can start failing schema validation on a result that is perfectly well formed. Reconnect the client, or start a fresh session, and call it again before you look any further.

Solo on a Mac that stays awake

The conductor and the investigators are Solo agents, so Solo has to be running whenever the loop does. Put it on a machine that stays on. A Mac mini in a cupboard is ideal. Turn off sleep, sign in so Solo starts at login, and give it a project for the repositories you want improved.

Solo also ships an MCP server as a binary inside the app, at /Applications/Solo.app/Contents/MacOS/mcp. That is how the script on cron reaches Solo from outside it. The script starts the binary, speaks MCP to it, and uses the same tools your agents use. With those tools it checks on the conductor, starts it, and talks to it.

Ask an agent in Solo to call list_agent_tools. It lists the agent runtimes Solo can start, by name. The conductor's configuration names one of them, and the conductor uses the same list when it starts investigators.

The companion code

Clone the continuously-improve-your-software branch of artisan-build/scalpels-guides onto the same Mac. It holds the script cron runs and the files of instructions the agents read. It needs nothing beyond the Python that ships with macOS. The conductor walks through setting it up.

The GitHub CLI

The conductor files issues and the investigators open pull requests, both with gh. Sign it in on the Mac as an account that can open issues and pull requests on every repository involved. Let it merge them only if your remediation rules let the loop merge anywhere. If you would rather the automation had its own identity, a machine user with access to those repositories is cleaner than your own account.

A map of your apps

One piece of your software has a different id in each tool that watches it, and it takes two ids per tool to ask a question. One is the Scalpels deployment to send the question to. The other is the app's id inside the tool running there.

Tool Deployment to ask Argument naming your app Where to find it
Hone its own app_deployment app Hone's list_apps
Wake its own app_deployment app Wake's list_apps

The app_deployment column is the one that catches people out. Hone and Wake are two separate Scalpels deployments, so there is no single app_deployment for an app being watched by both. installed_apps for your team lists them. Each row is one tool, and the deployment id on that row is the only one that can answer that tool's questions.

The id naming your app has to be copied from the tool, character for character, rather than reconstructed from something that looks like it. Hone's app is the display name its list_apps returns. For a Laravel Cloud app, that is a long string that includes the environment, like Storefront (production) [env-…]. A Cloud application can have several environments, such as production and staging. Use the full display name, not the bare environment id. Wake's app is the id from list_apps, not the name beside it.

Write all of it down once, in the ledger, along with the GitHub repository each app's code lives in. The conductor reads the map on every run, and investigators use it to know which repository to work in.

Need help setting up automation to keep your Laravel app healthy?

These agencies and freelancers are standing by and ready to help.

  • Scott Keck-Warren

    Michigan

    PHP and Laravel developer with 13 years of experience building and maintaining production apps. US Eastern, English.

    Freelancer Ask for help
    Ask Scott Keck-Warren for help