In the evening, I label a few GitHub issues agent-ready across my personal projects. By morning, most of them are merged: written, tested and checked by coding agents that never asked me a thing.
Getting there changed my job. I stopped approving what my agents do, and started steering them. I decide what gets built, and I review what comes back.
The loop behind it is sandwright, a tool I built to orchestrate agents across my projects.
This post covers why auto-accept wasn't enough, how sandwright, Sandcastle and my agent-skills fit together, one night of work step by step, and how it scales to every project I have.
With Claude Code in my terminal, I spent the day approving things. Run this command? Edit that file? Every few minutes the agent stopped and waited for me.
The agent could work for hours. It kept waiting for me instead. With one terminal per project, I was a full-time doorman for several agents at once.
What I wanted was a way to work on my projects that was both automated and safe. Every option I tried gave me one of the two.
My first try was the middle ground. I auto-accepted file edits, and allowlisted the commands I trusted, such as npm test and git commit.
It cut the prompts. It didn't end them. Any command outside the list still stopped and asked: a new script, a package install, a git subcommand I hadn't thought of.
Those are the moments when the agent is doing real work. Left alone overnight, one prompt at 2am meant the run sat waiting until I woke up.
The allowlist wasn't as safe as it looked, either. Approving npm test approves whatever the test script runs, and the agent can edit that script.
Rules inside the agent are a promise, not a wall. A rule that denies git push can be sidestepped by a shell script that pushes.
On my own machine, every option traded one for the other:
| Approach | Runs alone? | Safe? |
|---|---|---|
| Approve every prompt | no | yes, while I watch |
| Auto-accept and an allowlist | mostly, until a new ask | partly: allowed commands run edited scripts |
| Skip all prompts on my machine | yes | no |
| Skip all prompts in a sandbox | yes | yes, inside the walls |
Skipping the prompts on my machine wasn't an option. An agent that can run anything can also read ~/.ssh, push to main, or touch every repo I have.
The last row is the one I wanted. Instead of trusting the agent, trust the walls around it: let it run anything, somewhere it can't reach anything that matters.
With that in place, I could steer: write down the work, walk away, and come back to finished branches.
sandwright doesn't do this alone. It sits between two other pieces, and each one has a single job:
| Layer | Its job |
|---|---|
| agent-skills | How to work: my workflow, written as skills the agent loads |
| sandwright | What runs andwhen : picks tasks, runs them in parallel, merges |
| Sandcastle | Where it runs: a sandbox, a git worktree and a branch for each agent |
Sandcastle, by Matt Pocock, is the wall. It starts each agent inside Seatbelt on macOS or Bubblewrap on Linux. The agent can write only its own worktree, and it can't see my home folder, my SSH keys, or my other repos.
agent-skills is the know-how. It's the same set of skills I use in my terminal, described in My AI Coding Workflow, v3: TDD, checks before commits, how to write a commit.
sandwright is the part in the middle. It reads my backlog, hands each task to an agent inside Sandcastle, loads my skills into it, checks the result, and lands what passes.
flowchart TB
accTitle: How the three layers fit
accDescr: I plan with agent-skills and write agent-ready issues. sandwright picks them and starts one agent per issue inside a Sandcastle sandbox, with my skills loaded. sandwright checks each branch. Work that passes is merged and comes back to me. Work that fails goes back to the agent.
me["Me, with agent-skills:<br>plan and write issues"] -- agent-ready issues --> sw["sandwright:<br>picks the ready ones"]
sw -- one agent each --> sc["Sandcastle sandbox:<br>agent + my skills"]
sc -- its branch --> check{"sandwright:<br>checks pass?"}
check -- no --> sc
check -- yes, merged --> me
The name comes from Sandcastle, too. A wright is a maker, like a shipwright or a playwright. A sandwright builds in sand: the sand is Sandcastle, and the builders are the agents.
Here's the whole loop with one feature: a dark mode toggle for this blog. I plan in the evening, the agents work overnight, and I review in the morning.
I start in my terminal, with a person in the loop: me. Three skills from agent-skills turn an idea into tickets:
/hb:grill dark mode
/hb:to-spec dark-mode
/hb:to-tickets dark-mode
/hb:grill interviews me until the plan has no open questions. /hb:to-spec writes the spec as a GitHub issue. /hb:to-tickets slices the spec into small sub-issues, each one a thin slice an agent can finish in one sitting.
When one ticket needs another first, it gets a "blocked by" link to it. That gives the tickets an order without a separate plan.
/hb:to-tickets labels every ticket:
agent-ready: an agent can finish it alone, from the ticket, the spec, and the codehitl (human in the loop): I have to do something first, such as creating an API key
This label is the handoff between me and the agents. Before I leave a ticket agent-ready, I read it. Its text becomes the agent's instructions.
For dark mode, the backlog ends up like this:
| Issue | Label | Blocked by |
|---|---|---|
| #42 Theme toggle | agent-ready |
|
| #43 Use system preference | agent-ready |
|
| #44 Remember the choice | agent-ready |
#42 |
| #45 Theme color meta | agent-ready |
|
| #46 Pick the dark palette | hitl |
Before bed, I run one command in the project. Everything one run of this command starts is called a batch:
sandwright run --issues --parallel 3 --budget 2h
sandwright reads the repo's open issues with my gh login, and keeps a task only when all of these are true:
flowchart TD
accTitle: How sandwright picks a task
accDescr: For each open issue, sandwright checks the label. Without agent-ready, it's skipped. With it, sandwright checks the blockers. If any blocker is still open, the issue waits for a later batch. If all are closed, the issue is queued.
issue[open issue] --> label{agent-ready?}
label -- no --> skip[skipped]
label -- yes --> blockers{blockers closed?}
blockers -- no --> wait[waits for later]
blockers -- yes --> queue[queued]
So from the backlog above, it queues #42, #43 and #45, lowest number first. #44 waits, because #42 is still open. #46 is skipped, because it's mine to do.
Every queued issue becomes a run, and each run gets:
sandwright/42-theme-toggle-20261206-2210
My skills folder is mounted read-only inside the sandbox, so the agent follows the same rules I follow in my terminal. The prompt holds the issue, its parent spec, and the spec's comments.
--parallel 3 means three slots. sandwright fills them from the queue, and as soon as one run ends, the next queued task takes its slot. On a busier night, with five ready issues, it looks like this:
slot 1 #42 ββββββ done #47 ββββββββ done
slot 2 #43 βββββββββββββββ incomplete
slot 3 #45 βββ done #48 ββββββ done
βββββββββββββ 2h budget ββββββββββββ€
These keep parallel runs safe and predictable:
--budget 2h covers the whole batch. When it runs out, runs still going are stopped, and their branches are kept.sandwright continue gives it another pass.
Inside its sandbox, a run is a small loop. The agent works, commits, and says when it's done. Then sandwright runs my project's typecheck and test scripts in the same sandbox:
flowchart TD
accTitle: One sandwright run
accDescr: The agent works in its sandbox and commits. When it says it's done, sandwright runs the project's checks. If a check fails, the failure goes back to the agent for another pass. If the checks pass, the work is merged. If the agent runs out of passes or the budget runs out, the branch waits for me.
work[agent works, commits] --> done{done?}
done -- not yet --> work
done -- yes --> checks{checks pass?}
checks -- no --> work
checks -- yes --> merged[merged]
work -- out of passes --> waits[branch waits]
A failed check isn't the end of the run. The agent's next pass gets the task, the failing command and its output, and it fixes the cause.
Every pass starts with an empty context and the task. So pass five doesn't carry the confusion from pass one. After 10 passes by default, the run stops as incomplete.
The agent never talks to GitHub. Inside the sandbox it has a Claude login and nothing else.
When a run passes its checks, sandwright takes over on my machine, with my own gh login. It pushes the branch, opens a pull request that closes the issue, and merges it.
It refuses to push a branch that changes .github/ or adds something that looks like a secret. That split is why I trust it overnight: the agent can do anything inside its walls, and only finished, checked work leaves them.
Merging #42 closes it, which unblocks #44. The next sandwright run picks #44 up, so a chain of tickets moves one step per batch.
The terminal where I started the batch ends with a summary:
done #42 sandwright/42-theme-toggle-20261206-2210 3 commits merged
done #45 sandwright/45-theme-color-meta-20261206-2210 1 commit merged
incomplete #43 sandwright/43-use-system-preference-20261206-2210 1 commit, check still failing: npm run test
Finished work is already merged. The few runs that didn't make it wait on their branch.
I rarely read that summary in the terminal, though. sandwright also serves a dashboard on my machine:
sandwright dashboard # http://localhost:4477
sandwright dashboard --lan # also on my Wi-Fi, for my phone or tablet
It shows every run, live: its status, branch, commits, pull request and log. It can notify me when a run needs attention.
With --lan, it prints a link with a fresh token that works on any device on the same Wi-Fi. So I check the night's work from my phone over breakfast, or keep it open on a tablet while a batch runs.
The dashboard only reads: nobody can start, stop or merge a run from it. Anyone on the network with the link can still see run names and logs, so I use --lan only at home, and never share the link.
sandwright mcp is an MCP server over my runs, so I can ask Claude Code "what failed overnight, and why?", then retry, continue or discard that one run.
Everything so far happens in one repo. The point of sandwright, for me, is doing it in every repo I have, without setting it up again each time.
The rule that makes this simple: one sandwright run works on one repo. Running several projects means running several batches, side by side, from one install.
Settings live on my machine, for what's mine, or in the repo, for what's the project's.
| What | Where | Applies to |
|---|---|---|
| Sandbox, skills folder, my default limits | ~/.config/sandwright/config.json |
every project |
| The agent's Claude login | ~/.config/sandwright/env |
every project |
| My personal rules | ~/AGENTS.md ,~/.claude/ |
every project |
| How to set up, check and limit this repo | .sandwright/config.json |
this project |
| This repo's own rules | its AGENTS.md |
this project |
| A different login, if this repo needs one | .sandwright/.env , not committed |
this project |
| Run records and logs | ~/.local/state/sandwright/ |
all, in one place |
When two places set the same thing, the closer one wins: a command-line flag beats the project file, which beats my machine file.
My machine file is short, and I wrote it once:
{
"skillsDir": "~/code/agent-skills",
"defaults": { "parallel": 2, "budget": "2h" }
}
Each project commits its own .sandwright/config.json. This blog needs its packages, and checks more than the defaults:
{
"copyToWorktree": ["node_modules"],
"checks": ["npm run lint", "npm run typecheck", "npm test"]
}
agent-skills is Markdown and shell scripts, with no package.json. So it has no default checks, and lists its own:
{ "checks": ["bash scripts/check.sh"], "defaults": { "parallel": 1 } }
The two projects work differently, and the agent works the same way in both. It loads the same skills and my personal rules, then reads each repo's own AGENTS.md from its worktree.
A new repo takes a few minutes:
sandwright init``.sandwright/ with a config file and an example brief.sandwright doctor``/hb:setup
From then on, the repo's backlog is something agents can pick from.
Each batch runs on the repo it's started in, or the one --repo names. Before bed, I start one per project that has ready issues:
sandwright run --repo ~/code/helderberto.com --issues
sandwright run --repo ~/code/agent-skills --issues
Each batch has its own slots and its own budget, from its own config. With the files above, that's two agents on the blog and one on agent-skills: three at once, each in its own sandbox.
flowchart TD
accTitle: Two projects, one machine
accDescr: My machine config, skills and login are shared. Each project runs its own batch with its own slots and budget, and its agents work in their own sandboxes. Every run writes its record to one shared folder, which the dashboard and sandwright mcp read.
mine["my config, skills<br>and login"] --> blog["blog batch:<br>2 slots"]
mine --> skills["agent-skills batch:<br>1 slot"]
blog --> records[("one folder of<br>run records")]
skills --> records
records --> watch["dashboard and<br>sandwright mcp"]
The projects never touch each other. Each run's worktree lives inside its own repo, and the sandbox hides every other folder in my home, other repos included. An agent on the blog can't see agent-skills, even while both run.
Every run, from every repo, writes a record to the same folder. So the dashboard from Step 8 covers all my projects, not one repo.
It groups runs by batch, shows each run's repo, and searches by repo name. In the morning, one page tells me what landed in the blog and what's stuck in agent-skills.
sandwright mcp reads the same records, and can filter by repo. So I can ask Claude Code "which runs in agent-skills need attention?" from any project I have open.
A project file only describes setup. sandwright refuses one that holds a token, a secret-named variable, a mount, a path outside the repo, or a sandbox choice.
That matters across many repos: a repo I clone can't widen what its agents reach. Only my machine config decides the sandbox and the skills.
The flip side is the login. The token in my machine file reaches every run in every project, so I keep it to the Claude login and nothing else.
Improving the setup is one change in one place:
~/AGENTS.md, and reaches every sandbox..sandwright/config.json.
If you already drive Sandcastle from a .sandcastle/main.ts script, most of it maps to that last file. The sandwright docs have a page for that.
The walls are real, but they aren't complete. Know these before you try it:
sandwright fits work with a clear "done": a feature with tests, a bug with a reproduction, a backlog of small chores. It's not for pair programming. If I want to watch an agent and reply as it works, I still open my terminal.
Today I still start each batch, and I still read every ticket before it runs. The goal is a loop where I only steer: I set the direction and the budget, and review the results.
These are the next steps toward it:
/hb:review does for me, and sends it back when something is off. Checks catch broken code. A reviewer catches code that works but shouldn't merge.sandwright mcp is read-only today. Next, Claude Code or Codex can stop or retry a run for me, behind a confirmation.
v3 of my workflow turned my prompts into skills. sandwright runs those skills without me watching, across every project I have.
agent-skills says how to work, Sandcastle keeps the agents inside their walls, and sandwright decides what runs and when.
I plan in the evening, the agents work at night, and I review in the morning.
The code is at github.com/helderberto/sandwright. If you try it on your own projects, I'd like to hear what worked and what didn't, as a GitHub issue.
Related: