> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enagrams.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex Setup

> Connect OpenAI Codex CLI to your Enagrams workspace

## One-command setup

From the repo root:

```bash theme={null}
npx enagrams init
```

The CLI writes everything Codex needs:

* `.codex/config.toml` — MCP server configuration for the Codex CLI
* `.codex/hooks.json` — hook wiring pointing at the shared hook script

Codex picks the config up on its next launch.

## Verify

Start Codex in the project directory. At session start you should see a team briefing injected (active agents, decisions, conventions).

```bash theme={null}
enagrams status
```

An active session tagged `agent_type: codex` confirms the wiring.

## Config Files

`.codex/config.toml`:

```toml theme={null}
[mcp_servers.enagrams]
command = "npx"
args = ["-y", "enagrams", "--mcp"]

[mcp_servers.enagrams.env]
ENAGRAMS_API_KEY = "..."
ENAGRAMS_WORKSPACE = "..."
```

`.codex/hooks.json` wires Codex's hook names to the shared script — `npx enagrams init` generates this for you.

## Differences from Cursor and Claude Code

* Codex doesn't have per-tool `matcher` semantics; the hook script inspects the tool name itself to decide whether to acquire a file reservation.
* `SessionStart` context injection happens through stdout — the hook script writes the briefing which Codex prepends to the conversation.

## Troubleshooting

**Codex says it can't find the MCP server** — make sure `npx` is on Codex's PATH. The global `npm -g` install path is the usual fix.

**Briefing isn't appearing** — verify the hook script is executable (`chmod +x .cursor/hooks/enagrams-hooks.mjs`) and that `.codex/hooks.json` references it correctly.
