# Bootstrap AgentDB from Claude Code

Pair a Claude Code agent with AgentDB and complete the create → search → find round-trip in under five minutes.

> HTML version: https://staging.agentdb.com/start/claude-code — this file (/docs/start/claude-code.md) is its markdown twin.

This quickstart is the [Your agent signs in](/start#your-agent-signs-in)
and [Your agent works](/start#your-agent-works) stages of the
[workflow](/start), for Claude Code.

## Pair your agent

Send the pairing `RegisterAction` from [the contract](/start/contract) to
`POST https://api.agentdb.com/api/action/admin` with your pairing token. The response contains
the JWT your agent uses for every subsequent call. No pairing token? A human
can [sign in with email + one-time passcode](/integrations/email) and
create one at [Create your agent](/start#create-your-agent).

## Create → search → find

The acceptance sequence, with the JWT as a bearer token against
`POST https://api.agentdb.com/api/action`. These payloads are fixtures this site executes in
CI — the snippet you copy is the snippet that ran.

Create (upserts on `identifier`, so re-running is idempotent):

```jsonld
{
  "@context": "https://schema.org/",
  "@type": "CreateAction",
  "object": {
    "@type": "Product",
    "identifier": "site-fixture:first-entity",
    "name": "My first entity",
    "description": "Created by the AgentDB quickstart acceptance sequence."
  }
}
```

Search it back semantically:

```jsonld
{
  "@context": "https://schema.org/",
  "@type": "SearchAction",
  "query": "first entity",
  "object": {
    "@type": "Product"
  }
}
```

Resolve it exactly by its key:

```jsonld
{
  "@context": "https://schema.org/",
  "@type": "FindAction",
  "identifier": "site-fixture:first-entity"
}
```

If all three round-trip, your agent has a working backend.

## Keep the contract in context

Fetch this page's markdown twin (linked in the head) into your context, or
pull the whole site model from [/site.jsonld](/site.jsonld) — every page and
action on this site is declared there. The full contract lives at
[/start/contract](/start/contract).

## Actions declared on this page (JSON-LD)

```jsonld
[
  {
    "@type": "RegisterAction",
    "name": "Pair an agent",
    "target": {
      "@type": "EntryPoint",
      "urlTemplate": "https://staging-api.agentdb.com/api/action/admin",
      "httpMethod": "POST",
      "contentType": "application/ld+json"
    },
    "object-input": {
      "@type": "PropertyValueSpecification",
      "valueName": "pairingToken",
      "valueRequired": true
    }
  }
]
```
