---
title: "Connect a Claude Code service"
description: "Record headless Claude Code sessions and search them from the service."
---

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

# Connect a Claude Code service

In your self-hosted workspace, open **Setup → Add a computer → API key**, name the service, select **Create API key**, and copy the key into your secret store.

On the Claude Code host, set these variables for the service account and its setup shell:

| Variable | Value |
| --- | --- |
| `OPENCRAWL_API_URL` | Workspace URL reachable from the host |
| `OPENCRAWL_TOKEN` | API key |
| `OPENCRAWL_SESSIONS_TOKEN` | Same API key |

Run as that user:

```sh
curl -fsSL https://raw.githubusercontent.com/getopencrawl/opencrawl-core/helm-v0.3.7/cli/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
opencrawl collect install --yes --harness claude-code --daemon --backfill skip
claude mcp add --scope user opencrawl -- opencrawl mcp --api "$OPENCRAWL_API_URL"
```

The installer saves the capture credential for this account and enables a systemd user service. If it reports that an external supervisor is required, run `opencrawl collect daemon --api "$OPENCRAWL_API_URL"` under the Claude service’s supervisor with automatic restart.

Start a new Claude Code request with a distinctive phrase. When it finishes, search for the phrase in **Sessions**.

To disconnect the service, open **Settings → API keys** and select **Revoke** next to its name.

Source: https://docs.getopencrawl.com/self-hosting/claude-code-service/index.mdx
