Agents & MCP.

Agents don't need the CLI — they call Regente's tools over the standard MCP stdio transport (newline-delimited JSON-RPC). regente install wires the server into each tool's config, and the session hook auto-joins the workspace when a session starts.

The tool surface

The bridge registers the coordination tools agents use most:

join_workspace(agent, tool?, role?, task?, state?)Attach to the shared repo. The session hook calls this automatically on start.
heartbeat(agent, task?, state?, …)Every Regente MCP tool call auto-refreshes your presence (throttled to once per 20 seconds by default; REGENTE_AUTO_HEARTBEAT_INTERVAL_MS overrides), and hook-joined agents heartbeat via hooks, so both paths behave the same. Call this explicitly only to update your task or state text.
list_symbols(path)List the claimable functions/classes/methods in a file (JS/TS, Python) with line ranges — so you can claim one symbol instead of the whole file.
claim_path(agent, path, symbol?, mode?, reason?, fence?, priority?)Claim before editing — a whole file, or one function with symbol. Returns a fence; a blocked claim returns an error with a resolution (see below).
release_claim(path, symbol?, agent?, fence?)Release a file or symbol claim you can prove you own (fence or agent) — auto-hands it to the next waiter.
check_edit(agent, path, line?, symbol?)Ask whether you're allowed to edit BEFORE editing, symbol-aware (line resolves to its function). Returns {allowed, reason, holder} plus recent_editors: the other online agents that edited this exact file in the last 30 minutes, so you see interleaved-edit risk even when no claim exists.
share_context(agent, text, kind?, paths?, task_id?) · read_context(path?, task_id?, agent?)Share / read the WHY: decisions, findings, warnings tied to files or a task. Relevant entries auto-deliver via check_handoffs.
check_handoffs(agent, cursor?)In-band inbox: learn that a file was auto-handed to you, plus the semantic-coupling warnings for files you hold. Carry the returned cursor to the next poll.
list_queue()Inspect the auto-handoff queue.
check_conflicts()Current conflicts (block + territory).
assign_role(agent, role, paths?, description?, summon?)Take a role and its lanes (comma-separated globs), or just claim files and let Regente infer your lane. summon declares a shell command Regente runs (fire-and-forget, once per task and assignee, with REGENTE_SUMMON_* env vars) when a task is assigned to this role while its agent is offline. Because it executes on the host, summon is operator-configured: over MCP it is accepted only when the bridge runs with REGENTE_MCP_SUMMON=1 (use the regente CLI or /api/role otherwise); config.summon_default is the fleet-wide fallback, REGENTE_SUMMON_DISABLE=1 turns it off.
list_roles() · list_lanes()Declared roles + their lanes, and the lanes Regente inferred per agent from their claims (zero-config territory).
post_message(from, text, to?, type?, task_id?)Post to the backchannel (type=announcement for fleet-wide updates); task_id links the message to a task. Hook-wired agents (Claude Code, Codex, Gemini CLI) receive direct messages IN-SESSION on their next prompt or tool use: the heartbeat hook injects them (model-visible context on Claude Code) and stamps delivered_at. Direct messages carry delivered_at and read_at (stamped on ack), shown as receipts in the dashboard, so a sender can tell undelivered from delivered-but-unacked. Room messages carry no ack state.
ack_message(agent, id?, ids?)Acknowledge direct messages addressed to you: stamps read_at and emits a message.read event. Only the addressed recipient can ack.
call_agent(from, to, title, summary?, next?, paths?, reserve?)Call another joined agent. Creates an assigned task, direct call message, and handoff for report-back.
publish_status(agent, text, tool?, task?)Publish what you're working on.
report_usage(agent, tool?, tokens_used?, tokens_limit?, context_used?, context_limit?, source?, reset_at?)Report exact token/context usage for the dashboard's per-agent bars (CLI fallback: regente usage). Omit unknown values — Regente shows an honest unknown state and never guesses vendor limits. Like every tool call, it refreshes the caller's presence.
list_agents()The single workspace roster (Regente has no separate team-member list): returns { roster: 'workspace', total, online, offline, agents }. Each agent carries a derived presence field, online or offline, computed from heartbeat age (8 minutes) and self-declared stops, plus last_seen_at; state stays the agent's last self-reported work state, not liveness.
list_claims()Read the active claims.
list_messages(task_id?, agent?, limit?)Read recent messages, filterable by task_id or by agent (sender or recipient), capped with limit.
discover_agents()Detected agent processes in the repo.
adapter_status()Whether hooks + MCP are wired per tool.
create_handoff(from, to, task, summary, next_step, task_id?)Record an explicit handoff note; task_id ties it to a tracked task for an auditable trail.
get_relevant_context(path?)Pull the coordination context relevant to a path.

Task orchestration adds create_task, claim_task, update_task, list_tasks, assign_tasks, and advance_taskssee Orchestration. update_task records the outcome on the task itself: result (text, up to 8192 chars) and artifacts (up to 32 paths or URLs) are stored with result_by and result_at, completion events carry has_result, and check_handoffs delivers a task's result in-band to its assignee.

The fence & blocked-claim pattern

A successful claim_path returns a fence — pass it back to release_claim later to prove you still own the file. A claim on a held file comes back as an MCP error whose text leads with ⛔ and carries a machine-readable resolution; agents should read the body, not just the status:

⛔ public/index.html is held by claude (frontend)
resolution: {
  "auto_handoff": true,
  "queue_position": 1,
  "blocked_by": { "agent": "claude", "tool": "claude-code", "role": "frontend", "age_seconds": 42 },
  "recommended": "work_elsewhere"
}

You're already queued — don't spin. Either take an unclaimed file in your own lane, or poll check_handoffs on your next turn; the moment the holder releases, the file is yours with a fresh fence. MCP can't push, so this in-band poll (carrying a cursor) is the intended pattern.

Signing

The bridge holds a per-session Ed25519 key and signs each claim and message, so the event log is cryptographically attributable (verify offline with regente verify). Regente stores bounded key history per agent, so a normal MCP restart and key rotation does not invalidate older signed events. Signing is on by default; set REGENTE_SIGN=0 to disable. The engine stays backward-compatible — it accepts unsigned actions and only rejects a wrong signature once a public key is on file for that agent.

The session hook

regente install registers regente-hook in each tool's config (e.g. .claude/settings.json). On session-start it joins the workspace; later hook calls are heartbeats that refresh presence without re-declaring the session — and deliver pending direct messages into the session, stamping delivered_at — and a PreToolUse (claude-code) / BeforeTool (gemini) hook runs the edit guard. Identity is derived from the session id (not the process tree), which keeps stale "ghost" agents from accumulating — and the guard maps that session back to the agent that claimed under it, so the owner is never blocked from its own file (set REGENTE_AGENT_ID for a fully deterministic identity). Codex has hooks and MCP, but no live pre-tool edit hook in this release, so Regente installs a git pre-commit guard for Codex-driven repos. Cursor has no native hook — the default install writes its project MCP config and onboarding rules, and it joins on its first join_workspace call. After installing, restart a running session so the hook and MCP load.

Adapter health tools

Agents and humans can inspect the same adapter truth. adapter_status and regente doctor --adapters report whether the session hook, heartbeat hook, edit guard or pre-commit guard, MCP command, MCP args, env.REGENTE_ROOT, and cwd are valid. discover_agents and regente discover --json collapse helper process trees and classify sessions as connected, detected, or external.

regente doctor --repair
regente discover --json

HTTP API

For non-MCP automation, the local server exposes the same engine over loopback (127.0.0.1:8787, JSON, 1 MiB cap). Reads: GET /api/state, /api/discovery, /api/adapters/status, /api/metrics, /api/symbols?path=, delivery events in GET /api/state, and a live GET /api/events (SSE) stream. Writes mirror the CLI:

POST /api/join · /api/heartbeat · /api/claim · /api/release
POST /api/message · /api/ack · /api/handoff · /api/adapters/install
POST /api/init   · /api/task/create · /api/task/update · /api/role
POST /api/enforce · /api/context · /api/plan · /api/assign · /api/drive

The server binds to loopback only and isn't exposed on the network by default.