triaging-live-sql-activity

triaging-live-sql-activity is a skill for Claude Code, Codex from cockroachlabs/cockroachdb-skills. It costs 61 tokens per session (3,309 once invoked), scanned A, original, Apache-2.0.

A guide for checking a live CockroachDB database using SQL. It finds long-running queries, busy connections, active transactions, and the applications behind them.

In plain words
What is it for?
Use it to find runaway queries, stuck transactions, and resource-heavy users or applications, and to create SQL for cancelling them.
Why use it?
It helps investigate a slow or overloaded database when the web console or monitoring systems are unavailable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

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/cockroachlabs/cockroachdb-skills/triaging-live-sql-activity
Any agent
npx skills add cockroachlabs/cockroachdb-skills --skill triaging-live-sql-activity
Clone the repo
git clone --depth 1 https://github.com/cockroachlabs/cockroachdb-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for triaging-live-sql-activity

README.md
[![agentmods](https://agentmods.dev/badge/skills/cockroachlabs/cockroachdb-skills/triaging-live-sql-activity.svg)](https://agentmods.dev/skills/cockroachlabs/cockroachdb-skills/triaging-live-sql-activity)
Your own site
<a href="https://agentmods.dev/skills/cockroachlabs/cockroachdb-skills/triaging-live-sql-activity"><img src="https://agentmods.dev/badge/skills/cockroachlabs/cockroachdb-skills/triaging-live-sql-activity.svg" alt="Measured on agentmods" height="20"></a>
Per session 61 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,309 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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.1 $0.00061 $0.03309
Opus 5 $0.00030 $0.01655
Sonnet 5 $0.00012 $0.00662
Haiku 4.5 $0.00006 $0.00331

Measured 6d ago against content hash 7aff882278b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

triaging-live-sql-activity 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 6d ago.

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

Copies of this mod

2 near-identical copies found in the catalogue:

skills/cockroachdb-observability-and-diagnostics/triaging-live-sql-activity/SKILL.md · 397 lines

How it starts

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

Triaging Live SQL Activity

Diagnoses live cluster performance issues by identifying currently active long-running queries, busy sessions, and active transactions. Uses SQL-only interfaces (SHOW statements and crdb_internal views) to provide immediate triage without requiring DB Console, HTTP endpoints, or Prometheus access.

When to Use This Skill

  • Users report "the cluster is slow right now"
  • High CPU or memory usage on cluster nodes
  • Need to identify runaway queries or stuck transactions
  • Want to find which applications/users are consuming resources
  • Require immediate triage without DB Console access
  • Need to generate SQL to cancel problematic sessions/queries

For historical performance analysis: Use profiling-statement-fingerprints to analyze query patterns over time, identify slow fingerprints, and investigate trends without needing live queries. For transaction-level analysis: Use profiling-transaction-fingerprints to analyze historical transaction retry patterns, commit latency trends, and statement composition. For background job monitoring: Use monitoring-background-jobs to monitor schema changes, backups, and automatic jobs that don't appear in SHOW CLUSTER STATEMENTS.

Prerequisites

Required SQL access:

  • Connection to any CockroachDB node
  • For cluster-wide visibility: VIEWACTIVITY or VIEWACTIVITYREDACTED privilege
    • VIEWACTIVITYREDACTED: Redacts constants in other users' queries (recommended for privacy)
    • VIEWACTIVITY: Shows full query text for all users
    • Without these: Only see your own sessions/queries
  • Basic understanding of SQL query execution
  • (Optional) CANCELQUERY / CANCELSESSION privileges for cancellation operations

Check your privileges:

SHOW SYSTEM GRANTS FOR <username>;

See permissions reference for detailed RBAC setup.

Read the full file on GitHub · 397 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago First seen · 397 lines · 61 tokens per session scan A 7aff882278b0

Subscribe to this mod's changes

triaging-live-sql-activity is a skill published in the GitHub repository cockroachlabs/cockroachdb-skills (21 stars, last pushed 1mo ago), licensed Apache-2.0. It adds 61 tokens to every session and 3,309 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

fix-failing-tests

Diagnose a failing test in the googleapis/mcp-toolbox repo and land a fix by reasoning from the actual error: read the failure, reproduce it, shrink it until the cause is forced into the open, then fix the cause. Use this whenever a test or CI job is red, a build breaks after a change, many packages fail at once, or a…

googleapis/mcp-toolbox · 87 tokens

triage-issues

Triage GitHub issues in the googleapis/mcp-toolbox repo: propose the correct labels (type / priority / product / status), check for duplicates, verify a bug has enough info to act on, and draft a triage comment. Use whenever a maintainer asks you to triage, label, categorize, prioritize, or "look at" an issue (or a…

googleapis/mcp-toolbox · 164 tokens

postgresql-indexing

PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing…

prowler-cloud/prowler · 108 tokens

graphjin-eval

Create, extend, run, baseline, and diagnose GraphJin agent evaluations through the graphjin eval CLI.

dosco/graphjin · 27 tokens

django-perf-review

Django performance code review. Use when asked to "review Django performance", "find N+1 queries", "optimize Django", "check queryset performance", "database performance", "Django ORM issues", or audit Django code for performance problems.

getsentry/skills · 55 tokens

byted-bytehouse-slow-query

ByteHouse慢查询分析和性能优化工具,用于识别和分析慢查询、查询性能优化建议、查看查询执行计划、分析查询历史趋势。当用户需要识别和分析ByteHouse数据库中的慢查询、查询性能优化建议、查看查询执行计划、分析查询历史趋势时,使用此Skill。.

bytedance/agentkit-samples · 74 tokens