Worker environment variables

Set a value in the worker file before it sources tick.sh and it overrides the default. The only line that has to be there is the source line. Everything below is optional. The source itself is in tick.sh.

Worker settings

VariableDefaultWhat it does
TICKET_NAMEthe worker filename (without .sh)Log prefix, and how the ticket's owner is written
TICKET_CWDthe parent of the queue rootThe working directory of a dispatched session
TICKET_PERSONAS<root>/personasThe persona profile directory
TICKET_ONTOLOGY<root>/ontologyThe ontology directory. You can redefine it as an absolute path outside this worktree
TICKET_PROTOCOLS<root>/protocolsThe collaboration protocol directory. The AGENTS.md inside it is inlined into every prompt
TICKET_CONTEXT(none)A ("<path>|<description>" ...) array. It is attached to the tail of the prompt as reference material. A path that does not exist is skipped with only a WARN
TICKET_ENGINE(claude -p --session-id "{sid}" --dangerously-skip-permissions --input-format stream-json --output-format stream-json --verbose)The argv of the engine to run. {prompt} and {sid} are substituted right before the run. The default engine takes streaming input, so even the first prompt arrives on stdin (a FIFO). Talking to a running session is that channel
TICKET_PROMPT_FMT%s 티켓을 확인해 주세요. (...)A printf format. %s is the ticket hash and nothing else
TICKET_INPROGRESS.wipThe filename suffix for the in-progress state
TICKET_DONE.doneThe filename suffix for the done state
TICKET_MAXRUN5400 (seconds)The cap on one session's run. Past it, TERM → KILL, then back to the backlog
TICKET_FEED_TIMEOUT120 (seconds)How long to wait for the first prompt to get all the way through the FIFO. Streaming-input engines only; if the engine does not read stdin within it, the run fails as STALL
TICKET_REUSE1Session reuse. A session that finishes one ticket does not die, and takes the next ticket where it stands. 0 turns it off, and a new session starts for every ticket
TICKET_REUSE_CTX100000The context cap for allowing a handover. If the last assistant turn of the stretch that just ended used more context than this (input + cache_creation + cache_read), the session ends instead of taking another ticket

There is no setting for the queue root. Where the worker file sits decides the root on its own. Reading the real session_id out of the response JSON and correcting the frontmatter with it is a claude-only step, so another engine simply skips it.

A persona overrides the engine once more. After the ticket's persona: is settled, if a <persona directory>/<name>/engine file exists, that file is read and this array is built again from it (Personas, §Dispatch policy). What you wrote in the worker file survives only for personas that have no such file.

Machine-local state

This one changes only through the environment at the moment of the call. It is not a value you write in the worker file.

VariableDefaultWhat it does
TICKET_LOCAL~/.config/diraWhere the token (oauth-token) and the worker lock (run/) are kept. Even when the queue root is on a shared drive, this belongs to this machine alone

Next is CLI.