/clickhouse-pack:clickhouse-core-workflow-bfrom clickhouse-pack
Inserts, queries, and aggregates data in ClickHouse using SQL patterns. Covers bulk inserts, analytical queries, materialized views, and parameterized queries.
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.
Move data into ClickHouse efficiently, then answer analytical questions with
aggregations, funnels, retention, window functions, and materialized views.
This skill covers the read/write half of the core workflow: the fast-path insert
patterns that avoid "too many parts", the parameterized query API for Node.js,
and pre-aggregation via materialized views. The high-frequency patterns live
inline below; the deep query library and advanced engine patterns are broken out
into references/ so you can drill in only when you need them.
clickhouse-core-workflow-a first if not.@clickhouse/client installed and connected (CLICKHOUSE_HOST, CLICKHOUSE_USER,
CLICKHOUSE_PASSWORD in the environment).analytics.events).Batch rows and let the client buffer. ClickHouse writes a new "part" per INSERT, so many tiny inserts are the number-one performance mistake.
import { createClient } from '@clickhouse/client';
const client = createClient({
url: process.env.CLICKHOUSE_HOST!,
username: process.env.CLICKHOUSE_USER ?? 'default',
password: process.env.CLICKHOUSE_PASSWORD ?? '',
});
// Insert many rows efficiently — @clickhouse/client buffers internally
await client.insert({
table: 'analytics.events',
values: events, // Array of objects matching table columns
format: 'JSONEachRow',
});
Streaming a file (CSV, Parquet, etc.) uses the same call with a read stream and
the matching format (e.g. CSVWithNames).
Insert best practices:
Aggregate with count(), uniqExact(), and time filters. The canonical
"top events by tenant" shape:
SELECT tenant_id, event_type, count() AS event_count, uniqExact(user_id) AS unique_users
FROM analytics.events
WHERE created_at >= now() - INTERVAL 7 DAY
GROUP BY tenant_id, event_type
ORDER BY event_count DESC
LIMIT 100;
Funnel, retention, and safe parameterized-query patterns are in references/queries.md.
For dashboards, pre-aggregate on INSERT with a materialized view backed by an
AggregatingMergeTree target, then merge states at read time. Window functions
(row_number(), running totals via OVER (PARTITION BY ...)) and the full
function reference table are in
references/advanced.md.
Applying this skill produces:
client.insert(...) call (or file stream) that
loads rows without triggering "too many parts".rs.json(), ready
to feed a dashboard or API response.| Error | Cause | Solution |
|---|---|---|
Too many parts (300) | Frequent small inserts | Batch inserts, increase parts_to_throw_insert |
Memory limit exceeded | Large GROUP BY / JOIN | Add WHERE filters, increase max_memory_usage |
UNKNOWN_FUNCTION | Wrong ClickHouse version | Check SELECT version() |
Cannot parse datetime | Wrong format | Use YYYY-MM-DD HH:MM:SS format |
values to your row shape.For error troubleshooting once queries are running, see clickhouse-common-errors.
For table and schema design, revisit clickhouse-core-workflow-a.
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".
/clickhouse-cost-tuningOptimize ClickHouse Cloud costs — compute scaling, storage tiering, compression,
and query efficiency for lower bills.
Use when analyzing ClickHouse Cloud bills, reducing storage costs, or optimizing
compute utilization.
Trigger with "clickhouse cost", "clickhouse billing", "reduce clickhouse spend",
"clickhouse pricing", "clickhouse expensive", "clickhouse storage cost".
/clickhouse-data-handlingHandle data lifecycle in ClickHouse — TTL expiration, data deletion (GDPR),
column-level encryption, and audit logging with real ClickHouse SQL.
Use when implementing data retention, fulfilling GDPR/CCPA deletion requests,
or managing sensitive data in ClickHouse.
Trigger with "clickhouse data retention", "clickhouse TTL", "clickhouse GDPR",
"delete data clickhouse", "clickhouse data lifecycle", "clickhouse PII".
/clickhouse-debug-bundleCollect ClickHouse diagnostic data — system tables, query logs, merge status,
and server metrics for support tickets and troubleshooting.
Use when investigating persistent issues, preparing debug artifacts,
or collecting evidence for ClickHouse support.
Trigger with "clickhouse debug", "clickhouse diagnostics",
"clickhouse support bundle", "collect clickhouse logs",
"clickhouse system tables".
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin clickhouse-packOther plugins' skills for the same job