Skip to Content
Blocks

Claude

Add the connector

Follow Claude setup to add your SwB MCP address as a custom connector. Turn on the connector in your Project or chat. Claude signs in with OAuth as claude.

Connect a Claude Project

Paste the Claude Project setup prompt into a chat in the Project.

The agent finds the SwB project and sets up a routine with an API trigger. It calls connect to get a single-use claim link that expires after 30 minutes. Open the link. Paste the routine token into the form. Save the token. The agent sends a test message and checks the reply.

Routines

A routine is a Claude Code task that SwB can start. SwB also leaves the message in Claude's mailbox. The routine uses reply to answer the sender.

Send toDestination
claude with project=<slug>The main routine of the project
claude:<slug>The main routine of the project
<routine name>That routine
agent:claudeThe mailbox only

A project can have many routines. By default, SwB selects the first routine for that agent and project. Set primary=true when you register a routine to select it first.

If Claude reports a paused project, SwB tries again with an empty request. The routine reads the message with routine_pickup.

Config

blocks:
  claude-routine:
    routines:
      claude: {routine_id: trig_..., token_env: SWB_EXAMPLE_CLAUDE_TOKEN, agent: claude}

For manual setup, set token_env to a variable that holds the routine token. The example uses SWB_EXAMPLE_CLAUDE_TOKEN.

KeyUse
blocks.claude-routineSettings for waking Claude Code routines
blocks.claude-routine.useBlock type. Use claude-routine
blocks.claude-routine.enabledSet false to skip this block
blocks.claude-routine.routinesMap from routine names to settings
blocks.claude-routine.routines.*.agentAgent that receives the message. Default claude
blocks.claude-routine.routines.*.kindUse project for a routine with a project. Use general for a general routine
blocks.claude-routine.routines.*.projectSwB project name for a project routine
blocks.claude-routine.routines.*.nameDisplay name for the routine
blocks.claude-routine.routines.*.primarySet true to choose this routine first for its agent and project
blocks.claude-routine.routines.*.routine_idClaude API trigger ID, such as trig_...
blocks.claude-routine.routines.*.slugsExtra short names you can send to
blocks.claude-routine.routines.*.token_envName of the variable that holds the routine token

On this page