Skip to content

Agents in the pipeline: cheatsheet

FlagWhat it does
-p, --printRun one prompt non-interactively; read stdin, print, exit
--output-formattext (default), json (result, session ID, metadata, cost), stream-json (event stream)
--json-schemaStructured output conforming to a JSON Schema (with JSON output, print mode)
--allowedToolsPre-approve tools; there is no prompt to answer in a pipeline
--permission-modeSession baseline; dontAsk suits locked-down CI runs
--max-turnsCap agentic turns; exits with an error at the cap (print mode)
--max-budget-usdDollar ceiling for a run (print mode)
--append-system-prompt-filePass explicit instructions from a file
--bareSkip auto-discovery of memory, hooks, plugins; same result on every machine
--continue, --resumeShare context across runs; never between generator and reviewer

Spine of the lesson: an unattended agent is the purest test of your architecture.

Nightly batch jobBlocking pre-merge check
Who waitsNobodyA developer
ScopeWide (a whole module)Narrow (the diff only)
SpeedSlow is fineFast and predictable
On failureLog, retry tomorrowFail fast and visibly
WatchDollars per runMinutes per run
GeneratorReviewer
Carries its own reasoning and assumptionsFresh context, fresh process
Reads what it meant to writeSees only the artifact and the standards
Goes easy on itselfCatches more
Its pull requests still get reviewedNever continued from the generator’s session
  1. Fetch the bot’s prior comments on the pull request.
  2. Include them in the prompt as prior findings.
  3. Instruct: report only new or still-unaddressed issues; never repeat resolved ones.
  4. Post only the delta. State lives in the pull request, not the agent.
DoDo not
List explicit finding typesSay “be conservative” or “only what matters”
Give each type a concrete exampleMake the model guess the threshold
Name what must never be flaggedLeave style and naming to opinion
Grant permission to find nothingReward findings invented for thoroughness
PitfallCorrection
Generator reviews its own outputSeparate invocation, no shared context
Criteria as moodsExamples pin the threshold
Reposting findings each pushCarry prior findings into context
One budget for every jobBatch and blocking need opposite treatment
Standards pasted into workflow filesStandards live in checked-in project memory
LineMeaning
Nobody is there to catch it, so the design mustEvery decision made in advance, in files
A false-positive flood spends the bot’s only currencyThe team’s willingness to read it
The CI agent is the newest teammateThe repository does the onboarding
A slow blocking check gets deleted, not toleratedLatency is architecture too