cursor-webhooks

Instructions for receiving Cursor Cloud Agent notifications when an agent's work changes status, then checking that each notification is genuine.

In plain words
What is it for?
Use it to build or debug handlers for Cursor Cloud Agent ERROR and FINISHED events.
Why use it?
It removes common signature-verification mistakes, such as parsing the request body before checking its signature or accepting the wrong algorithm.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/hookdeck/webhook-skills/cursor-webhooks
Any agent
npx skills add hookdeck/webhook-skills --skill cursor-webhooks
Clone the repo
git clone --depth 1 https://github.com/hookdeck/webhook-skills

Made for: Claude Code, Codex.

Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,435 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 84% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00038 $0.01435
Opus 5 $0.00019 $0.00718
Sonnet 5 $0.00008 $0.00287
Haiku 4.5 $0.00004 $0.00144

Measured 2d ago against content hash e836c28de743, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursor-webhooks scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (examples/express/src/index.js, examples/express/test/webhook.test.js, examples/fastapi/main.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

84% identical to adyen-webhooks — 243 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/cursor-webhooks/SKILL.md · 190 lines

How it starts

The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cursor Webhooks

When to Use This Skill

  • Setting up Cursor Cloud Agent webhook handlers
  • Debugging signature verification failures
  • Understanding Cursor webhook event types and payloads
  • Handling Cloud Agent status change events (ERROR, FINISHED)

Essential Code (USE THIS)

Cursor Signature Verification (JavaScript)

const crypto = require('crypto');

function verifyCursorWebhook(rawBody, signatureHeader, secret) {
  if (!signatureHeader || !secret) return false;

  // Cursor sends: sha256=xxxx
  const [algorithm, signature] = signatureHeader.split('=');
  if (algorithm !== 'sha256') return false;

  const expected = crypto
    .createHmac('sha256', secret)
    .update(rawBody)
    .digest('hex');

  try {
    return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
  } catch {
    return false;
  }
}

Express Webhook Handler

const express = require('express');
const app = express();

// CRITICAL: Use express.raw() - Cursor requires raw body for signature verification
app.post('/webhooks/cursor',
  express.raw({ type: 'application/json' }),
  (req, res) => {
    const signature = req.headers['x-webhook-signature'];
    const webhookId = req.headers['x-webhook-id'];
    const event = req.headers['x-webhook-event'];

    // Verify signature
    if (!verifyCursorWebhook(req.body, signature, process.env.CURSOR_WEBHOOK_SECRET)) {
      console.error('Cursor signature verification failed');
      return res.status(401).send('Invalid signature');
    }

    // Parse payload after verification
    const payload = JSON.parse(req.body.toString());

    console.log(`Received ${event} (id: ${webhookId})`);

    // Handle status changes
    if (event === 'statusChange') {
      console.log(`Agent ${payload.id} status: ${payload.status}`);

      if (payload.status === 'FINISHED') {
        console.log(`Summary: ${payload.summary}`);
      } else if (payload.status === 'ERROR') {
        console.error(`Agent error for ${payload.id}`);
      }
    }

    res.json({ received: true });
  }
);

Read the full file on GitHub · 190 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 190 lines · 38 tokens per session scan A e836c28de743

Subscribe to this mod's changes

cursor-webhooks is a skill published in the GitHub repository hookdeck/webhook-skills (84 stars, last pushed 5d ago), licensed MIT. It adds 38 tokens to every session and 1,435 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 84% identical to adyen-webhooks, differing in 243 lines, and is treated as a copy.

Related

Other skills, from other repositories

domain-hunter

Search domains, compare prices, find promo codes, get purchase recommendations. Use when user wants to buy a domain, check domain prices, find domain deals, compare registrars, or search for .ai/.com domains.

ReScienceLab/opc-skills · 48 tokens

memstack-content-product-description

Use this skill when the user says 'product description', 'product listing', 'product copy', 'Amazon listing', 'Shopify listing', 'e-commerce copy', or needs conversion-optimized product descriptions with benefit-driven headlines and platform-specific SEO. Do NOT use for pricing strategy or sales funnels.

cwinvestments/memstack · 65 tokens

intuitive-port-worktree

Port changes from one git worktree or checkout into the default repository folder's current branch, then by default sync the result to the remote default branch when everything is clean. Use when the user asks to move, copy, transfer, transplant, cherry-pick, apply a patch, or port worktree changes into the…

MiaoDX/intuitive-flow · 79 tokens

form-cro

When the user wants to optimize any form that is NOT signup/registration — lead capture, contact, demo request, application, survey, or checkout forms; "form friction," "form completion rate," "form abandonment," "too many fields," "nobody fills out our form." For signup/registration forms, see signup-flow-cro. For…

rajitsaha/100xprism · 84 tokens

git-workflow

Using git without hanging, clobbering, or over-committing. Use before any git command that changes state (commit, push, checkout, rebase, reset) and when inspecting repo history or status.

Zfinix/aster · 48 tokens

frappe-payments

Frappe Payments and ERPNext payment workflow guidance for payment gateways, payment requests, subscriptions, invoices, reconciliation, webhooks, and secure checkout flows. Use when work touches payments in Frappe or ERPNext.

Dkm0315/frappe-agent · 49 tokens