Coding agents

Using coordinate with coding agents

coordinate can only limit work that goes through it. Start with the skill and a rule, then add the guard or seats for the tools you use.

Teach your agents

  1. Copy skills/coordinate/SKILL.md into your agent's skills directory, for example ~/.agents/skills/coordinate/. It covers the commands and when to queue work.

  2. Add this rule to your agent's global instructions, such as ~/.claude/CLAUDE.md or AGENTS.md:

    All background/headless agent sessions and batch jobs on this machine MUST be enqueued as coordinate queue jobs (coordinate enqueue), never spawned ad hoc. Queue caps are the device OOM control. Only interactive, user-watched work may run outside the queue.

Agents can still ignore instructions. The guard and seats add checks outside the prompt.

Add the guard

coordinate-guard is a PreToolUse hook for Claude Code and Devin. It blocks the shell commands it recognizes as starting an agent outside a coordinate job. It can miss some commands, and it doesn't see sessions that start without a shell command. Use coordinate audit to find those.

coordinate-guard-install --dry-run
coordinate-guard-install --mode warn

--mode warn adds a note without blocking. To switch to blocking, run coordinate-guard-install --uninstall, then coordinate-guard-install.

Give T3 Code sessions a seat

A seat reserves part of the machine's capacity for an interactive session. coordinate-seat-install adds seats to the T3 Code providers it supports:

coordinate-seat-install --dry-run
coordinate-seat-install

Sessions that are already running get a seat the next time they start. You can also wrap a session yourself with coordinate run. See Sessions, seats and drift.

Check for drift

coordinate audit --drift-only lists agent sessions that have neither a job nor a seat. It only reports them.

To have the daemon run the audit and record session_drift events, set mode = "full" under [observability] in config.toml. The default, queue-only, doesn't look at sessions outside coordinate.

What a running job can see

The daemon sets these variables for every job it starts.

Variable Value
COORDINATE_JOB_ID The id of this job
COORDINATE_MACHINE The machine name. The daemon records it in the queue database when it claims a job, so the daemon, cap show and forward all use the same name
COORDINATE_DB The database file
COORDINATE_DEADLINE_AT Epoch-second deadline of this attempt, empty when uncapped
COORDINATE_ATTEMPT 1-based attempt number of this run
COORDINATE_MAX_ATTEMPTS Maximum attempts before the job goes dead

The first four also have FLEET_* equivalents.

A job can read its own row with coordinate status --self and the queue with coordinate stats.

Handle retries

Jobs run at least once, so a retried or resumed job can repeat side effects from an interrupted attempt. If a job writes files, sends messages or calls paid APIs, check COORDINATE_ATTEMPT. A value above 1 means work may repeat. Use a marker file or idempotency key to prevent duplicates.

Follow the queue from outside

coordinate forward --exec '<command>' runs a command for each event, such as sending a notification, posting to a chat or updating a dashboard. It saves its position under $XDG_STATE_HOME/coordinate/, so it continues from there after a restart.

Use coordinate events --follow when your consumer needs to keep state, for example to aggregate events, remove duplicates or release jobs automatically. It prints one JSON event per line. The extension skill covers both approaches.