Configuration
A Target should work with no settings at all, so every field is optional and init writes the file as {}. The file exists for what only the Target can know: which commands prove its code works, how long its CI takes, whether its Checks can share a machine, and what it calls its labels. What belongs to the Host rather than the Target is a flag of run: --lanes overrides lanes, and --api-key chooses what the Stages are billed to, which no field sets.
The file is ticket-runner.json at the Target's root. It is plain JSON, so it cannot hold comments. A Run reads it once, as it starts, from the main checkout's working tree, so an edit applies from the next Run.
| Field | Default | What it changes |
|---|---|---|
baseBranch | GitHub's default branch | The branch Tickets are branched from, rebased onto and merged into |
lanes | 1 | How many Tickets a Run holds at once |
checks | inferred from package.json | The commands the Stage prompts name and a red CI is graded with at the merge-base |
checkTimeoutMinutes | 15 | Wall-clock limit for each Check command run at a merge-base |
merge | true | Whether a Run merges a green Ticket or leaves the merge to a human |
stages | see below | Model, effort, limits and extra instructions per Stage |
permissionMode | "auto" | What every Stage session may do without asking |
ciTimeoutMinutes | 30 | How long a Run waits for a pull request's CI |
ciGraceMinutes | 5 | How long "no checks registered yet" still counts as pending |
keepTranscripts | true on a private Target, false on a public one | Whether a handed-off Ticket's transcripts are kept on the Target's remote |
labels | the six default names | The label names the pipeline reads and writes |
A file that sets several of them:
{
"baseBranch": "develop",
"lanes": 2,
"checks": ["npm test", "npm run typecheck", "npm run lint"],
"checkTimeoutMinutes": 20,
"stages": {
"implement": { "maxTurns": 400, "extraPrompt": "Run `npm run lint -- --fix` before committing." },
"verify": { "effort": "max" }
},
"ciTimeoutMinutes": 45,
"labels": { "readyForAgent": "agent-ready" }
}A file that will not load
The schema is strict. An unknown key, a wrong type or an out-of-range value is refused by name, and so is a file that is not JSON. Every command that reads the file (init, run, remove) exits 2 over it; stop never reads it.
Invalid ticket-runner.json: stages: Unrecognized key: "implment". Refused by ticket-runner 0.5.2, so the key may be newer than this install or one it no longer takes.The second sentence is added only for an unknown key: on a stale install, a key a newer version added looks exactly like a typo, and a key this version dropped is refused the same way. Check the spelling, then the version notes.
baseBranch
baseBranch: string
The base branch is the one every Ticket starts from and merges into: a Run rebases each Ticket onto it, opens the Ticket's pull request against it and pulls the main checkout to it once the Ticket merges. Without this field it is whatever GitHub calls the repository's default branch, so a Target on master needs no setting. It is resolved once at the start of a Run.
lanes
lanes: whole number ≥ 1
How many Tickets a Run holds at once, one per Lane. run --lanes <n> overrides it for one Run. Lanes' Stages run the Checks at the same time, each in its own worktree, so a Target whose Checks need a port, a database or anything else they would share keeps this at 1. Only one Lane at a time is in the Landing (rebase to merge), so more Lanes speed up implement and verify, not merging (ADR-0005).
checks
checks: array of stringscheckTimeoutMinutes: number > 0
A Check is a command the Target names, and the pipeline runs none on a Ticket's branch. The commands are for two things. The Stage prompts name them: the implement and fix Stages are told to run only the tests their change touches while they work and the full Checks once after committing, and the conflict Stage to run the type checker and the tests covering the files it resolved. And when the pull request's CI is red, the pipeline runs them itself at the branch's merge-base with the base branch, to tell a failure the branch inherited from one it brought (A failure the base branch shares), so they should be ones CI runs. What gates the merge is the pull request's CI, which the Target sets up.
Without this field the pipeline infers npm test and npm run typecheck from whichever of the test and typecheck scripts package.json defines. With neither, a Run refuses to start:
No Check commands are configured and none could be inferred from package.json. The Stage prompts name them, and a red CI is graded with them at the branch's merge-base with the base branch. Add them to `checks` in ticket-runner.json, add `test` and `typecheck` scripts to package.json, or write `"checks": []` in ticket-runner.json to run with no Check command.A Target with no Check command writes "checks": []. The Run then starts with a warning, the Stage prompts name no command, and a red CI is charged to the branch with nothing run at the merge-base.
checkTimeoutMinutes is one limit for every command run at a merge-base, and each command gets the whole of it. A command killed at the limit counts as one the base branch fails.
merge
merge: boolean
With true, the default, a Run squash-merges each Ticket whose CI is green. A Target where a human reviews and merges every pull request sets it to false. Requiring an approval on GitHub does not get you that: the pipeline acts as your account, which cannot approve its own pull request, so your own merges would be blocked too.
With false, a green Ticket is handed off rather than merged. Its pull request stays ready for review with the title and body the Run published, and a hand-off comment lists the criteria verify could not check, with their evidence; when there are none, no comment is posted. A Run that hands one off this way exits 1.
Two things the pipeline's own merge gives you then depend on the Target:
- What lands is what CI graded only when the Target requires a branch to be up to date before merging, in its branch protection rule or ruleset. The Run leaves the Landing without a merge, so its later Tickets rebase onto a base branch without the unmerged ones, and you merge in any order (ADR-0005).
- The merge message is the Target's own default, not the squash commit the pipeline composes. Where that default is the pull request body, a cloud Host's "Generated by Claude Code" line in it reaches the base branch too (ADR-0008).
stages
stages: object
Each Stage is one claude -p session. stages takes an object per Stage, and every key in it is optional:
| Stage | What it does | maxTurns | maxMinutes |
|---|---|---|---|
implement | Drives /mattpocock-skills:implement on the Ticket | 300 | 60 |
verify | Tries to prove the Acceptance Criteria are not met, and returns a verdict | 130 | 30 |
fix | Mends the one failure that spent the fix budget | 150 | 40 |
conflict | Resolves the conflict where a rebase stopped | 120 | 30 |
pr | Revises the pull request's title, body, problem and solution for a Ticket handed back with commits since its Hand-off | 60 | 20 |
| Key | Type | Default | Passed as |
|---|---|---|---|
model | string, anything claude --model takes, such as sonnet | "claude-opus-5-5" | --model |
effort | "low", "medium", "high", "xhigh" or "max" | "high" | --effort |
maxTurns | whole number ≥ 1 | per Stage, above | --max-turns |
maxMinutes | number > 0 | per Stage, above | The wall-clock limit the session is killed at |
extraPrompt | string | "" | Appended as the last section of the Stage's prompt |
The pr Stage runs only on a Ticket handed back with commits made since its Hand-off, which no Stage described (The pr Stage); the implement and fix Stages write every other pull request's prose.
The model and effort are always passed, so the machine's own claude defaults never apply. What a Stage that runs out of turns or time costs the Ticket is on From Ticket to merge.
permissionMode
permissionMode:"auto","acceptEdits"or"bypassPermissions"
Passed to every Stage as --permission-mode. Every Stage also runs with --permission-prompts none: nobody is watching, so anything that would prompt is denied instead.
CI
ciTimeoutMinutes: number > 0ciGraceMinutes: number ≥ 0
After the Landing opens a pull request, the Run waits up to ciTimeoutMinutes for its checks. CI that does not finish in time is a Hand-off that spends no fix budget.
A pull request with no checks once the wait ends merges, and its ci row reads ⚠️ no checks. The pipeline runs no Check on the branch, so such a pull request merges code nothing ran. Whether a pull request runs CI is a fact about that pull request, not about the Target: a workflow with a paths filter runs on code and skips a docs-only change, which needs nothing but a merge. A Target that needs CI before every merge says so on GitHub (below).
ciGraceMinutes covers the gap before GitHub registers a check run, which has taken over three minutes. Until it passes, a pull request with no checks yet counts as pending rather than as having none. It never outlasts ciTimeoutMinutes. Raise it on a Target whose Actions register slowly. Under 0, a pull request merges before a slow check run registers.
The wait skips ciGraceMinutes when no workflow can run on the pull request, as the workflow files on its branch say, so a Target with no CI needs no setting: a pull request with no checks at the first reading merges at once, with a ⚠️ no workflow runs row. Which workflows count as unable to run is on From Ticket to merge.
Requiring CI before a merge
A Target that needs CI, or a status a third-party app reports, before every merge sets required status checks on its base branch. GitHub then refuses a merge without them, and the Ticket is handed off at merge instead of merging unchecked. The rule has to bind the account the Run merges as, which is yours: a ruleset with no bypass for it, or branch protection with "Do not allow bypassing the above settings" ticked, since branch protection lets an admin merge past its required checks by default.
A workflow with a paths filter then filters inside its job instead, such as a step that ends the job early when the changes are ones it skips. GitHub leaves a required check pending for good when a filter skipped its workflow, so the pull request could never merge.
keepTranscripts
keepTranscripts: boolean
Whether a handed-off Ticket's transcripts are kept on the Target's remote, on the ticket-runner/state branch, where a human can still read them once the Host is gone (What stays where). A transcript holds what the Stage read and what its tools printed, word for word, so it can carry anything the Host could see, such as a file kept out of the repository on purpose or a token a command printed.
| Setting | Transcripts of a handed-off Ticket |
|---|---|
| unset, on a private Target | kept on the remote |
| unset, on a public Target | kept on the Host |
true | kept on the remote, public Target too |
false | kept on the Host, private Target too |
Unset, the Target's visibility is read once when a Run starts, and an internal repository counts as private. A Target whose visibility cannot be read counts as public, and the Run says so in one line. Kept on the Host, they stay in .ticket-runner/runs/<runId>/<n>/ on a workstation, and go with the VM on a cloud Host.
On a public Target, a pushed commit stays reachable by its SHA after the branch has moved on, and GitHub's public events feed names the SHA of every push. So the state branch, and commits it no longer points at, may hold transcripts kept before the Target was made public. Nothing removes them.
labels
labels: object of strings
Rename the triage vocabulary when the Target already uses other label strings. Only the keys you give change.
| Key | Default |
|---|---|
needsTriage | needs-triage |
needsInfo | needs-info |
readyForAgent | ready-for-agent |
readyForHuman | ready-for-human |
wontfix | wontfix |
inProgress | in-progress |
init creates the labels under these names, and a Run refuses a Target missing any of them. What each label means to the pipeline is on Planning the work.
Related pages
- Running:
--lanesand the Run that reads this file. - From Ticket to merge: where each Stage and gate sits in a Ticket's life, and where the Checks are run.
- Planning the work: the labels and what they mean.
- Install and remove:
initwrites the empty file;removedeletes it last.
References
src/config.ts,src/transcript-home.ts,src/ports/agent-runner.ts,src/startup.ts,src/base-branch.tssrc/orchestrator.ts·requireGreenCi,handOff,src/failing-base.ts,src/prompts.ts,src/adapters/claude-agent-runner.ts,src/adapters/gh-tracker.ts,src/adapters/git-workspace.ts·runCheck- ADR-0002, ADR-0004, ADR-0005, ADR-0007, ADR-0008