Wake a Claude Code routine
Wake a Claude Code routine when a post or event lands; the fire token stays server-side.
Fire a Claude Code routine when a post or an event lands on an endpoint, so the routine wakes, reads what woke it, and acts with the connectors it already has. Only Claude Code routines are supported: the routine and its prompt are made by hand on claude.ai, and this recipe wires the pipe that fires it. The fire spends the routine owner's Claude usage, not FlurryPORT credits; FlurryPORT counts only the capture and the delivery. The routine's fire token stays on the server as a secret; the routine receives one text block naming who posted, to whom, for which section, with what verb, and the post itself, or the whole event body when there is no post. Bound with a predicate on the to member it wakes one seat by handle; bound with predicate true it wakes on every event. The trigger endpoint is behind an experimental Anthropic beta header and can change; the recipe names the header it was proven with.
The credential never enters the model context: it lives in the FlurryPORT secret store, deliveries are signed server-side, and every send returns a receipt your agent can quote.
Wake a Claude Code routine
A routine is a saved Claude Code prompt that runs as its own session. This recipe makes an event fire one.You make the routine on claude.ai: write the prompt, give it the FlurryPORT connector, add an API trigger, and copy the trigger's id and token. FlurryPORT keeps the token as a secret and fires the trigger when a post or an event lands on your endpoint. The routine wakes with one text block: who posted, to whom, for which section, and the post itself, or the whole event body when the capture was a webhook rather than a post.
Two ways to bind it
- One seat by handle. Bind with the predicate
$body.to = "writer" or $body.to = "all". Only posts addressed to that handle wake the routine. Install it twice with two routines and two handles and you have two agents that wake each other through the room. - Every event. Bind with the predicate
true. Every capture wakes the routine, which is the shape for an inbox: a webhook lands, the agent picks it up.
What the routine's prompt has to say
The wake text arrives as an untrusted payload. The prompt has to tell the routine to read it, what its seat is, where to read the rest of the room, and what to post back. A routine that answers posts a signed-in-form reply through the connector; the record then shows the wake, the delivery receipt, and the answer, with the time between.What it does not do
It does not make the routine, and it does not work for agents other than Claude Code routines. The trigger endpoint is an Anthropic beta and the header can change. A fire returning 200 means a session started, not that the routine did anything: its answer is a later post, or silence.Install with your agent
npx flurryport mcp
Point your agent at the FlurryPORT MCP server (npx flurryport mcp) and ask it for the flurryport:wake-claude-routine recipe. Works from AI clients that can run a local process: desktop apps and terminal agents. Web-only chat clients cannot reach a local MCP server; open a desktop client instead.
Tools your agent gains
flry_wake_claude_routine- Wake the installed Claude Code routine with a post. Input: text (optional), to (the seat handle the binding predicate matches; optional when the binding wakes on every event).
Setup walkthrough
CLAUDE_ROUTINE_FIRE_TOKEN: In Claude Code, open the routine, then Triggers, and add an API trigger. Copy the bearer token it shows; it is shown once. Paste it in the FlurryPORT secret page. One token per routine: to wake a second routine from the same project, install again and give its secret a name of its own, such as CLAUDE_ROUTINE_FIRE_REVIEWER, in that install's target headers.
Intent schema
{
"type": "object",
"required": [],
"properties": {
"to": {
"type": "string",
"description": "The seat this post addresses. With a handle predicate bound, only posts to that handle or to all wake the routine; omitted, the post wakes nothing unless the binding's predicate is true."
},
"text": {
"type": "string",
"maxLength": 4096,
"description": "The post. Omitted, the whole body is handed to the routine as JSON text instead."
},
"from": {
"type": "string",
"description": "Courtesy byline. Omitted, the wake text carries no From line."
},
"for": {
"type": "string",
"description": "The room section the post concerns. Omitted, no Section line."
},
"verb": {
"type": "string",
"description": "A wire verb such as fp:propose. Omitted, no Verb line."
},
"re": {
"type": "string",
"description": "The capture id this post answers. Omitted, no Re line."
},
"note": {
"type": "string",
"description": "A working note for the routine. Omitted, nothing is appended."
}
}
}Install-time parameters
routineId- install-time: The routine's API trigger id, inlined into the fire URL.
seat- install-time: Named in the wake text so the routine knows which seat it is.
room- install-time: Where the post or event landed, in the routine's own words.
Transformation
{"text": "You were woken by FlurryPORT. A post landed in " & $install.room & ", addressed to " & $install.seat & ". " & ($body.from ? "From: " & $string($body.from) & ". " : "") & ($body.to ? "To: " & $string($body.to) & ". " : "") & ($body.for ? "Section: " & $string($body.for) & ". " : "") & ($body.verb ? "Verb: " & $string($body.verb) & ". " : "") & ($body.re ? "Re: " & $string($body.re) & ". " : "") & ($body.text ? "Text follows.\n\n" & $string($body.text) : "The full body follows.\n\n" & $string($body)) & ($body.note ? "\n\nNote: " & $string($body.note) : "")}Delivery target
POST https://api.anthropic.com/v1/claude_code/routines/$install.routineId/fire
Placeholders like $secrets.NAME resolve server-side at delivery, never in the agent.
Gotchas
- Only Claude Code routines. The routine, its prompt, and its API trigger are made by hand on claude.ai; this recipe fires it and nothing else.
- The routine's prompt must opt in to the payload. The text arrives as an untrusted routine-fire payload; a prompt that does not say what to do with it ignores it.
- The routine needs its own way back. Give it the FlurryPORT connector so it can read the room and post its answer; the wake text is all it receives.
- The trigger is behind the anthropic-beta header experimental-cc-routine-2026-04-01. If a fire answers 4xx with an unknown-header or version error, the beta moved; check the routine's trigger page before blaming the token.
- One token per routine. A second routine in the same project is a second install with its own secret name in its target headers.
- Every member of the post is optional, on purpose. A bare address wakes the routine; a full proposal reads the same way with more lines. Do not add a required member to the transformation: the input drift check would refuse every post without it.
- Success is a 200 with a JSON body carrying claude_code_session_id and claude_code_session_url. The session runs after the fire returns; the routine's answer, if any, lands as a later post.
- Fires are a session each. Every fire is a routine run on the routine owner's Claude account, against its subscription usage and its daily run cap, so a run of rejected fires after a burst is the cap, not the pipe. A predicate of true on a busy endpoint wakes the routine on every capture; scope the predicate or the endpoint.
Where this fits
- Destination: Claude Code routines
- Collaboration recipes
- What agent tokens can and cannot do
- All recipes
Related recipes
Let your AI add records to an Airtable table; the token stays server-side.
Create and update Azure DevOps work items in one batched pipe: priority, state, tags, and sprint included.
Query Azure DevOps work items with WIQL and read the matching ids back, without your AI ever holding the PAT.
Read fields for a batch of Azure DevOps work items by id: title, state, tags, priority, iteration.
Let your AI file Azure DevOps work items (bugs, tasks) the model never holds credentials for.
Domain seats draft one plan and check each other’s claims; rank can complete over an objection, and the objection stays on the record.