C² Method9 min read
How to write a prompt brief an agent can run without you
Instructions for an unattended AI coding agent need more than a goal. The execution contract I use, with excerpts from a real brief and the checklist that gates it.
Instructions for an AI coding agent depend on one thing: will you be there? If you're at the keyboard, a goal, scope and acceptance criteria are enough, because you answer the agent's questions as they come. If you won't be, the instructions have to answer those questions in advance. That means a complete execution contract: what the agent may and may not do, what to read first (by file and line), one item at a time with exact commands, what not to change, what to do when stuck, and a definition of done that needs evidence.
In the C² Method that contract is an autonomous prompt brief. The Cascade explains where a prompt brief sits, and the prompt brief is a node contract explains why its shape matters when many agents run at once. This article is the practical part: how to write one an agent can run without you, using a real brief from my own repo.
Why the brief changes when you leave the room
The rule in my main repo's CLAUDE.md is one line long:
Autonomous PBs require a complete execution contract. A PB handed to an agent without Stuart at the keyboard must specify: standing approval, pre-flight reads (named files + line ranges), per-item execution cycle (READ→IMPL→REVIEW→GROK→COMMIT), exact test/deploy/Grok commands, and a Definition of Done checklist.
(Grok is the second-opinion model I use for reviews.)
Here's the difference in practice. On 29 October 2026 I wrote a brief to dock Commander Desktop's terminals on the right-hand side. I was going to try it on my own laptop as it was built, so it was marked pilot-supervised and ran to 31 lines: the change in four points, one line on invariants, one paragraph of done.
Nine days later I wrote a brief for three changes to how Host shows releases. It would run without me. It was 391 lines long.
Neither length is wrong. In a supervised session, every gap in the brief gets filled by a question to me. In an unattended one, a gap gets filled by a guess. Claude Code makes this concrete. In a non-interactive claude -p run in Manual mode, which is where such a run starts when nothing sets a permission mode, the headless docs say a tool call needing approval is denied unless something approves it, and with --permission-prompts none the tools that ask a person, such as AskUserQuestion, are removed altogether. The agent can't ask. So the brief has to have already answered.
The rest of this article walks through the seven parts of that 391-line brief, 261107-pb-rel6c-release-modes-and-guided-setup.md, with excerpts.
1. Write the standing approval as two lists
Start with what the agent is allowed to do, and what it isn't. Make it two explicit lists. From the real brief, trimmed, with an internal agent's name replaced by its role:
## Standing Approval
You are authorised to:
- Edit apps/host/src/components/solutions/**, ... and create new files beside them.
- Edit supabase/functions/host-app-registry/index.ts (the promote branch only, ~L2685–2700)
- Create apps/help/content/user-guide/host/solution-releases.md
- Run tests, typechecks and Grok reviews. Commit to feat/host-releases-rel6c, push,
open and update a draft PR.
You are not authorised to:
- merge, mark the PR ready, deploy anything, or run a release on a real Solution;
- write or apply a migration (none is needed);
- edit .github/workflows/**, mcp/**, skills/**, packages/** ... CLI, MCP and
skill copy changes go to the coordinator as exact lines.
Three things to notice. The "can" list is scoped to paths, sometimes to line ranges inside one file. The "cannot" list names the actions that would do damage while nobody watches: merging, deploying, touching production. And it says what to do instead of the forbidden thing ("go to the coordinator as exact lines"), so the agent doesn't have to choose between breaking a rule and silently dropping work.
Make the brief and the tool permissions agree. If the brief says "run the tests" and the run's permissions don't allow the test command, the agent is stuck at the first item.
2. Pre-flight: name the files, the lines, and why
Before any code, the agent reads a short table. Every row has a path, a line range, and a reason.
| File | Lines | Why |
|---|---|---|
| apps/host/src/components/apps/DeploymentRow.tsx | L38–44, L100–102, L168–190 | Where a staged build reads as a Live "Success" |
| apps/host/src/services/appsService.ts | L75–100 | The row type (add environment, branch if absent) |
| apps/help/content/user-guide/host/data-location.md | first 40 lines | The Help page voice and front matter |
The reason column is the important one. "The Help page voice" tells the agent why it's reading a file about something else entirely.
Line ranges go stale as other work merges, so the brief carries a staleness check: "these ranges were read at c1f2cfa72 ... If they've moved, read the current code and note the delta in the session brief before coding." The agent did exactly that. Its session brief has a section called "Pre-flight deltas", lists where each range now sat, and concludes "All matched the brief; no material drift."
Add state checks that make baselines explicit: which tests pass now, which typecheck errors already exist. Without that, an agent can't tell an error it caused from one it inherited.
3. One item at a time, the same cycle every time
An autonomous brief is split into items, and each item runs the same cycle. The C² starter template writes it as:
READ → IMPL → REVIEW → VERIFY → COMMIT
My own repo's version adds a second-opinion review step and a mutation check, but the idea is the same: no item starts until the previous one is committed. That gives you a clean history to read in the morning, and if the run dies at item 3, items 1 and 2 are safe on the branch.
Each item in the rel6c brief has the same anatomy:
- What to read first: the lines for this item only.
- Today: what the code does now, in plain words.
- Change: what to build, specific enough that no design decision is left. Function signatures are written out.
- Not in scope: the adjacent things that look like they need fixing.
- Test: the exact command and what passing looks like.
- Mutation: a deliberate break the test must catch.
- Commit: the exact message.
Here is the difference between a vague item and a runnable one. Vague: "Make the deployment status clearer." Runnable, from item 1: a staged build is a row with environment = 'preview' and branch = '__staged__' ... a staged success is "Staged · waiting for release" with showsLiveLinks: false; a row with no environment is Live (control). The second leaves the agent nothing to invent.
4. Say what not to change
The template behind these briefs keeps a table of common failure modes, built from runs that went wrong. Four of its rows:
| Failure | Root cause | Fix |
|---|---|---|
| Agent rewrites adjacent code | Scope not stated | Add an explicit "What not to change" to each item |
| TypeScript errors after merge | Baseline not checked in pre-flight | Add the typecheck to the pre-flight state checks |
| Migration fails: column doesn't exist | Brief assumed column names from the PRD | Check the real schema in pre-flight |
| Commit message drift | Format not specified | Write the exact commit message in the item |
The schema row has a cost attached. In May 2026 a brief assumed a table had columns called kind and workspace_id. Production had file_kind and project_id. Item 1 was rewritten mid-session, about 20 minutes lost. Now the checklist asks for one schema query in pre-flight for every table a brief touches.
5. Exact commands, never "verify it works"
"Verify it works" is an instruction to the agent to decide what working means, and it will decide generously. Every test, typecheck and build in the brief is a literal command:
cd apps/host && npx vitest run src/components/apps/deploymentDisplay.test.ts
The same goes for the definition of done. One of rel6c's boxes is a search that must come back empty:
git grep -n -i "releases on\|releases off\|turn releases" -- apps/host/src supabase/functions apps/help/content
That's a box the agent can't tick by asserting it. It either returns nothing or it doesn't. Acceptance criteria for agents goes deeper on writing checks like this.
6. Give it a blocker protocol
An unattended agent that hits a wall will either stall or improvise. Neither is what you want at 3am. The brief tells it what to do (lightly trimmed):
### When blocked
45 minutes per item. Write the blocker in the session brief, add a line to
docs/04-operations/MAINTENANCE-BACKLOG.md, move to the next item. A Grok HIGH
finding that needs an architectural decision: commit what is safe, add a
"NEEDS STUART REVIEW" P0 note to the backlog, and stop.
Two different responses for two different problems. A hard bug gets parked and the run continues. A design decision gets surfaced and the run stops, because the agent shouldn't be making it alone.
The C² starter template adds one more line I find useful: name the layer before you report the blocker. Cannot operate (missing tool, bad permissions) is the environment. Almost works but unreliable is the loop and its stop rule. The process itself is complex is the topology. A blocker reported without its layer usually gets debugged at the wrong one.
7. A definition of done whose boxes need evidence
The last section is a checklist, and the rule about it matters more than the list. In August 2026 an audit looked at ten briefs sitting in review. Four had definition-of-done boxes with none ticked. Four had no boxes at all. One of the unticked ones was fully delivered. Another was not delivered, with three criteria contradicted by what had shipped. From the outside they looked identical.
So the checklist now has an entry rule: a brief can't move to review without a definition of done, with at least one box ticked, and each ticked box names its evidence: a commit, a file and line, a test run. A box that can't be confirmed stays open and says so. "Could not verify" is a finding. A silently empty box looks like forgetting.
Run the checklist before you leave
Every autonomous brief in my repo goes through PB-QUALITY-CHECKLIST.md before an agent sees it. Five sections:
| Section | The question |
|---|---|
| A. Scope and approval | Can the agent stay on rails? Branch named, approval explicit, "not to change" per item, blocker protocol |
| B. Pre-flight | Does it know the ground truth? Files with line ranges, the auth pattern, a typecheck baseline, real column names |
| C. Task specification | Can it run without decisions? Exact changes, test, deploy and commit commands |
| D. Definition of done | Will it know when to stop? A checklist, where the session brief goes, whether to open a PR |
| E. Sizing | Six items or fewer, each under 45 minutes, each testable alone |
One NO in sections A or B means the brief isn't ready. The checklist says each check should take under 30 seconds.
The checklist also caught a mistake in the template itself, which taught me the most important thing about writing instructions for agents. Until September 2026 the autonomous brief template told agents to add an attribution trailer to every commit, which my global rules forbid outright. Agents follow the brief rather than re-reading the conventions, so they complied, every time. It was spotted while running the checklist against a new set of briefs.
The brief outranks your rules file in practice. Whatever it says, the agent will do.
A skeleton you can copy
# PB: <title>
Branch: <name>. Full approval granted: execute all items without pausing.
## Standing approval
Authorised: <paths you may edit>, <commands you may run>, commit to <branch>.
Not authorised: merge, deploy, <forbidden paths>. For those, write the exact
change in the session brief instead.
## Pre-flight
| File | Lines | Why |
Staleness check: if lines moved, note the delta before coding.
Baselines: <test command> (note count), <typecheck> (note existing errors).
## Item 1: <name>
Read first / Today / Change / Not in scope / Test (exact) / Commit (exact)
## When blocked
45 minutes per item: write it down, move on. Design decision: commit, stop.
## Definition of done
- [ ] <check that returns evidence, not an opinion>
- [ ] Session brief at <exact path>
The work moves earlier. A brief like this takes me twenty minutes or more to write. What it buys is a run I can read in the morning, item by item, with every claim checkable against git.
Start here: the Cascade from PRD to prompt brief, how to run AI coding agents overnight, safely, or read the method.
Questions people ask
- How do you write instructions for an AI coding agent?
- For a session you are watching, a goal, scope and acceptance criteria are enough, because you answer questions as they come. For an unattended run, write a full execution contract: what the agent may and may not do, which files and line ranges to read first, one item at a time with exact test and commit commands, what not to change, what to do when blocked, and a definition of done whose boxes need evidence.
- What is a standing approval in a prompt brief?
- A section that lists, in advance, what the agent is authorised to do (edit these paths, run these commands, commit to this branch) and what it is not (merge, deploy, touch these folders). It replaces the questions the agent would otherwise ask a person who isn't there.
- Why give an AI agent line ranges to read?
- A named file with a line range and a reason starts the agent where you would start, instead of letting it spend its context deciding what is relevant. Add a staleness check: if the lines have moved, read the current code and note the difference before writing anything.
- How big should an autonomous prompt brief be?
- One pull request, six items or fewer, each under about 45 minutes. If it needs seven or more items, split it at a seam where the first half still ships something useful.
- What should an agent do when it gets stuck on an unattended run?
- Follow the brief's blocker protocol: a time limit per item, write the blocker in the session brief and the backlog, then move on. For a finding that needs an architectural decision, commit what is safe and stop, rather than deciding alone.
Part of the C² Method. Start with the method
Put this in your repo
The C² Method is free and open. Point your agent at the kit and get started in minutes.