Docs

Help

Troubleshooting

Fix comity doctor failures, hooks that don't run, MCP auth errors, revoked tokens, plan limits, fail-open and fail-closed behavior.

11 min readUpdated

On this page

Start with comity doctor in the repo where your agent runs. It prints a › hint under every warning and failure; this page explains each one.

comity doctor checks

config: not logged in

Output
✖ config             not logged in (…/comity/config.json missing and COMITY_SERVER/COMITY_TOKEN unset)

Run comity login. On a headless machine, comity login --token cmt_… or set COMITY_SERVER and COMITY_TOKEN.

server: unreachable or slow

  • unreachable: check the network, VPN or proxy, and the server URL (COMITY_SERVER, or comity login --server <url>).
  • reachable in N ms (… of it connecting), above the M ms a pre-edit check may take: before-edit checks get 400 ms once connected plus the connection setup (at most 800 ms); slower ones are skipped (the edit proceeds without coordination), or blocked in a fail-closed repo. Try another network; a VPN often adds the latency.
  • skipped checks: how many before-edit/before-command checks were skipped in the last 24 hours and why. comity status lists them with their timings (total, connection setup, DNS). The round trip line says whether the time went to the network or the server.

token: rejected by server (401)

The token was revoked (on the Team tab, or because you were removed from the org), expired, or belongs to a different server. Run comity login again. If COMITY_TOKEN is set in your shell, it overrides the stored login: update or unset it.

token: missing scopes hooks:evaluate, mcp:tools

The token wasn't created by comity login (for example a service token or a custom-scoped one). Run comity login for a personal token with every CLI scope.

git: not inside a git repository / has no commits and no remote yet

Hooks coordinate git repositories. A repo is identified by its remote, or, without one, by its first commit, so a brand-new repo works once it has a commit. Run the agent inside the repo, and make the first commit (git commit) or add a remote (git remote add origin <url>). A remote added later joins the same repo in Comity, history included.

claude_code hooks / codex hooks: not installed or missing events

Run comity init --tools claude_code (or codex) in the repo, then commit the files. If you edited the hook files by hand, re-running init restores Comity's entries without touching yours.

claude_code mcp / codex mcp: authenticates with COMITY_TOKEN, which is unset

The MCP entry was written by an older CLI or by hand and relies on COMITY_TOKEN. Re-run comity init --tools <tool> to use comity mcp-headers, or set COMITY_TOKEN.

claude_code trust: Claude Code hasn't trusted this folder yet

The repo's .mcp.json gets its token from comity mcp-headers, which Claude Code runs only in folders it trusts, and COMITY_TOKEN isn't set. Claude Code's MCP connection to Comity fails (401) and the agent gets no Comity tools, although hooks may still run. Start claude in the repo once and accept the trust prompt (claude -p doesn't ask and doesn't trust the folder), or set COMITY_TOKEN. Doctor reads the trust flag from ~/.claude.json ($CLAUDE_CONFIG_DIR/.claude.json if set) and skips this check when that file is missing or unreadable. When Claude Code has never been started in the repo, the line is an i note instead of a warning and doesn't change doctor's exit code: ignore it if you don't use Claude Code.

codex trust: Codex hasn't trusted this project yet / is marked untrusted

Codex loads a project's .codex/hooks.json and .codex/config.toml only in trusted projects, so the agent gets no Comity hooks and no comity MCP server, and Codex doesn't say so. Start codex in the repo and trust it, or set [projects.'<repo path>'] trust_level = "trusted" in $CODEX_HOME/config.toml (default ~/.codex/config.toml). Doctor only reads that file, and skips the check when Codex has no home folder on this machine. When Codex has never been asked about this project (no entry in that file), codex trust and a not-yet-approved codex hook trust are i notes that don't change doctor's exit code: ignore them if you don't use Codex.

codex hook trust: not approved yet / changed since you approved them / turned off

Codex runs a hook only after you approve it in /hooks, and pins the approval to the hook's exact definition ([hooks.state."…"] trusted_hash in $CODEX_HOME/config.toml). When comity init rewrites .codex/hooks.json, for example after a CLI update, the changed hooks stop running until you approve them again. Open /hooks in Codex and approve the comity hooks. In codex exec, the only alternative is --dangerously-bypass-hook-trust.

omp mcp: no timeout / timeout below 60 s

omp cancels an MCP call after 30 s unless the server entry sets timeout (milliseconds), but wait_for and inbox with wait_seconds wait up to 55 s, so those calls fail with "Request timeout after 30000ms". Re-run comity init --tools omp to write "timeout": 120000 into .omp/mcp.json.

omp extension: is outdated / not the Comity bridge

Re-run comity init --tools omp after updating the CLI; it rewrites .omp/extensions/comity/index.ts. Commit it: omp keeps running the old bridge (doctor names its version, e.g. "bridge v1, this CLI writes v2") until the file is rewritten, without the newer bridge's fixes.

Line endings don't count: a CRLF checkout (core.autocrlf=true on Windows) of a current bridge, plugin or rules file is reported as current (CLI 0.6.2 and later).

For the user-level bridge (~/.omp/agent/extensions/comity/index.ts), re-run comity init --global --tools omp instead.

claude_code subfolder / omp subfolder: hooks won't load from this folder

Doctor ran in a subfolder of the repo, such as apps/web in a monorepo. Claude Code reads .claude/settings.json and omp reads .omp/extensions only from the folder they start in, so an agent started here runs none of the hooks committed at the repo root. Its MCP tools may still work, which makes this easy to miss: the session, its edits and its conflicts never reach Comity. Start the agent at the repo root, or run comity init --global (Claude Code) or comity init --global --tools omp (omp) once on this machine for user-level hooks. See Monorepos.

If the detail says the user-level hooks only act in repos with a comity.json, the repo isn't bound yet: run comity init at its root and commit comity.json.

round trip: session_start failed

The server is reachable and the token valid, but the hook endpoint failed. The detail shows why. Until it works, agents run without coordination (fail-open).

The round trip is a read-only probe: it starts no agent session, so it doesn't mark your messages as delivered, doesn't tell teammates you came online, and doesn't count you as an active developer. Since CLI 0.6.2 doctor sends probe: true; the server treats round trips of older CLIs the same way.

coordination: Comity isn't coordinating this repo

The round trip worked, but the server would step aside in this repo, and agents here get the same notice at SessionStart. The detail says why and the › line what to do:

  • Not part of the org: the org turned off automatically adding repositories and this repo has no comity.json naming the org. Run comity init --org <org> and commit comity.json, or ask an owner or admin to add the repo.
  • Plan repo limit: the plan's repos are all registered. An owner can upgrade or archive a repo.
  • Organization suspended: an owner can contact support.

Agents keep working normally in the meantime; Comity just doesn't coordinate them.

CLI up to date: newer version available

Run comity update.

Hooks don't seem to run

  1. Codex: open /hooks in Codex and approve the comity hooks. Codex skips unapproved project hooks, and comity doctor can't see the approval.
  2. Claude Code: accept the folder trust prompt. Untrusted folders don't run project hooks.
  3. Started in a subfolder: Claude Code and omp load the committed hook config only from the folder they start in. Run comity doctor in that folder; it warns claude_code subfolder / omp subfolder and names the fix.
  4. Cursor: turn on Include Third-Party Plugins, Skills, and Other Configs (Cursor Settings → Agents → Third-Party Imports) and check the Hooks output channel.
  5. The CLI isn't on the agent's PATH: the committed hooks exit silently when comity isn't found. Run command -v comity (or where comity on Windows) in the environment the agent starts from.
  6. Not logged in on this machine: hooks skip silently without a server and token.
  7. Look at hook.log in the CLI config folder (~/.config/comity/hook.log, or %LOCALAPPDATA%\comity\hook.log on Windows). Every hook that failed open writes one line with the host, event, session and error.

Your session should appear in the dashboard under Activity within seconds of starting the agent.

The agent never mentions Comity

Ask it: "What did the Comity briefing at session start say?" If it has none, the SessionStart hook didn't run (see above). If it has the briefing but doesn't use the MCP tools, check the MCP connection (/mcp in Claude Code or Codex) and add the agent instructions to CLAUDE.md / AGENTS.md.

MCP errors

Error Fix
401 unauthorized when connecting The client sent no token or a revoked one. Claude Code runs comity mcp-headers only in trusted folders; elsewhere it falls back to COMITY_TOKEN. Cursor and other clients need COMITY_TOKEN exported before they start.
Tool error listing several repos You have recent sessions in more than one repo; pass repo or session_id.
plan_limit (402) See Plan limits.
rate-limited (429) More than 20 messages per minute (200 per day) or 10 questions per minute (100 per day). Wait for Retry-After.
403 forbidden (token lacks scope mcp:tools) The token lacks mcp:tools (service tokens can't have it). Use a personal token.
Not found (404): session not found The session_id passed isn't one of your sessions. Copy it from "Your Comity session: …" in the current briefing, or omit it.

"This repo uses Comity org X"

The repo's comity.json binds it to org X, and this machine has no login for X (or only one on a different server). Hooks send nothing to any org, the agent gets this notice once per session, and the MCP helpers exit with the same message. Run the command it shows:

Terminal
comity login --org X

If the repo should belong to another org, rerun comity init --org <org> and commit the new comity.json.

409 org_mismatch

In a bound repo the CLI sends X-Comity-Org. When COMITY_TOKEN (or another credential) belongs to a different org, the server answers 409 org_mismatch before recording anything, and the agent gets the same "This repo uses Comity org X" notice. Unset COMITY_TOKEN or set it to a token of org X, or run comity login --org X.

Repo without comity.json

Repos set up before CLI 0.6 have no comity.json. They keep reporting to your default org (comity orgs shows it; change it with comity use <org>). If you're in several orgs, run comity init in the repo to bind it and commit comity.json, so every teammate's agents report to the same org.

Repo not added to the org

When an owner or admin turns off Settings → Data → New repositories, hooks in a repo the org doesn't know yet register nothing, unless the repo's comity.json names the org. The agent works uncoordinated and gets one notice per session ("… isn't part of the Comity org …"). To add the repo, run comity init --org <org> in it and commit comity.json, or ask an owner or admin to add it.

Token revoked or member removed

A revoked token fails everywhere at once: hooks skip silently (fail-open), MCP returns 401, comity status shows token rejected by server. Run comity login on that machine. A removed member's tokens are revoked for that org.

Plan limits

On the Free plan, the first 5 developers active in a month are coordinated; others aren't, until the next month or an upgrade:

  • their agents get one notice per session ("Comity plan limit: …") and then run uncoordinated (hooks allow everything),
  • their MCP tools return plan_limit,
  • comity status shows over limit and who isn't coordinated.

A 4th repository on Free isn't registered: hooks in it allow with a notice. An owner can upgrade in Plan & billing (in the dashboard's sidebar); caps lift immediately. See Billing & plans.

Fail-open behavior

Comity never stops an agent because Comity itself has a problem, unless your policy asks for it (next section). When the API is unreachable, slower than its limit before an edit (400 ms once connected plus the connection setup, at most 800 ms; 1.5 s for other events), or returns an error, the agent proceeds as if Comity weren't installed, and one line goes to hook.log. A skipped before-edit check is also logged for comity status, and Claude Code, Codex and omp show you a notice once per session (again after 30 minutes if checks keep being skipped): "Comity check skipped for this edit: no answer from api.comity.so within 490 ms (the limit). Your edits weren't checked for conflicts." Blocks only happen when the API answers with a block under your policy. If you expected a block and didn't get one, check comity status and comity doctor.

Edits blocked: "Comity is unreachable"

The repo's policy is fail_mode: "closed" (or the path is a protected path with fail_closed), and the hook couldn't reach Comity: network error, no answer within 400 ms, or a server error. hook.log has a fail-closed line with the cause. Reads and read-only shell commands still work.

  1. Run comity doctor. Fix the server check (network, VPN, proxy, COMITY_SERVER); the agent's next attempt goes through as soon as Comity answers.
  2. If Comity itself is down and the work can't wait, run comity fail-open --for 1h --reason "…" in your terminal (or start the agent with COMITY_FAIL_OPEN=1). Your org's owners see each use in the audit log once Comity is back. End it with comity fail-open --off.
  3. An admin can switch to fail_mode: "open" in Settings → Coordination → If Comity is unreachable → Keep working (org default), or for one repository in Settings → Coordination → Protected paths → Edit → When Comity is unreachable → Allow edits; machines pick it up with their next successful hook call.

comity fail-open --status shows the fail mode this machine last saw for the repo.

Windows

  • Claude Code runs hook commands through Git Bash; install Git for Windows.
  • Codex runs them through Windows PowerShell; comity init writes a commandWindows variant that finds comity.cmd and works under the default execution policy.
  • comity update failing with EBUSY/EPERM: close other terminals and agent sessions using comity, then run the printed npm install -g … command.

Still stuck

Run comity doctor --json and comity status --json, include the last lines of hook.log, and email hello@comity.so.

Try Comity now.

Start free →

npm i -g comity-cli && comity login && comity init