PlugWiki

ClickHouse Best Practices: a skill that checks your ClickHouse schemas and queries against 31 rules

ClickHouse Inc's skill makes Claude check your ClickHouse tables, queries and insert plans against 31 written rules and name the rule behind each finding.

Installs
22.1K
on skills.sh
Stars
565
on GitHub
Files
36
besides SKILL.md
Updated
Oct 2026
last repo commit

The skill tells Claude to look up its rule files before it answers any ClickHouse question, apply the ones that fit, and cite them as "Per rule-name". The 31 rules cover primary keys, data types, partitioning, JOINs, skipping indices, materialized views, insert batching, updates and deletes, and how an agent should connect to and explore a database.

It triggers on CREATE TABLE and ALTER TABLE statements, ORDER BY or PRIMARY KEY talk, slow queries, JOIN tuning, ingestion design and agent access to ClickHouse. A review comes back as a list of rules checked, violations (current, required, fix) and prioritised recommendations. The skill bundles no scripts. It is Markdown rules plus one compiled file, AGENTS.md, that holds all of them in one place.

The rules also describe how an agent connects to ClickHouse. If you let Claude run queries, read the permissions section below first.

Good for

  • Developers designing ClickHouse tables who want ORDER BY, types and partitions reviewed
  • Engineers fixing slow ClickHouse queries and JOINs
  • Teams that let an AI agent query ClickHouse and want guard rails on those queries

Install clickhouse-best-practices

Claude Code

  1. 1

    Copy this prompt.

    Install the clickhouse-best-practices skill in Claude Code. Run this command:
    
    npx skills add https://github.com/clickhouse/agent-skills --skill clickhouse-best-practices
    
    Then check that it loaded and tell me how to use it.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js.

From its listing on skills.sh. Source.

What's in the skill

When it loads

MUST USE when reviewing ClickHouse schemas, queries, or configurations. Contains 31 rules that MUST be checked before providing recommendations. Always read relevant rule files and cite specific rules in responses.

Sections in SKILL.md

  1. IMPORTANT: How to Apply This Skill
  2. Agent Connectivity & Query Workflow
  3. Subagent architecture notes
  4. Review Procedures
  5. For Schema Reviews (CREATE TABLE, ALTER TABLE)
  6. For Query Reviews (SELECT, JOIN, aggregations)
  7. For Insert Strategy Reviews (data ingestion, updates, deletes)
  8. Output Format
  9. Rules Checked
  10. Findings
  11. Violations
  12. Compliant
  13. Recommendations
  14. Rule Categories by Priority
  15. Quick Reference
  16. Schema Design - Primary Key (CRITICAL)

Key facts

License
Apache-2.0
Installs on skills.sh
22,118 as of 2026-11-02
Last repo commit
2026-10-30
Files in the skill folder
37 files including SKILL.md
Version
0.4.0

What it includes

  • Checks CREATE TABLE and ALTER TABLE against 9 schema rules

    Reads the primary key, data type and partitioning rules in order. It checks column order in ORDER BY from low to high cardinality, numeric sizes, LowCardinality, Nullable vs DEFAULT and partition counts of 100 to 1,000.

    Schema review

  • Checks SELECT, JOIN and aggregation queries against 5 rules

    Looks at JOIN algorithm choice, filtering before the join, ANY JOIN, skipping indices and whether filters use the ORDER BY prefix.

    Query review

  • Checks batching, updates and deletes against 5 rules

    Looks for batches of 10K to 100K rows, alternatives to ALTER TABLE UPDATE, lightweight DELETE or DROP PARTITION, async inserts and OPTIMIZE TABLE risks.

    Insert strategy review

  • Connect, discover the schema, plan, run with limits, recover

    The agent rules ask Claude to connect over MCP or the ClickHouse CLI, explore databases, tables, columns and sort keys, then run queries with LIMIT and timeouts.

    Network · Agent connectivity and query workflow

  • Rules checked, violations, compliant items, recommendations

    Every review lists each rule as compliant or violated, then findings with current state, required state and fix.

    Review report format

  • All 31 rules expanded in one file

    A compiled copy of every rule so Claude can check several at once without opening each file.

    AGENTS.md

From the official docs

Permissions

Medium risk

If you let Claude connect to a live ClickHouse database, a bad query can scan or load a lot of data. Use a read-only database user and keep write access off.

What it can do

Watch out for

  • Rules cover connecting Claude to your database

    The skill bundles no scripts, but its agent-connect-mcp rule shows `pip install mcp-clickhouse`, MCP, ClickHouse CLI and curl commands that use a database password (the curl example sends it in a header). Use a database user with only the access you want Claude to have.

  • Self-hosted MCP can be set to allow writes

    The rules show an environment variable that turns on write access for mcp-clickhouse. Leave it unset unless Claude needs to change data.

  • The rules tell agents to cap query cost

    The agent-query-safety rule asks for LIMIT, scan caps and a max execution time on every agent-written query. Check that Claude includes them before you run a query on a large table.

Technical details
Turning on read-onlyThe agent-connect-mcp rule describes the hosted ClickHouse Cloud MCP server as read-only, and says writes on the self-hosted MCP server need CLICKHOUSE_ALLOW_WRITE_ACCESS=true.
Talks toRules show how to connect to a ClickHouse Cloud MCP server, the ClickHouse CLI or its HTTP interface, using your host and credentials

Questions

What does the ClickHouse Best Practices skill do?

It makes Claude check ClickHouse schemas, queries and insert plans against 31 written rules before it answers, and cite the rule it used. If no rule fits, SKILL.md tells Claude to fall back on its own ClickHouse knowledge or documentation.

How do I install it in Claude Code, the Claude app or Codex?

Use the install box above. The README documents npx skills add clickhouse/agent-skills, which finds the agents you have and asks where to install, and a clickhousectl skills command. The README lists Claude Code (.claude/skills/) and Codex (.codex/skills/) among supported agents. It does not describe a Claude app upload.

Does it need an API key or a ClickHouse connection?

Reviewing code you paste in needs neither. The agent rules cover connecting to a live database, with credentials such as a host, user and password or a sign-in to the hosted ClickHouse Cloud MCP server.

Is it safe to install?

It is Markdown rules and bundles no scripts. The risk comes from what you let Claude do with a database connection. The rules say to cap every agent query with a LIMIT and a time limit, and one rule shows how to switch on write access for a self-hosted MCP server, so keep that switch off unless you need it.

Does it work with ClickHouse Cloud and self-hosted ClickHouse?

Yes. The README says the skills work with open-source ClickHouse and managed ClickHouse Cloud.

What else is in the clickhouse/agent-skills repo?

The repo holds other ClickHouse skills, including one for chdb, the in-process ClickHouse for Python. This page covers only clickhouse-best-practices, which installs on its own.

Information

updated Nov 2, 2026

Folder
skills/clickhouse-best-practices

clickhouse/agent-skillsskills.sh

Sources

Docs, issue trackers and discussions this page is built from.

Show all 4
  1. SKILL.md · github.com
  2. agent-skills README · github.com
  3. agent-connect-mcp rule · github.com
  4. agent-query-safety rule · github.com

Updated Nov 2, 2026.