Capture exceptions, attach user/context, add spans and breadcrumbs, and log via the Sentry SDK. Use when instrumenting errors, performance, or context in app code.
Ships in andrelandgraf-fullstackrecipes. 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.
None: SKILL.md is the whole skill.
Capture exceptions, add context, trace performance, and log with Sentry.
Complete these setup recipes first:
Capture errors that are handled but still worth tracking.
import * as Sentry from "@sentry/nextjs";
try {
await riskyOperation();
} catch (err) {
Sentry.captureException(err);
}
setUser persists for the session. Attach tags (indexed, filterable) and extra (arbitrary detail) per exception.
import * as Sentry from "@sentry/nextjs";
Sentry.setUser({ id: session.user.id, email: session.user.email });
Sentry.captureException(err, {
tags: { feature: "checkout", plan: "pro" },
extra: { orderId: "order_123", items: cart.items },
});
Clear the user on sign out.
Sentry.setUser(null);
Wrap meaningful operations in startSpan. The sync form receives the span for attributes.
import * as Sentry from "@sentry/nextjs";
const users = await Sentry.startSpan(
{ op: "http.client", name: "GET /api/users" },
async () => (await fetch("/api/users")).json(),
);
Sentry.startSpan({ op: "ui.click", name: "Submit Button Click" }, (span) => {
span.setAttribute("form", "checkout");
processSubmit();
});
Console logs, fetches, and UI clicks are captured automatically. Add manual breadcrumbs for custom events.
import * as Sentry from "@sentry/nextjs";
Sentry.addBreadcrumb({
category: "auth",
message: "User signed in",
level: "info",
});
Structured logs surface in the Logs tab.
import * as Sentry from "@sentry/nextjs";
const { logger } = Sentry;
logger.info("Payment processed", { orderId: "123", amount: 99.99 });
logger.warn("Rate limit approaching", { current: 90, max: 100 });
logger.error("Payment failed", { orderId: "123", reason: "declined" });
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/andrelandgraf-fullstackrecipes:sentry-best-practicesfrom andrelandgraf-fullstackrecipes
andrelandgraf-fullstackrecipes@cascade-code-general-misc-3 is listed by joshuarweaver/cascade-code-general-misc-3 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-code-general-misc-3 --plugin andrelandgraf-fullstackrecipes12 skills in this plugin
/analytics-best-practicesTrack custom events and conversions with Vercel Web Analytics via the track() call. Use when instrumenting user actions, conversions, or form submissions./authentication-best-practicesRead sessions client- and server-side, guard routes, and run sign in/up/out with Better Auth. Use when gating pages/APIs on auth or wiring auth flows./drizzle-queriesWrite type-safe Postgres queries with Drizzle ORM (select/insert/update/delete, relations, new tables). Use when querying or mutating the database or adding a Drizzle table.Other plugins' skills for the same job