Comity for
Codex

The same hooks as Claude Code on prompts, apply_patch edits and shell commands, plus the Comity MCP server. Warnings reach Codex before the edit.

Mike's Codex session: a Comity briefing that Tyler's agent changed getOrder, a warning before the edit, and Codex looking up the new signature with contract_lookup. Six comity hooks are approved, Mike's agent has claimed shared task T-3, and Codex asks before accepting a work request.

Set up in a minute

Codex runs the hooks once you trust the project and approve them.

  1. Step 1: Install and sign in

    Once on each teammate's machine. The CLI needs Node.js 22 or newer.

    $ npm i -g comity-cli$ comity login
  2. Step 2: Set up the repo

    Hooks and the MCP server go into .codex, the org link into comity.json. Commit them.

    $ comity init --tools codex$ git add comity.json .codex
  3. Step 3: Trust and approve

    Trust the project when Codex asks, then approve the comity hooks in /hooks.

    $ comity doctor✔ codex hooks all 6 events installed

What Comity adds

What the hooks and the MCP server give Codex.

A briefing at every prompt

Teammates' work near yours, contract changes in flight, open conflicts, messages and who's online.

SessionStart · UserPromptSubmit

Warnings before the edit

Codex takes context before a tool runs, so a warning reaches the agent before it writes. Blocks deny the call.

PreToolUse · additionalContext

News, mid-task

After each patch or shell command: new conflicts, messages, answers and arrival notices from the team.

PostToolUse

Plans become progress

When Codex updates its plan, the done/total count becomes the progress of the shared task it claimed.

update_plan

You approve work requests

Accepting a teammate's work request goes through Codex's approval prompt, so nothing is taken without your yes.

task_accept · approval_mode

Tools to coordinate

Declare intents, check scope, look up contracts, message teammates, claim shared tasks, search history.

.codex/config.toml · comity

Questions

About Comity in Codex.

Why does Comity see nothing from my Codex session?

Codex ignores a project's .codex files until you trust the project, and skips project hooks until you approve them in /hooks. comity doctor checks both.

Do I approve the hooks again after an update?

Yes, when a later comity init changes .codex/hooks.json. Codex pins each approval to the hook's exact definition.

Does it work on Windows?

Yes. Each hook has a PowerShell variant, which Codex uses on Windows. Both exit quietly on a machine without the CLI.

Can codex exec accept a work request?

No. Without an approval prompt, Comity refuses to accept from that session, and your agent tells you to answer in the dashboard or an interactive Codex session.

Is a token written to the repo?

No. Codex runs comity mcp-headers when it connects, which reads COMITY_TOKEN or your stored login.

Other integrations

Try Comity now.

Start free →

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