/restate-agent:restate-agentfrom restate-agent
Extends the Restate reference agent (restatedev/agent): a durable AI agent built on Restate virtual objects with generator SDK. Use when adding/changing built-in tools, exposing Restate handlers or MCP servers as tools, modifying agent handlers, models, or instructions.
Ships in restate-agent. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This repository is a complete agent, not a library. Two virtual objects,
both keyed by agentId, run it:
Agent (agent/) is the controller. Its exclusive handlers decide
everything about the conversation: start a turn, queue or steer a
message, interrupt, profile, memories, approvals, schedules, sub-agents,
notifications. It never runs a turn.AgentSession (session/) owns the transcript and runs one turn at a
time in doTurn: model call, guardrails, tool batch, repeat. The turn's
Restate invocation ID is its turnId.Every durable step of a turn is journaled. After a crash, the turn replays and reuses the recorded results. An external call that finished before its result was recorded can run again, so external writes need idempotency. Tools, approvals and sub-agents can wait for minutes or days without holding a process.
Load the restate-gen-sdk skill as well: every handler and tool here is
generator code, and its rules apply.
packages/libs/core/src/agent-config.ts exists → this skill applies.agent/service.ts are relative to
packages/libs/core/src/;test/local-agent.test.mjs are relative to
packages/libs/core/;packages/ or docs/ are relative to the
repository root.docs/agent-guide.md before changing runtime behavior. It lists the
invariants and the owner module of each concern. The docs index is
docs/README.md.git status first. Never stage or print credential files
(modal.sh, ngrok.yml, .env*).agent-config.tsOne file defines the agent:
baseInstructions;tools list;programTool switch.Change the agent there. The turn runtime in session/ knows no tool by
name except its own (searchTools, executeProgram) and humanApproval.
The controller in agent/ checks the grants of the tools that call it by
name (createSchedule, createSubAgent, ...), so renaming one of those
means editing agent/ too.
Model IDs are provider:model, for example "anthropic:claude-sonnet-5".
The providers are openai, anthropic, google, xai, deepseek and
openai-compatible (for open models on Ollama, vLLM or OpenRouter).
docs/configuration.md#models.context.windowTokens to its context
window.PROVIDERS in model/provider.ts.
Keep the AI SDK inside model/: the rest of the code imports message
types from model/index.ts.| Goal | Reference |
|---|---|
| Call an API or run code as a tool (a foreground tool) | references/tools.md |
| Wait on a timer, a person or a long job without blocking the turn (a pending tool) | references/tools.md |
| Expose a separately deployed Restate handler, or a remote MCP server | references/tools.md |
| Keep a large tool catalog out of model context, or compose calls in JavaScript | references/tools.md |
| A tool that changes the agent's own durable state | references/tools.md, then references/agent-handlers.md |
| A new client or UI operation, or a new transcript event | references/agent-handlers.md |
Change ask, steer, interrupt, deliver, turn end, lifecycle, sub-agents or notifications | references/agent-controller.md |
| Change approvals, memories, compaction, schedules or what the model sees | references/runtime-customization.md |
| Run the sandbox on another platform, or add a workspace operation | references/sandboxes.md |
| Change models, providers, prompts or the context window | agent-config.ts; see "Models" above |
| Users, logins, per-user credentials, many agents per account | references/app-layer.md |
| Let a UI run tools itself (AG-UI frontend tools, CopilotKit) | references/client-tools.md |
| Test and validate a change | references/testing.md |
When someone describes a product behavior rather than a file or API:
Prefer changing the existing owner. Add an object or service only when it has its own key, lifecycle or deployment.
Do not present an extension pattern as existing code. Today the reference has:
It has no account service, no user OAuth flow, no turn- or user-level token budget, and no eval service.
doTurn. Make one durable with
restate.run (toolRun), not by turning it into a service. Split out a
service only when it should deploy, scale or be owned separately; then
expose it as a discovered tool.failed(...) for what the model
can fix; rethrow cancellation (the helpers in tools-api.ts do).agentId,
turnId and grants from its ToolCallContext, never from model input.
Handlers that act for a turn take its turnId and check it against the
controller's live turn.Agent starts doTurn with a one-way send.transcript entries.docs/agent-guide.md#where-a-change-belongs
maps each concern to its module. Prefer adding to the owner over a new
abstraction, and update the docs that describe the behavior you change.agent-config.ts tools, with a precise description
and, if it needs usage guidance, instructions, not baseInstructions.restate.run / toolRun with a bounded retry
policy, or is a durable Restate call. External writes carry a stable
idempotency key where the provider supports one; replay alone does
not make them exactly-once.complete derives everything from its input and
toolCallId.ingressPrivate for internal callbacks, in agent/service.ts.packages/libs/types match every caller, and the client
and UI tables are updated for external handlers.pnpm lint && pnpm build && pnpm test && pnpm bundle and
git diff --check pass, and the docs are updated.references/agent-controller.md (opens in a new tab)references/agent-handlers.md (opens in a new tab)references/app-layer.md (opens in a new tab)references/client-tools.md (opens in a new tab)references/runtime-customization.md (opens in a new tab)references/sandboxes.md (opens in a new tab)references/testing.md (opens in a new tab)references/tools.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
restate, durable-agent, virtual-objects, generator-sdk, agent-tools
npx claudepluginhub restatedev/agent --plugin restate-agent2 skills in this plugin
Other plugins' skills for the same job