Agents

Claude Code

The XOROX integration for Claude Code: setup with xorox init, automatic context through hooks, 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: install XOROX, create a project credential, run xorox init in the project, then start a new Claude Code session there.

What xorox init configures

When it detects Claude Code (or you pass --agent claude), xorox init writes two files Claude Code reads for a project:

.claude/settings.local.json
{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/xorox",
            "args": ["hook", "claude-session-start"],
            "timeout": 10
          }
        ]
      }
    ],
    "UserPromptSubmit": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/xorox",
            "args": ["hook", "claude-prompt-submit"],
            "timeout": 15
          }
        ]
      }
    ]
  }
}
.mcp.json
{
  "mcpServers": {
    "xorox": {
      "type": "stdio",
      "command": "/path/to/xorox",
      "args": ["mcp"]
    }
  }
}

Both are merged into any existing content in those files — other hooks or MCP servers you have configured are left alone. They point at your installed xorox command and contain no credentials. The hooks go in Claude Code's local settings file, so they stay on your machine rather than in the repository (see Installation).

The first time you use the project, Claude Code may ask you to trust the project and to approve its .mcp.json MCP server. 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 supplied directly with 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.

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

Ruleset changes during a session

On every prompt, a UserPromptSubmit hook checks whether your Rulesets have changed since the session last received them. If not, nothing is added to your prompt. If they changed, the current Rulesets reach the agent as a complete snapshot that supersedes earlier ones — directly in the prompt when they fit, or by instructing the agent to fetch them with xorox_get_rulesets when they're large. You don't need to restart the session or ask for it. Newly started, resumed, cleared, and compacted sessions always receive a fresh snapshot.

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, and can come from XOROX, GitHub, or Notion — see MCP tools.

Supported platforms

xorox supports macOS and Linux (arm64 and x86_64) and 64-bit Windows (x64). See Installation.