Steer Your Coding Agents, Don't Babysit Them
DEV Community

Steer Your Coding Agents, Don't Babysit Them

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.

I was the doorman

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.

Why auto-accept wasn't enough

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.

Automated, or safe

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.

Three layers, three jobs

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 and when : 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.

From an idea to merged code, step by step

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.

Step 1: Plan the work with agent-skills 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.

Step 2: Label what an agent can do alone /hb:to-tickets labels every ticket:

  • agent-ready : an agent can finish it alone, from the ticket, the spec, and the code
  • hitl (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

Step 3: sandwright picks the ready tasks 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:

  • It's open.
  • It's labelled agent-ready.
  • Every issue blocking it is closed.

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.

Step 4: Each task gets its own sandbox Every queued issue becomes a run, and each run gets:

  • Its own git worktree : a separate checkout of the repo, so two agents never touch the same files
  • Its own branch , named after the issue, such as sandwright/42-theme-toggle-20261206-2210
  • Its own Sandcastle sandbox around a fresh Claude Code process, with an empty context window

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.

Step 5: Runs work in parallel --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:

  • Nothing is shared. Each run has its own worktree, branch, sandbox and context, so one confused agent can't confuse another.
  • One budget for the batch. --budget 2h covers the whole batch. When it runs out, runs still going are stopped, and their branches are kept.
  • Merges wait their turn. Runs finish in any order, but sandwright merges them one at a time after the batch. A run that conflicts with an earlier merge keeps its branch, and sandwright continue gives it another pass.

Step 6: Each run checks its own work 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.

Step 7: sandwright lands what passed 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.

Step 8: I review in the morning The terminal where I started the batch ends with a summary: done#42sandwright/42-theme-toggle-20261206-2210 3 commitsmerged done#45sandwright/45-theme-color-meta-20261206-2210 1 commit merged incomplete#43sandwright/43-use-system-preference-20261206-22101 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.

Across all my projects

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.

What's shared, and what each project owns 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.

Adding a project

A new repo takes a few minutes: sandwright init in the repo creates .sandwright/ with a config file and an example brief. Fill in the config : what to copy, what to run before the agent starts, which checks prove the work. sandwright doctor checks the sandbox, the login, my skills folder and the project, with a fix for each problem. /hb:setup from agent-skills creates the agent-ready and hitl labels in that repo's GitHub. Commit .sandwright/, so the setup travels with the repo.

From then on, the repo's backlog is something agents can pick from.

Running several projects at once

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

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.