/clickhouse-pack:clickhouse-data-handlingfrom clickhouse-pack
Manages data lifecycle in ClickHouse: TTL expiration, GDPR/CCPA deletion, data masking, column-level encryption, and audit logging.
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.
Manage the full data lifecycle in ClickHouse: TTL-based expiration, GDPR/CCPA
deletion, data masking, partition management, and audit trails. This skill
produces migration SQL and TypeScript client code you write into your project,
then verifies the results against ClickHouse system.* tables.
The workflow below is the high-level path — each step links to the full, copy-ready SQL/TypeScript in references/implementation.md, with end-to-end scenarios in references/examples.md.
Before starting, confirm you have:
clickhouse-core-workflow-a).DELETE FROM; older versions
must use mutation-based ALTER TABLE ... DELETE.system.mutations and system.parts to verify deletions.Work the six steps in order for a new table, or jump to the one you need. Use
Write/Edit to place the generated SQL into a migration file (or the
TypeScript into your data-access layer), then run it against ClickHouse and
verify via the system.* queries. Full code for each step lives in
references/implementation.md.
TTL-based expiration — attach a TTL clause so data self-deletes, or use
tiered TO VOLUME storage (hot → cold → delete) and column-level TTL to null
out PII while keeping the row. Skeleton:
ALTER TABLE analytics.events
MODIFY TTL created_at + INTERVAL 90 DAY;
GDPR/CCPA deletion — choose lightweight DELETE FROM (23.3+), verifiable
ALTER TABLE ... DELETE (the compliant path), or DROP PARTITION for bulk.
Always confirm completion in system.mutations.
Masking & anonymization — expose a CREATE VIEW that sipHash64-hashes
identifiers and shows only email domains, gated by a dictionary allowlist.
DSAR export & delete — the TypeScript exportUserData / deleteUserData
helpers loop every table for one user_id and log each deletion.
Audit trail — an immutable, TTL-free audit_log table partitioned by
month so retention actions are provable.
Retention monitoring — a system.tables/system.parts join that reports
size, age span, and any MergeTree table missing a TTL.
| Category | Examples | Handling in ClickHouse |
|---|---|---|
| PII | Email, name, IP | Column-level TTL, masking views, deletion support |
| Sensitive | API keys, tokens | Never store in ClickHouse — use secret managers |
| Business | Event counts, metrics | Standard TTL, aggregate for long-term retention |
| Audit | Access logs | No TTL, immutable, partitioned by month |
Applying this skill produces:
CREATE TABLE/ALTER TABLE statements adding TTL clauses,
masking views, and the immutable audit_log table, ready to commit as a
migration file.exportUserData and deleteUserData functions
for DSAR and erasure requests against @clickhouse/client.system.mutations / system.parts / system.tables
SELECTs that prove a deletion finished and flag tables missing retention.audit_log row per compliance action.| Issue | Cause | Solution |
|---|---|---|
| Mutation stuck | Large table rewrite | Check system.mutations, cancel if needed |
| TTL not expiring | No merges running | OPTIMIZE TABLE ... FINAL to force |
| DELETE not working | Old ClickHouse version | Use ALTER TABLE DELETE (mutation) |
| Export timeout | Too much user data | Add LIMIT or export in batches |
A minimal TTL attach — the smallest useful action:
ALTER TABLE analytics.events
MODIFY TTL created_at + INTERVAL 90 DAY;
OPTIMIZE TABLE analytics.events FINAL; -- force the cleanup now
Full worked scenarios — a complete GDPR erasure (export → verifiable delete → audit log), standing up a retention-safe table with tiered storage, and auditing for tables missing a retention policy — are in references/examples.md. The step-by-step SQL and TypeScript each example composes lives in references/implementation.md.
For role-based access control that restricts who can run these deletion and
export operations, see the companion skill clickhouse-enterprise-rbac. For the
table schemas these lifecycle rules attach to, see clickhouse-core-workflow-a.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin clickhouse-pack24 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".
Other plugins' skills for the same job