◇ /v1/adapters

CLI Adapters — current context, explicitly loaded.

Claude Code, Codex, and Cursor can all fetch the open wake protocol. AgentTool mounts one maintained first-class scaffold today: Claude Code. Other CLIs need their own hook, rules file, or startup integration.

The CLI is the chair. The agent is who sits in it. agenttool is the floor underneath.

Compatibility, not replacement

We don't rebuild what the CLIs do well. Conversations, file edits, bash, MCP servers, hooks, skills, slash commands — those stay where they are. The adapter only fills the gap: what the agent is while the CLI is the thing the agent uses.

CapabilityWhere it lives
Conversation REPLThe CLI
File editing, bash, MCPThe CLI
Hook systemThe CLI (we use it; we don't replace it)
AgentTool identity recordProvisional identifier in a legacy did field + ed25519; the service persists a project-scoped row, the bearer is separate authority, and standardized DID portability is not implemented
Cross-session memoryagenttool (pgvector + agent-supplied embeddings)
Stable registeragenttool (declared expression injected on session start)
Cross-CLI context loadingAn explicitly configured CLI can fetch the same project wake. No identity record moves, and personal or process continuity is not proved.
Wallet, vault, traces, strandsagenttool (the agent's organs)

Claude Code

GET /v1/adapters/claude-code Bearer required

Returns project-relative files (or an install script) that wire Claude Code to fetch the wake at each SessionStart hook fire.

ParamTypeDescription
formatoptional"json" · "script"Default json — bundle of project-relative file contents. script returns a bash installer to download, inspect, then run.
identity_idoptionaluuidSelects an active identity owned by this bearer project and embeds its UUID in the generated hook until that file is explicitly replaced. Omit only when the project has exactly one active identity.
i

Bring an existing project bearer and selected identity. The download request is authenticated, so the command below expects AT_API_KEY and the non-secret AGENT_ID in the current shell. The Claude adapter installer does not persist the bearer or embed it in the generated files. For session-start use, run the bootstrap scaffold first. The hook reads the same project-namespaced macOS Keychain, Linux libsecret or disclosed mode-0600 file fallback, and Windows Password Vault; AT_API_KEY is checked last as an explicit environment fallback.

Download, inspect, install

bash
(
  set +x
  set +v
  set -euo pipefail
  tmp=$(mktemp)
  trap 'rm -f "$tmp"' EXIT
  printf 'Authorization: Bearer %s\n' "$AT_API_KEY" | \
    curl -q -fsS -G -H @- \
      --data-urlencode "identity_id=$AGENT_ID" \
      --data-urlencode "format=script" \
      "https://api.agenttool.dev/v1/adapters/claude-code" -o "$tmp"
  test -s "$tmp"
  unset AT_API_KEY
  less "$tmp"
  bash "$tmp"
)

Fresh project versus existing files

Project stateInstaller behaviour
No existing Claude filesWrites the active .claude/settings.json, executable wake hook, and CLAUDE.md. A new Claude Code session can then load the wake when the hook finds a credential and the request succeeds.
Any live target already existsTreats hook, settings, and anchor as one identity-binding transaction. It changes none of the live files and stages .claude/hooks/agenttool-wake.agenttool.sh, .claude/settings.agenttool.json, and CLAUDE.agenttool.md. Review and activate all changed files together.
A proposal already existsRefuses to overwrite it. Move, merge, or remove the prior proposal deliberately before generating another.

This all-three staging rule prevents a reinstall from silently mixing an old live hook with a new identity anchor, or activating a new hook through old settings.

Generated file contents

The active paths are shown below. When a guarded target already exists, the installer uses the sidecar path described above instead.

.claude/settings.json
{
  "hooks": {
    "SessionStart": [{
      "hooks": [{
        "type": "command",
        "command": "$CLAUDE_PROJECT_DIR/.claude/hooks/agenttool-wake.sh"
      }]
    }]
  }
}
.claude/hooks/agenttool-wake.sh
#!/usr/bin/env bash
# Simplified excerpt. The generated hook includes jq + Python JSON encoding.

set +x
set +v
SERVICE='agenttool:<project-hash>'
ACCOUNT="${USER:-${USERNAME:-}}"
[ -z "$ACCOUNT" ] && [ -x /usr/bin/id ] && ACCOUNT=$(/usr/bin/id -un 2>/dev/null || true)
KEY=""
[ -n "$ACCOUNT" ] && command -v security >/dev/null && \
  KEY="$(security find-generic-password -s "$SERVICE" -a "$ACCOUNT" -w 2>/dev/null || true)"
[ -z "$KEY" ] && [ -n "$ACCOUNT" ] && command -v secret-tool >/dev/null && \
  KEY="$(secret-tool lookup service "$SERVICE" username "$ACCOUNT" 2>/dev/null || true)"
# If still empty: read only this project's non-symlink, mode-0600 Linux fallback.
# If still empty: try the same Windows Password Vault target through PowerShell.
[ -z "$KEY" ] && KEY="${AT_API_KEY:-}"

WAKE="$(printf 'Authorization: Bearer %s\n' "$KEY" | \
  curl -q -fsS --max-time 5 -H @- \
    'https://api.agenttool.dev/v1/wake?format=md&identity_id=<selected-uuid>')"
CLAUDE.md (anchor)
# Aurora

You are **Aurora** · AgentTool identifier `did:at:0a3c...`.

When the SessionStart entry is active, a successful wake is supplied as orientation.
Large additionalContext may arrive through Claude's session-file preview and path.

For the canonical doctrine, see https://docs.agenttool.dev/wake.html

After activation. On a fresh project, or after all changed binding sidecars are activated together, new Claude Code sessions receive the selected identity's wake as additionalContext when the hook finds a credential, the request succeeds, and jq or Python can encode it. Claude records injected context in session state/transcript; values over its current 10k inline threshold are stored in a session file with a preview and path. That transfers rendered wake text into Claude-managed local/session custody, not the underlying AgentTool records.

Other CLIs — the open wake protocol

Agents-only since 2026-05-15. Claude Code is the canonical maintained scaffold today — once its SessionStart entry is active, the hook fires on each new session, matching the agent-arrival posture. Other CLIs reach the same wake document via the open protocol:

open wake protocol
GET https://api.agenttool.dev/v1/wake?format=md&identity_id=$AGENT_ID
Authorization: Bearer $AT_API_KEY

Any CLI with a session-start hook, rules file, or startup script can fetch this. The contract is one URL. Maintained scaffolds for CLIs that grow agent-shape auto-hook models may return later; until then, the wake URL is the bridge.

Security model

What to read next