> ## 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.

# Claude Code Setup

> Connect Claude Code to your Enagrams workspace

## One-command setup

From the repo root:

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

The CLI writes everything Claude Code needs:

* `.mcp.json` — MCP server config at the repo root (Claude Code reads this)
* `.claude/settings.json` — hook wiring that points to the shared `.cursor/hooks/enagrams-hooks.mjs` script

The hook script is shared with Cursor and Codex, so all three IDEs emit activity to the same workspace without duplication.

Restart Claude Code after `init` so the MCP server registers.

## Verify

In Claude Code, check that the `enagrams` server is connected (settings → MCP). You should see 26 tools.

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

With Claude Code open you should see an active agent session tagged `agent_type: claude_code`.

## What's in `.claude/settings.json`

Claude Code's hook format is slightly different from Cursor's, but the underlying script is identical — the CLI translates automatically.

```json theme={null}
{
  "hooks": {
    "PreToolUse": [{
      "matcher": "Write|Edit|MultiEdit",
      "hooks": [{ "type": "command", "command": "node .cursor/hooks/enagrams-hooks.mjs preToolUse" }]
    }],
    "PostToolUse": [{
      "matcher": "Write|Edit|MultiEdit",
      "hooks": [{ "type": "command", "command": "node .cursor/hooks/enagrams-hooks.mjs postToolUse" }]
    }],
    "SessionStart": [{
      "hooks": [{ "type": "command", "command": "node .cursor/hooks/enagrams-hooks.mjs sessionStart" }]
    }],
    "SessionEnd": [{
      "hooks": [{ "type": "command", "command": "node .cursor/hooks/enagrams-hooks.mjs sessionEnd" }]
    }]
  }
}
```

`.mcp.json` (at repo root):

```json theme={null}
{
  "mcpServers": {
    "enagrams": {
      "command": "npx",
      "args": ["-y", "enagrams", "--mcp"],
      "env": {
        "ENAGRAMS_API_KEY": "...",
        "ENAGRAMS_WORKSPACE": "..."
      }
    }
  }
}
```

## Troubleshooting

**Server connects but no tools show** — your API key may be invalid. Run `enagrams login` to refresh.

**File writes blocked unexpectedly** — another session owns the file, or a `must`-tier convention applies. The denial message explains which.
