altinity-expert-clickhouse/skills/altinity-expert-clickhouse-overview/SKILL.md
Runs a fast ClickHouse server health snapshot and routes to specialist skills. Use as the entry point for general health checks or when the problem area is not yet known.
npx skillsauth add altinity/skills altinity-expert-clickhouse-overviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Run reporting SQL queries from these files in this skill's directory:
Inline SQL below (version/enablement sensitive):
version-dependent: ClickHouse 23.8 does not have modification_time
SELECT
hostName() AS host,
database,
table,
reason,
count() AS detached_parts,
formatReadableSize(sum(bytes_on_disk)) AS bytes,
min(modification_time) AS first_detach,
max(modification_time) AS last_detach
FROM system.detached_parts
GROUP BY host, database, table, reason
ORDER BY detached_parts DESC
LIMIT 100
(may be disabled)
select event_date, level, thread_name, any(logger_name) as logger_name,
message_format_string, count(*) as count
from system.text_log
where event_date > now() - interval 24 hour
and level <= 'Warning'
group by all
order by level, thread_name, message_format_string
WITH
['MergesAndMutations', 'Fetches', 'Move', 'Common', 'Schedule', 'BufferFlushSchedule', 'MessageBrokerSchedule', 'DistributedSchedule'] AS pool_tokens,
['pool', 'fetches_pool', 'move_pool', 'common_pool', 'schedule_pool', 'buffer_flush_schedule_pool', 'message_broker_schedule_pool', 'distributed_schedule_pool'] AS setting_tokens
SELECT
extract(m.metric, '^Background(.*)Task') AS pool_name,
m.active_tasks,
pool_size,
round(100.0 * m.active_tasks / pool_size, 1) AS utilization_pct,
multiIf(utilization_pct > 99, 'Major', utilization_pct > 90, 'Moderate', 'OK') AS severity
FROM
(
SELECT
metric,
value AS active_tasks,
transform(extract(metric, '^Background(.*)PoolTask'), pool_tokens, setting_tokens, '') AS pool_key,
concat('background_', lower(pool_key), '_size') AS setting_name
FROM system.metrics
WHERE metric LIKE 'Background%PoolTask'
) AS m
LEFT JOIN
(
SELECT
name,
toFloat64OrZero(value) AS pool_size
FROM system.server_settings
WHERE name LIKE 'background%pool_size'
) AS s ON s.name = m.setting_name
WHERE pool_size > 0
ORDER BY utilization_pct DESC
On error and for clickhouse version <= 22.8 replace system.server_settings to system.settings
Prepare a summary report based on the findings
Based on findings, load specific modules:
altinity-expert-clickhouse-replicationaltinity-expert-clickhouse-memoryaltinity-expert-clickhouse-storagealtinity-expert-clickhouse-mergesaltinity-expert-clickhouse-reportingaltinity-expert-clickhouse-ingestionaltinity-expert-clickhouse-cachesaltinity-expert-clickhouse-dictionariessystem.errors and system.*_log summaries belowaltinity-expert-clickhouse-logsaltinity-expert-clickhouse-schemaaltinity-expert-clickhouse-metricsaltinity-expert-clickhouse-logstools
Read-only ClickHouse security audit expert for live or exported systems. Use when assessing ClickHouse security posture, reviewing users, roles, grants, settings profiles, row policies, table functions, external sources, table engines, executable UDFs, audit logs, named collections, password hash hygiene, SQL SECURITY DEFINER, impersonation, TLS/network exposure, Keeper/interserver security, encryption at rest, backups, the HTTP interface surface, cluster security, or version-specific ClickHouse security behavior. Diagnoses from SQL/system tables, supplied configuration files, query logs, access metadata, and ClickHouse/Altinity documentation.
tools
Diagnose and resolve ClickHouse grant and authentication errors, especially after upgrades. Use when queries fail with ACCESS_DENIED/NOT_ENOUGH_PRIVILEGES, AUTHENTICATION_FAILED/WRONG_PASSWORD/REQUIRED_PASSWORD, or ON CLUSTER privilege errors; when system.* or INFORMATION_SCHEMA access is denied; or when grant behavior changes after version upgrades.
tools
Profile a ClickHouse cluster via MCP and emit a per-cluster "analyst" Skill the user can save in claude.ai. Activate when the user asks to "profile this ClickHouse", "generate an analyst skill", "build a schema guide", "map the data in this cluster", or regenerate an existing cluster-analyst Skill after schema changes. Works against any ClickHouse with read-only SELECT/SHOW/DESCRIBE access via an `execute_query` MCP tool (e.g. the Altinity MCP server). Outputs a 5-file markdown bundle plus a README.
tools
Diagnose ClickHouse disk usage, compression efficiency, part sizes, and storage bottlenecks. Use for disk space issues and slow IO.