Skip to content

Agents

Zentri does not replace your coding agent. You keep the agent CLI you already use, signed in with your own account. zt start registers the task, creates a git worktree, writes a small kit for the agent into that worktree, and starts the agent there.

The kit is what lets Zentri see and gate the agent’s edits. Zentri ships a kit for three agents. Any other agent that speaks MCP can still use the coordinator, with weaker guarantees.

Agent Kit Version checked Page
Claude Code A plugin with hooks, the MCP server, and skills 2.1.332. Zentri refuses versions before 2.1.295. Claude Code
Codex CLI A shared zentri profile with hooks and the MCP server 0.172.0 Codex
OpenCode A plugin, the MCP server, and skills, passed in config v2.4.2. OpenCode V2 only. OpenCode
Any other MCP client No kit. Git hooks and environment variables only. Not tested with a named client Any MCP client

Zentri picks the kit from the base name of the agent command. claude gets the Claude Code kit, codex gets the Codex kit, and opencode gets the OpenCode kit. Any other command is treated as a generic agent.

Zentri has no kit, hook, or adapter for Grok Build. Nothing in the code detects it, so zt start treats it like any other unknown command.

You can still start it with zt start --agent <command>. It then gets what every generic agent gets: the git pre-commit hook and the session’s environment variables. If its CLI can load an MCP server from a config file, you can point it at zentri mcp as Any MCP client describes. Zentri has not tested this with Grok Build, and claims stay advisory, because no hook stops an edit.

The steps are the same for each agent. The agent pages add what differs.

  1. Install the agent CLI and sign in with your own account, through the agent’s own sign-in. Zentri never sees that sign-in. See Bring your own credentials.
  2. Log in to the coordinator once with zt login. See Quickstart.
  3. Run zt doctor. It checks the config, the coordinator, and the programs zt runs, including the agent CLIs. A missing agent CLI is a warning.
  4. Start a task from inside your repository.
Terminal window
zt start --agent codex "add CSV export to the reports page"

zt start picks the agent command from --agent, then ZENTRI_AGENT, then the config’s agent key, then claude. It passes the prompt as the last argument, except for OpenCode, which takes it as --prompt.

Every session gets these environment variables, whatever the agent:

Variable Value
ZENTRI_SERVER The coordinator’s URL.
ZENTRI_SESSION_ID This session’s ID.
ZENTRI_SESSION_TOKEN_FILE A file, readable only by you, that holds the session token.
ZENTRI_WORKTREE The session’s worktree.

The kit lives in <worktree>/.zentri/. That folder ignores itself with a .gitignore of *, so the kit never reaches a commit. No kit file holds the session token. The zentri binary reads it from the file.

Claude Code Codex OpenCode Any MCP client
Claim before an editor tool writes a file Yes. A failed hook blocks the edit. Yes, for apply_patch and a shell call that carries a patch. Yes. A failed hook rejects the edit. No. The agent must call zentri_claim_file itself.
Report shell edits to held files Yes, after the command Yes, after the command Yes, after the command No
Notices in the conversation At session start and on each prompt At session start and on each prompt In the system prompt, refreshed at most every 15 s Only at the end of Zentri tool results
Git pre-commit warning Yes Yes Yes Yes
MCP tools Yes Yes Yes Yes, once you configure them
PRD and ADR skills Installed Sandbox only. Copy them by hand on your machine. Installed Copy them by hand
OpenShell sandbox image Yes Yes Yes No
Model router --model flag --model flag The config’s model key No

The edit hook is how a file claim becomes a gate. Before the agent’s edit tool writes a file, the hook runs zentri hook <agent> pre-edit, which asks the coordinator for the claim. If another session holds the file, the hook denies the edit and names the holder.

The hook fails closed. When the coordinator does not answer, it retries for 8 seconds and then denies the edit with this message:

Zentri coordinator unreachable. Wait and retry this edit. Do not write the file another way.

A lead can set the project’s edits_fail_open switch to let edits go ahead when the coordinator is down. The agent is then told that Zentri did not claim the file and that it should tell you.

  • Shell writes on your machine. With the default local-dev launcher, the agent runs as you, with no sandbox. A shell command can change any file. The post-shell hook runs git status --porcelain afterwards, claims the changed paths, and tells the agent to revert any file another session holds. It detects the write. It does not prevent it.
  • An agent that removes its hooks. On your machine the agent runs as the same user that owns the kit, so it can change or delete the kit files. The kit is defense in depth there, not a wall.
  • A skipped commit hook. The git pre-commit hook only warns, and git commit --no-verify skips it.
  • An agent that ignores Zentri. A generic agent with no hooks can edit without claiming. So can a person who edits files outside a session.

The merge check is the backstop for all of these. When branch protection requires it, a pull request that changes a file its session never claimed, or a file another session holds, cannot merge. The OpenShell sandbox narrows the first two gaps: the kit is root-owned managed config under a read-only /etc, and egress is denied by default. A shell write inside the sandbox is still caught only afterwards.

  • No test runs a real agent with a model, because tests never use anyone’s agent credentials. The Claude Code kit passes claude plugin validate --strict, and the hooks run in tests through the real zentri binary.
  • Codex and OpenCode have not run with their kits. The details that only a real run would confirm are listed on their pages.
  • No vendor agent has run inside an OpenShell sandbox yet. Only a scripted stub agent has.
  • Grok Build has no kit. See Grok Build is not supported yet.