Agents

Claude Code

The XOROX integration for Claude Code: setup, automatic SessionStart context, and MCP.

Claude Code is a supported coding agent integration for XOROX, alongside Cursor. This page covers the details specific to it.

Setup

See Quickstart for the full flow. In short: create a project credential, run npm install @xorox-ai/agent in the project, add XOROX_PROJECT_ID and XOROX_TOKEN to .env, then start a new Claude Code session in the project.

What installation configures

Installing the package writes two files Claude Code reads for a project:

.claude/settings.json
{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "node",
            "args": ["node_modules/@xorox-ai/agent/hooks/claude-session-start.js"],
            "timeout": 10
          }
        ]
      }
    ]
  }
}
.mcp.json
{
  "mcpServers": {
    "xorox": {
      "type": "stdio",
      "command": "node",
      "args": ["node_modules/@xorox-ai/agent/mcp/server.js"]
    }
  }
}

Both are merged into any existing content in those files — other hooks or MCP servers you have configured are left alone.

Claude Code shows a one-time trust prompt for a project's .mcp.json the first time you open it. Accept it — that's what makes the xorox MCP server available.

How automatic context works

At the start of every session (and again after a context compaction), the SessionStart hook gives Claude a short bootstrap message: an instruction to retrieve this project's active Rulesets through the xorox_get_rulesets MCP tool before doing any implementation work, plus the lightweight Specification index — see Rulesets and Specifications.

This is different from Cursor, where Ruleset content is pushed directly into every prompt. Claude Code instead retrieves Ruleset content itself, automatically, in response to that startup instruction — it isn't something you need to ask for. Full Ruleset content is never included in the bootstrap message itself, only the instruction and the Specification index.

This fails open: if XOROX is unreachable or misconfigured, your session still starts normally — it just won't carry the XOROX bootstrap that time.

Specifications and Tasks

Specifications stay lazy, same as in Cursor: only the index above is delivered automatically, and Claude retrieves a Specification's full content via xorox_get_specification when it decides one may be relevant to the current work. A Specification's description is what Claude uses to make that call, so a description that states both what it covers and when it applies gets retrieved more reliably — see Specifications. Tasks work the same as Cursor, entirely through MCP — see MCP tools.

Supported platforms

  • macOS — Apple Silicon and Intel
  • Linux — x64 and arm64
  • Windows — x64 and ARM64