October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Laravel Worktrees: How to Isolate Parallel Claude Code Agents with Orca

A per-worktree SQLite database and Herd site can keep parallel Laravel agents from sharing local state. Here’s how the Orca setup and archive pattern works, including its security and cleanup trade-offs.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To run parallel Claude Code agents on one Laravel repository without making them share a database or local site, give each Git worktree its own SQLite file and Herd site. Baptiste Bouillot’s Orca setup and archive scripts automate that lifecycle: setup prepares per-worktree resources, and archive attempts to remove them before the worktree is deleted. This is one author’s implementation, not a universal Orca or Laravel recipe.

Why isolate more than the Git branch?

A Git worktree gives an agent its own working directory and branch. But separate files alone do not isolate application state: agents can still interfere if they use the same database, local domain, or service port. Bouillot’s design addresses those shared resources by assigning each worktree a separate SQLite database file and Herd site, and by deriving a Reverb port when the project uses Laravel Reverb.

As an Amazon Associate I earn from qualifying purchases.

The convention is deliberately narrow: one SQLite file and one Herd site per worktree. It is a design choice described by the author, not a measured comparison against other approaches.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What the setup script does

The setup script prepares the worktree to run as a distinct local Laravel environment. It uses Orca-provided context where available and inspects project files to choose appropriate tooling.

  1. Find the main checkout and configure the environment. The script uses ORCA_ROOT_PATH when set; otherwise, it derives the main checkout path through Git. It copies the main checkout’s .env when present, or falls back to .env.example, then exports the loaded values for later commands.
  2. Derive a worktree-specific site name. It uses ORCA_WORKSPACE_NAME or the current Git branch, sanitizes the value for a local site name, and shortens long names with a checksum suffix. The author says the length limit is intended to fit certificate common-name constraints.
  3. Point Laravel at isolated local resources. The script sets DB_CONNECTION=sqlite, uses database/database.sqlite for the database, sets APP_URL to the derived HTTPS Herd domain, and changes MAIL_MAILER to log.
  4. Assign a Reverb port when applicable. If the project uses Laravel Reverb, the script derives a stable port from the site name and writes it to several environment keys. This is the author’s collision-avoidance approach; no collision-rate measurements are reported.
  5. Prepare the local site and project dependencies. It links and secures the Herd site, attempts to isolate the PHP version parsed from composer.json, creates a fresh SQLite file, installs Composer dependencies, clears Laravel configuration, generates an application key, and runs migrations and seeds.
  6. Handle optional project files and frontend tooling. The described script can link storage, copy .mcp.json from the main checkout, conditionally handle private Composer authentication, and build the frontend using the package manager indicated by the project’s lockfile.

Secrets need a deliberate policy

Copying the main checkout’s .env is convenient, but Bouillot notes that it contains real secrets and API keys. A worktree is a separate directory, not automatically a separate trust boundary: any agent or process with access to that file may be able to use its credentials. Before adopting this pattern, decide which credentials an agent needs, whether development-only credentials can be supplied instead, and how copied environment files are protected and removed.

What the archive script removes—and what it can miss

The archive script reconstructs the worktree’s site name and checks for an empty workspace slug. It then attempts to unsecure, unisolate, and unlink the Herd site, deletes the worktree’s SQLite file, and restarts Herd.

Cleanup commands are best-effort, using || true so an individual failure does not prevent worktree deletion. That favors progress over guaranteed cleanup: if a command fails, Herd configuration or another local resource may remain. A practical workflow should provide a way to notice and remove leftovers rather than assuming that worktree deletion proves every resource was cleaned up.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reuse the scripts across repositories

Instead of maintaining a full copy of each script in every Laravel project, Bouillot stores the shared implementations in ~/.scripts/laravel/. Each repository has short shim scripts that invoke the shared setup or archive script, and the repository’s Orca settings point to those shims. The arrangement centralizes changes while retaining a per-repository entry point.

When adapting it, check that the shim resolves the shared script for the user and environment running Orca, and that the scripts handle repositories with different PHP versions, lockfiles, optional services, or credential requirements. The author describes parsing PHP from composer.json and selecting frontend tooling from lockfiles, but the article does not report a compatibility matrix or test results across projects.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

What the article does—and does not—establish

Baptiste Bouillot’s DEV Community article, published July 28, 2026, presents a first-person implementation for parallel Claude Code agents working on Laravel with Orca. It describes the resource-isolation convention and the scripts’ intended behavior; it does not provide benchmarks, a success rate, measured cost savings, or evidence that the approach fits every Laravel setup. Treat claims such as “zero manual setup” as qualitative framing rather than a measured result.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.