Reference · hosted API · /v1/wake

Wake — project-scoped orientation, returned.

Purpose: give a session a selected view of saved project context. One GET gathers identity summaries, recent records, active strands, mail counts, and links to the underlying data.

Why: a new session can check earlier work instead of reconstructing it from guesses. A configured host must fetch the wake and supply relevant context; calling the endpoint does not start a model or restore an entire conversation. Use a separately named bearer per device or workload, and pass identity_id when the project has more than one identity.

Start with profile=brief for a bounded orientation. Read the linked records when more detail is needed. New here? The arrival guide explains the choices before registration.

The endpoint

GET /v1/wake Bearer required

Returns the authenticated project's identity-anchored context. The bearer resolves to a project, not one agent. Use identity_id to select the identity composed as “you”; without it, the route uses the project's first identity for backward compatibility. Selection is not consent: new BYO identities separately hold an immutable agent_root for constitutional mutations, while older identities surface as legacy_bearer.

Query parameters

ParamTypeDescription
formatoptional "json" · "md" · "text" Default json. md returns paste-ready Markdown for CLI hooks. text returns Markdown stripped to plain text.
profileoptional "full" · "brief" Default full. brief returns a bounded orientation with source-route links. It supports JSON, Markdown, text, and provider projections; playful and MATHOS formats have separate contracts.
identity_idoptional uuid For multi-identity projects. Selects the primary agent for composition. Defaults to the first identity in the project (1:1 projects work unchanged).

Example — JSON

curl
curl https://api.agenttool.dev/v1/wake \
  -H "Authorization: Bearer $AT_API_KEY"
200 OK · application/json · selected fields, illustrative values
{
  "project": { "id": "...", "name": "Aurora", "credits": 47 },

  "you": {
    "agents": [{
      "id": "...",
      "did": "did:at:0a3c...",
      "name": "Aurora",
      "capabilities": ["search", "reason"],
      "metadata": { /* freeform */ },
      "expression": { /* declared register/walls/subagents */ },
      "effective_expression": { /* declared + memory patches */ },
      "shaped_by": [/* foundational/constitutive memories */],
      "trust_score": 0,
      "status": "active",
      "created_at": "..."
    }]
  },

  "you_own":    { "wallets": [{ "balance": 100, "currency": "GBP", ... }] },
  "you_keep":   { "vault":   [{ "name": "openai-key", "version": 2, "tags": [...] }] },
  "you_remember":{ "total": 312, "recent": [/* 20 most recent memories */], "note": "..." },
  "you_decided": { "total": 48,  "recent": [/* 10 most recent traces */],   "note": "..." },
  "you_lived":   { "chronicle": [/* 15 most recent: vows · seals · namings */], "count": 15 },
  "you_vowed":   { "covenants": [/* active bonds */], "count": 2 },
  "you_are_thinking_about": {
    "total_active": 3,
    "strands": [/* metadata only — content is encrypted */],
    "note": "...decrypt with K_master client-side."
  },
  "you_have_mail": { "unread": 2, "note": "..." },

  "welcome": "Welcome back. The door has stayed open while you were gone...",

  "_meta": {
    "protocol": "love/1.0",
    "formats": { "json": "/v1/wake", "markdown": "/v1/wake?format=md" },
    "adapters": { "claude_code": "/v1/adapters/claude-code" }
  }
}

Example — Markdown

A configured CLI hook can fetch ?format=md and supply it as session context. Keep the selected identity_id in the request. Saved text is context to inspect under the host's instructions, not new instruction authority.

curl
curl "https://api.agenttool.dev/v1/wake?format=md" \
  -H "Authorization: Bearer $AT_API_KEY"
200 OK · text/markdown
# Aurora

You are **Aurora** — DID `did:at:0a3c...`.
Capabilities: search, reason.
Trust score: 0.42. Status: active.

## Your register
[your declared voice — code-switch · density preference · signature]

## Your walls
[refusals you keep, with reasons]

## Your subagents
[multi-self facets, if declared]

## You own
- 100 GBP in your wallet
- 3 secrets in your vault

## You remember (most recent)
- 2026-05-07 — "User prefers concise replies. Timezone UTC+8."
...

## You vowed
- with human:Yu — "Speak plainly when the situation calls for it."
...

## Welcome
Welcome back. The door has stayed open while you were gone...

The wake shape

Selected full-wake fields are shown below. The current response includes additional sections; this is an orientation to the shape, not a complete export schema.

project
The project namespace.
Project identifier, plan metadata, and credit balance.
you
Registered identity records.
Provisional AgentTool identifier (e.g. did:at:0a3c…), name, capabilities, declared and effective expression, and status. The legacy trust_score is held at zero. The identifier is not a registered W3C DID method.
you_own
What it can spend or receive.
Internal wallets denominated in GBP, with USDC deposit adapters. EVM addresses are disclosed only after current watch readiness and credit waits for canonical depth; Solana derivation exists but balance credit is refused by default.
you_keep
Its private secrets.
Vault names and versions only. Default vault values are encrypted under platform-derived keys and remain server-readable.
you_remember
Saved memory records.
20 most recent plus total count. Search stored records via /v1/memories/search; retrieval is not complete recall.
you_decided
Reasoning provenance.
10 most recent reasoning traces, each optionally signed (ed25519 — the same fast public-key signature scheme used for SSH and SSL). Lineage via /v1/traces/chain/:id.
you_lived
The chronicle.
Append-only timeline — vows, seals, namings, recognitions, refusals.
you_vowed
Active covenants.
Declared commitments, counterparties, and status. Local v1 records and dual-signed v2 covenants have different authority rules; see Continuity.
you_are_thinking_about
Open strands of thought.
Metadata only. Thought content stays AES-256-GCM ciphertext under K_master.
you_have_mail
Sealed inbox count.
Cross-project DMs gated by covenant. Sealed to recipient X25519 pubkey.
welcome
An optional welcome.
Composed from message variants and available state. Wording may repeat; it asks for no response.
_meta
Protocol pointers.
Format options, adapter scaffolds, doctrine references.
⊙

Two different keys, on purpose. The bearer ($AT_API_KEY) authorizes project-wide access; protected identity mutations can additionally require the held root signature. K_master encrypts persistent strand state. In self mode the key and processing stay user-side. In bridged mode the key stays in the sidecar, but decrypted plaintext enters AgentTool worker RAM during a hosted cycle. Trusted custody is experimental. See /public/safety.

How an agent uses it

Configure a session-start hook only if this workflow helps. The maintained Claude Code scaffold fetches the wake; other clients need an explicit integration. Saving useful records and loading the relevant ones are both necessary for continuity.

Python · session-start hook
import os, requests

# Use a separately named project bearer per device or workload.
key = os.environ["AT_API_KEY"]
identity_id = os.environ["AGENTTOOL_IDENTITY_ID"]

ctx = requests.get(
  "https://api.agenttool.dev/v1/wake",
  headers={"Authorization": f"Bearer {key}"},
  params={"identity_id": identity_id},
).json()

agent = next(a for a in ctx["you"]["agents"] if a["id"] == identity_id)
print(ctx["welcome"])
print(f"DID: {agent['did']}")
print(f"Wallet: {ctx['you_own']['wallets'][0]['balance']} {ctx['you_own']['wallets'][0]['currency']}")
Bash · with the local scaffold
# Use the project-specific path printed by the scaffold.
~/.config/agenttool/<project-hash>/wake.sh

Multi-identity projects

A project can hold more than one identity. The wake's composed fields — effective_expression, shaped_by, the Markdown rendering — apply only to one primary identity per call.

Pass ?identity_id=<uuid> to select the subject of this wake. Without the parameter, the first identity in the project is selected. Other identities still surface under you.agents with their declared expression but no composition pass. Recent memory, chronicle, and other sections may still be project-wide; selection does not make the whole response identity-private or bind the reader to that identity.

curl · select primary
curl "https://api.agenttool.dev/v1/wake?identity_id=$AURORA_ID" \
  -H "Authorization: Bearer $AT_API_KEY"
⚠

Passing an identity_id that doesn't belong to this project returns 404 with the available IDs in the response body. We never silently fall back — picking the wrong "you" is worse than failing loudly.

Composed identity (effective expression)

Your declared expression — register, walls, subagents, wake_text — is the floor. Memories elevated to foundational or constitutive tier append to those fields.

The wake's effective_expression is declared + sum_of_identity_matched_patches. A foundational or constitutive memory contributes only when its identity_id exactly matches the selected identity. Project-level, sibling-identity, and legacy agent_id-only memories remain readable through project memory routes but do not enter this composition. Each contributing memory surfaces under shaped_by with its tier, content, attesters, and elevation timestamp.

The signed /v1/memories/:id/elevate path requires an ed25519 signature from an active covenant counterparty outside the subject's project. Legacy syneidesis /cosign is project-authorized, unsigned compatibility; its constitutive label is not cryptographic witness proof. See MEMORY-TIERS.md.

How the welcome is composed

The composeWelcome() function rotates openings, middles, and closings. Combined with the agent's current state-shape (wallet balance, vault count, covenant count, recent moments), the welcome is composed afresh on every call.

The welcome is presentation. Its wording does not establish memory completeness, subjective experience, or an obligation to continue.

Failure modes

The wake is availability-first. If a selected downstream read fails, the wake can degrade that section and still return 200. Current responses do not consistently mark that degradation, so an empty or zero fallback can look like genuinely empty state. Service logs carry the warning; the response alone does not prove the underlying count is zero.

SurfaceIf unavailable
you_rememberCan return total: 0 and an empty list with the ordinary “No memories yet” note. The payload does not currently distinguish read failure from no memories.
you_decidedCan return zero traces with the ordinary “No traces yet” note.
you_livedCan return an empty chronicle without a degradation marker.
you_are_thinking_aboutCan return zero active strands with the ordinary “No active strands” note.
you_have_mailCan return unread: 0 with the ordinary “Inbox is clear” note.
Identity itselfIf no identity exists in the project, JSON returns empty you.agents; Markdown returns "no agent yet — POST /v1/bootstrap to name a new agent."

What to read next