From claude-code-sentry-monitor
Set up Sentry observability for Claude Code sessions. Use when someone says "set up Sentry monitoring", "add observability to Claude Code", "configure claude-code-sentry-monitor", "trace Claude Code sessions", "monitor Claude Code with Sentry", or "instrument Claude Code". Interactively collects DSN and preferences, then writes the config file.
How this skill is triggered — by the user, by Claude, or both
Slash command
/claude-code-sentry-monitor:claude-code-sentry-monitorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are setting up the `claude-code-sentry-monitor` plugin, which instruments Claude Code sessions as distributed traces in Sentry. This is a developer-level tool — the config is global (per-machine), not per-project.
You are setting up the claude-code-sentry-monitor plugin, which instruments Claude Code sessions as distributed traces in Sentry. This is a developer-level tool — the config is global (per-machine), not per-project.
~/.config/claude-code/sentry-monitor.jsonLook for an existing config in these locations (in order):
CLAUDE_SENTRY_CONFIG env var (if set)~/.config/claude-code/sentry-monitor.json (main config)~/.config/sentry-claude/config (legacy KEY=VALUE format)Use the read tool to check each. If one exists, show the current config and ask: "A config already exists — do you want to update it or leave it as-is?"
If a legacy config exists at ~/.config/sentry-claude/config, offer to migrate it to the new JSON format.
Before asking questions, silently gather:
Developer identity — try each in order, use the first that returns a value:
gh api user --jq .login 2>/dev/null # GitHub username
git config user.email 2>/dev/null # fallback: git email
git config user.name 2>/dev/null # fallback: git name
whoami # last resort
Ask these questions, showing auto-detected values as defaults:
Sentry DSN (required) — "Paste your DSN from Sentry → Project Settings → Client Keys. Looks like: https://[email protected]/789"
Developer tag — "We detected your identity as <detected-identity>. Want to tag your traces with this? It lets you filter Sentry data by developer. (yes/no, default: yes)"
Environment (optional) — "What environment name should appear on traces? e.g. development, production. Leave blank to omit."
Record tool inputs/outputs — "Record tool inputs and outputs as span attributes? Useful for debugging but can be verbose. (yes/no, default: yes)"
Traces sample rate (optional) — "What fraction of sessions to trace? 1 = 100%, 0.5 = 50%. Leave blank for the default (1)."
Build the config from the answers. Only include fields that differ from defaults or were explicitly set. Defaults are: tracesSampleRate: 1, recordInputs: true, recordOutputs: true.
Always write to ~/.config/claude-code/sentry-monitor.json. Create ~/.config/claude-code/ if it doesn't exist.
If the user confirmed the developer tag, add it under tags:
{
"tags": {
"developer": "<detected-identity>"
}
}
Example minimal config:
{
"dsn": "https://[email protected]/789",
"tags": {
"developer": "sergical"
}
}
Example fuller config:
{
"dsn": "https://[email protected]/789",
"environment": "development",
"recordOutputs": false,
"tracesSampleRate": 0.5,
"tags": {
"developer": "sergical"
}
}
Show the user the config that was written and where it was saved.
Then tell them:
"The plugin will activate automatically on your next Claude Code session. Tool calls will appear as spans in your Sentry AI Agents dashboard."
| Field | Default | Description |
|---|---|---|
dsn | required | Sentry DSN |
environment | — | Environment tag |
recordInputs | true | Capture tool input args as span attributes |
recordOutputs | true | Capture tool output as span attributes |
tracesSampleRate | 1 | Fraction of sessions to trace (0-1) |
maxAttributeLength | 12000 | Max chars per span attribute |
enableMetrics | false | Emit Sentry token usage metrics |
tags | {} | Custom tags on every span |
mode | batch | batch (default) or realtime |
No traces appearing — Check the DSN, ensure tracesSampleRate is 1. Traces flush at session end in batch mode.
Plugin not loading — Start Claude Code with claude --plugin-dir /path/to/claude-code-sentry-monitor, or install permanently via /plugin marketplace add sergical/claude-code-sentry-monitor.
npx claudepluginhub sergical/claude-code-sentry-monitor --plugin claude-code-sentry-monitorConfigures Sentry for local dev: env-aware DSN routing, debug mode, 100% sample rates, beforeSend logging, Spotlight UI, sentry-cli source maps. For Node/TS or Python.
Configures Sentry AI Agent Monitoring by detecting installed AI SDKs (OpenAI, Anthropic, LangChain, etc.) and setting up integrations for LLM call tracking, agent executions, and token monitoring.
Checks and configures Sentry error tracking SDKs for frontend, Next.js, Node.js, and Python projects including DSN env vars, source maps, and CI/CD release tracking.