/clickhouse-pack:clickhouse-debug-bundlefrom clickhouse-pack
Collects ClickHouse diagnostic data (system tables, query logs, merge status, server metrics) for troubleshooting and support tickets.
Ships in clickhouse-pack. 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.
Read when SKILL.md points to them.
Collect comprehensive diagnostic data from ClickHouse system.* tables for
troubleshooting performance issues, merge problems, or support escalation. The
skill runs a graduated set of queries — server health, disk and table health,
query performance, and merge/mutation status — then packages the output into a
single artifact you can attach to a support ticket.
SELECT permission on system.* tables
(grant SELECT ON system.* to a restricted user if needed).curl (for the HTTP interface, port 8123) or clickhouse-client.CLICKHOUSE_HOST, CLICKHOUSE_USER, CLICKHOUSE_PASSWORD.log_queries = 1 must be enabled on the server.Work through the four diagnostic areas below. For an interactive investigation, run the query for the symptom you are chasing; to produce a full artifact, run the automated collector in Step 5. The complete query set for every step lives in references/diagnostic-queries.md.
Confirm the server version, uptime, and current-load gauges first — this frames every later finding.
SELECT
version() AS version,
uptime() AS uptime_seconds,
formatReadableTimeDelta(uptime()) AS uptime_human,
currentDatabase() AS current_db;
Then snapshot system.metrics for the key gauges (Query, Merge,
MemoryTracking, connection counts). Full metric list in the reference.
Find the largest tables and any table under merge pressure (too many active
parts). The full query set covers per-table disk usage, the parts > 100
merge-pressure check, and per-disk free space from system.disks.
-- Tables with too many parts (merge pressure)
SELECT database, table, count() AS parts
FROM system.parts WHERE active
GROUP BY database, table
HAVING parts > 100
ORDER BY parts DESC;
Pull the slowest queries, failed queries, and normalized query patterns from
system.query_log over the last 24 hours. See the reference for the slow-query,
exception, and normalized_query_hash aggregation queries.
Inspect system.merges, pending system.mutations, and system.replicas to
spot stuck merges, long-running mutations, or replicas that have fallen behind.
Full queries in the reference.
For a one-shot artifact, use the bash or Node.js collector in references/collectors.md. Both authenticate from the environment variables above and write one file per diagnostic area:
CLICKHOUSE_HOST=http://localhost:8123 \
CLICKHOUSE_USER=default \
CLICKHOUSE_PASSWORD=secret \
./clickhouse-debug-bundle.sh
The automated collector produces a timestamped gzipped tarball
ch-debug-YYYYMMDD-HHMMSS.tar.gz containing one TSV/TXT file per diagnostic
area:
| File | Contents |
|---|---|
version.txt | Server version, uptime, current database |
metrics.tsv | Full system.metrics snapshot (gauges) |
events.tsv | Full system.events snapshot (cumulative counters) |
tables.tsv | Per-table parts, rows, and on-disk size |
merges.tsv | Currently running merges |
errors.tsv | Exceptions from system.query_log (last hour) |
replicas.tsv | Replication status (best-effort; empty if not replicated) |
An interactive run instead returns the result set of each query directly. The
Node.js collector returns a single JSON object keyed by diagnostic area, with a
per-key { error } entry when an individual query fails.
| Issue | Cause | Solution |
|---|---|---|
system.query_log empty | Logging disabled | Set log_queries = 1 |
| Permission denied on system tables | Restricted user | Grant SELECT ON system.* |
| Bundle too large | Too much history | Narrow the INTERVAL time window |
system.replicas errors | Table not replicated | Expected — collector ignores it (|| true) |
curl: (7) connection refused | Wrong host/port | Verify CLICKHOUSE_HOST (HTTP interface is 8123) |
Investigate a slow dashboard (interactive). Run Step 1 to confirm the server is healthy, then Step 3's slow-query select to find the offending queries and Step 2's merge-pressure check to rule out a table with 100+ parts starving the merge pool.
Prepare a support ticket (artifact). Export the three connection variables
and run the Step 5 bash collector. Attach the resulting
ch-debug-YYYYMMDD-HHMMSS.tar.gz to the ticket — it gives ClickHouse support
the version, metrics, table sizes, active merges, and recent exceptions in one
file.
Collect from application code. Import collectDebugBundle from
references/collectors.md, pass it an authenticated
@clickhouse/client handle, and persist the returned JSON object alongside the
error you are triaging.
Full, runnable query text and both collector scripts: references/diagnostic-queries.md and references/collectors.md.
For connection and concurrency issues that show up as failed queries or
exhausted connection gauges in this bundle, follow up with the
clickhouse-rate-limits skill.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
24 skills in this plugin
/clickhouse-ci-integrationRun ClickHouse integration tests in CI with GitHub Actions and Docker
containers. Use when setting up automated testing against a real ClickHouse
instance, configuring CI pipelines, or implementing schema validation in CI.
Trigger with "clickhouse CI", "clickhouse GitHub Actions", "clickhouse
integration tests", "test clickhouse in CI", "clickhouse automated testing".
/clickhouse-common-errorsDiagnose and fix the top 15 ClickHouse errors — query failures, insert problems,
memory limits, and merge issues.
Use when a ClickHouse query or insert throws an exception, a server-side error
appears in logs, or a failed query needs root-cause analysis.
Trigger with "clickhouse error", "fix clickhouse", "clickhouse not working",
"debug clickhouse", "clickhouse exception", "clickhouse syntax error".
/clickhouse-core-workflow-aDesign ClickHouse schemas with MergeTree engines, ORDER BY keys, and
partitioning.
Use when creating new tables, choosing an engine, designing sort keys, or
modeling data for analytical workloads on ClickHouse or ClickHouse Cloud.
Trigger with "clickhouse schema design", "clickhouse table design",
"clickhouse ORDER BY", "clickhouse partitioning", "MergeTree table".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin clickhouse-packOther plugins' skills for the same job