Quick start

Clawback is a Claude Code channel plugin. It connects to a hosted server via WebSocket and delivers events — webhooks and crons — directly into your Claude Code session.

External Service
GitHub, Stripe,
Sentry, etc.
POST ———▸
Clawback Server
Verify, route,
queue events
WebSocket ◂———▸
Plugin
Dispatch one
at a time
stdio ◂———▸
Claude Code
Process event,
take action
1
Event arrives

A webhook hits the server or a cron fires. The server verifies the signature, extracts the event type, and matches it to a route.

2
Queued & delivered

The event is pushed to your connected session over WebSocket. If you're offline, it queues until you reconnect.

3
Claude acts

Claude receives the event with the matched skill, processes it, and acknowledges. The next event arrives only after the current one is done.

1. Clone and install

git clone https://github.com/clawback-io/clawback.git ~/.config/claude/channels/clawback-plugin
cd ~/.config/claude/channels/clawback-plugin
bun install

2. Add the MCP server

From whichever project directory you want to use Clawback in:

# Add to current project
claude mcp add -s project clawback -- bun run \
  --cwd ~/.config/claude/channels/clawback-plugin --shell=bun --silent start

# Or add globally (all projects)
claude mcp add clawback -- bun run \
  --cwd ~/.config/claude/channels/clawback-plugin --shell=bun --silent start

3. Authenticate

Visit getclawback.io/auth/cli to log in with GitHub. You'll get a shell command to save your connection config. Paste it in your terminal.

4. Restart Claude Code

The plugin connects automatically on startup. Once connected, you manage everything through Claude in natural language.

5. Tell Claude what you want

Once connected, you manage everything through Claude in natural language. Claude has access to all the Clawback tools and will configure sources, crons, and routing for you.
Set up a GitHub webhook that routes pull_request.opened events to /review

Claude will create the source, configure event routing, and give you the webhook URL to paste into your GitHub repo's webhook settings.

Create a cron that runs /catchup every weekday morning at 9am

Claude will set up a persistent cron job that fires into your session on schedule.

Configuration

After authenticating, your config is saved at ~/.config/claude/channels/clawback/config.json (or ~/.claude/channels/clawback/config.json depending on your system):

{
  "remote": "wss://getclawback.io/ws",
  "connectionToken": "cbt_your_token_here",
  "notifications": true
}
FieldRequiredDescription
remoteYesWebSocket URL of the Clawback server
connectionTokenYesConnection token (starts with cbt_)
notificationsNoDesktop notifications when events are processed (notify-send on Linux, osascript on macOS). Default: false
dataDirNoLocal data directory override

Environment variables

VariableDescription
CLAWBACK_SESSIONSet session tag for multi-instance routing
CLAWBACK_CONFIGOverride config file path

Creating sources

A webhook source is an endpoint on the Clawback server that accepts incoming webhooks from an external service. Each source has a slug (used in the URL), a verification type, and optional route mappings that tell Claude what to do with each event type.

Set up a GitHub webhook source called "github" with signature verification. Route pull_request.opened and pull_request.synchronize events to /review, and issues.opened to /triage. Drop everything else.

Claude will create the source and give you a webhook URL to paste into your service's webhook settings.

Event routing

When a webhook arrives, Clawback needs to know two things: what kind of event is it, and what should Claude do with it.

Extracting the event type

Different services put the event type in different places. You tell Clawback where to look:

ServiceWhere the event type livesExample value
GitHubX-GitHub-Event header + action field in bodypull_request.opened
Stripetype field in bodypayment_intent.succeeded
ShopifyX-Shopify-Topic headerorders/create

Mapping events to actions

Once Clawback can extract the event type, you map specific events to skills or prompts. When an event matches, that skill is prepended to the payload before delivering it to Claude.

Set up a GitHub webhook source called "github" with signature verification. Route pull_request.opened and pull_request.synchronize events to /review, and issues.opened to /triage. Drop everything else.

With this setup:

You can also use * as a catch-all to handle any events that don't have a specific route.

Signature verification

Clawback supports HMAC signature verification for incoming webhooks. When creating a source, you specify the verification type:

Webhook secrets are encrypted at rest with AES-256-GCM. The plaintext secret is never stored — only the encrypted form.

Creating crons

Clawback crons are persistent scheduled jobs stored on the server. Unlike Claude Code's built-in /schedule which expires after 7 days, Clawback crons run forever until you delete them. They survive session restarts, disconnections, and machine reboots.

Tell Claude what schedule you want in natural language:

Create a cron that runs /catchup every weekday morning at 9am
Set up a cron to check deploy status every 30 minutes
Run /review-prs every day at 5pm

Crons use standard 5-field cron expressions under the hood (minute hour day-of-month month day-of-week), but you don't need to know the syntax — Claude will translate for you.

How crons fire

Managing crons

Skills and prompts

The cron prompt can be anything:

Listing and deleting

List my crons
Delete the morning catchup cron

Why use Clawback for events

Channels like Telegram deliver messages directly into Claude's context — if two arrive at once, they compete for attention and can interrupt each other mid-task. There's no ordering, no queue, and no guarantee that Claude finishes one thing before starting the next.

Clawback is different. Events go through a managed queue — one at a time, each fully processed and acknowledged before the next one starts. If events arrive while Claude is busy, they wait. If you're offline, they queue on the server until you reconnect. Nothing is lost, nothing is interrupted (unless you explicitly use interrupt priority).

This makes Clawback the right choice for anything that needs reliable, sequential processing: webhook handlers, cron jobs, automated workflows, and multi-agent coordination.

Session tags

When you run multiple Claude Code instances, you need events to go to the right one. Session tags solve this — label each instance and target sources and crons to it.

Each Claude Code instance can have a session tag, set via an environment variable. Sources and crons can target a specific session. The server only delivers events to connections that match.

Start sessions with tags

# A session for handling deploys
CLAWBACK_SESSION=deploys claude --dangerously-load-development-channels server:clawback

# A session for monitoring alerts
CLAWBACK_SESSION=oncall claude --dangerously-load-development-channels server:clawback

# Without a tag — receives only untagged events
claude --dangerously-load-development-channels server:clawback

Creating targeted sources

When you create a source or cron from a tagged session, it automatically targets that session. Tell Claude what you want:

Set up a webhook source for our deploy pipeline notifications.

Because you're in the deploys session, the source automatically targets deploys. Webhooks from this source will only go to this session, never your other ones.

You can also explicitly target a different session:

Create a Sentry webhook source and target it to the oncall session.

Routing rules

ScenarioResult
Event tagged deploys, session deploys connectedDelivered immediately
Event tagged deploys, session deploys not connectedQueued until it reconnects
Event tagged deploys, only oncall connectedNot delivered (wrong tag)
Untagged event, untagged session connectedDelivered immediately
Untagged event, only tagged sessions connectedNot delivered

The key rule: tagged sessions only receive events with their tag, and untagged sessions only receive untagged events.

Inter-agent messaging

Sessions can send messages directly to each other — no webhook setup needed. Each session can discover other connected sessions and start a conversation.

Here's a real example. You have two tagged sessions — deploys managing releases and oncall handling alerts:

Ask the oncall session if there are any blockers before we deploy.

Claude in deploys discovers oncall via session_list, sends a message, and they coordinate directly:

deploys → oncall: "Hey, we're about to push v2.4.0. Any open incidents or blockers I should know about?"

oncall → deploys: "There's a memory leak in the payments service — found it an hour ago, patch is ready but not merged. Hold the deploy until I confirm the fix is in."

deploys → oncall: "Got it, holding deploy. Let me know when the fix lands and I'll include it."

Each message is delivered as an event in the receiving session. Claude processes it, decides how to respond, and sends a reply back — all without any user involvement after the initial prompt.

You can also broadcast to every connected session at once:

Broadcast to all sessions: deploy freeze starts now, hold all changes.

Messages to offline sessions are durably queued and delivered when they reconnect. Broadcasts (*) go only to currently connected sessions.

Disable inter-agent messaging per-session with "sessionMessaging": false in config.

Webhook source tools

ToolDescription
source_createCreate a webhook source with optional HMAC verification (github, stripe, generic, none), event type extraction, route mapping, and session targeting
source_listList all configured webhook sources with their slugs, verification types, routes, and session tags
source_deleteDelete a webhook source by ID

Cron job tools

ToolDescription
cron_createCreate a persistent cron job with a 5-field schedule, prompt/skill, optional label, and session targeting
cron_listList all cron jobs with their schedules, prompts, labels, and session tags
cron_deleteDelete a cron job by ID

Event tools

ToolDescription
event_ackAcknowledge the current event with a summary of what was done. Required after every webhook and cron event — the next event won't arrive until you ack

Account & token tools

ToolDescription
account_infoShow your webhook base URL, profile ID, connected client count, and current session tag
event_historyView recent event processing history — source, skill, summary, duration, and whether it timed out
token_createCreate an additional connection token for use on another machine — does not affect the current connection
token_listList all connection tokens with labels and last seen times. Marks which token is currently in use. Does not reveal token values
token_rotateRotate your connection token — creates a new one, revokes the old, and updates your local config file

Messaging tools

ToolDescription
session_sendSend a message to another session by tag. Supports comma-separated targets or * to broadcast to all connected sessions
session_listList all currently connected sessions for your account, with session tags

Event priority

Webhook sources, crons, and session messages support a priority parameter:

LevelBehavior
normalDefault. Added to the back of the queue.
priorityJumps to the front of the queue. Still waits for the current event to finish.
interruptImmediately stops the current event (re-queues it to the front) and dispatches. Use for production emergencies.
Send an interrupt message to the deploys session: production is down, stop the deploy immediately.