chdb-sql

chdb-sql is a skill for Claude Code from ClickHouse/agent-skills. It costs 214 tokens per session (1,292 once invoked), scanned A, a copy of chdb-sql, Apache-2.0.

A Python library that runs ClickHouse SQL directly inside your program, without requiring a separate database server. It can query files, cloud storage, data lakes, and supported remote databases.

In plain words
What is it for?
Use it to query Parquet, CSV, or JSON files, connect to databases or cloud storage, join data from multiple sources, and perform analysis in Python.
Why use it?
It removes the need to install and manage a server for one-off or analytical SQL queries over different data sources.

Skill for Claude Code ✓ vendor

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions CLAUDE.md.

Part of the clickhouse-best-practices plugin — 11 skills shipped together

Good fit Use it to query Parquet, CSV, or JSON files, connect to databases or cloud storage, join data from multiple sources, and perform analysis in Python.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/clickhouse/agent-skills/chdb-sql
About the project

ClickHouse/agent-skills is a collection of packaged instructions that give AI coding agents specialized guidance for ClickHouse databases and chdb, an in-process version of ClickHouse for Python. It helps agents design schemas, write queries, ingest data, analyze results, and troubleshoot performance with ClickHouse or ClickHouse Cloud. The catalogue entries are the repository’s skills, plugins, and instruction for using these systems.

ClickHouse/agent-skills · 550 stars · on GitHub · clickhouse.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ClickHouse/agent-skills --skill chdb-sql
Clone the repo
git clone --depth 1 https://github.com/ClickHouse/agent-skills

Made for: Claude Code.

Or install clickhouse-best-practices, the plugin that ships this one along with the rest of its 11 skills.

Its marketplace also offers this one on its own, as the plugin chdb-sql — /plugin install chdb-sql after adding the marketplace above.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for chdb-sql

README.md
[![agentmods](https://agentmods.dev/badge/skills/clickhouse/agent-skills/chdb-sql/github.svg)](https://agentmods.dev/skills/clickhouse/agent-skills/chdb-sql)
Your own site
<a href="https://agentmods.dev/skills/clickhouse/agent-skills/chdb-sql"><img src="https://agentmods.dev/badge/skills/clickhouse/agent-skills/chdb-sql/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for chdb-sql

Your own site · 80×15
<a href="https://agentmods.dev/skills/clickhouse/agent-skills/chdb-sql"><img src="https://agentmods.dev/badge/skills/clickhouse/agent-skills/chdb-sql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 214 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,292 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk warn 15 Sept 2026
How audits are shown
Origin 88% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00214 $0.01292
Opus 5.5 $0.00086 $0.00517
Sonnet 5.5 $0.00043 $0.00258
Haiku 4.5 $0.00021 $0.00129

Measured 1mo ago against content hash a123aff5731f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

chdb-sql scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/verify_install.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

88% identical to chdb-sql — 4 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/chdb-sql/SKILL.md · 117 lines

How it starts

The opening of the file, as written. The whole thing — 117 lines — stays where its author put it; the contents beside it link to each section on GitHub.

chdb SQL — ClickHouse in Your Python Process

Run ClickHouse SQL directly in Python — no server needed. Query local files, remote databases, and cloud storage with full ClickHouse SQL power.

pip install chdb

Decision Tree: Pick the Right API

1. One-off query on files or databases → chdb.query()
2. Multi-step analysis with tables      → Session
3. DB-API 2.0 connection                → chdb.connect()
4. Pandas-style DataFrame operations    → Use chdb-datastore skill instead

chdb.query() — One Line, Any Data

import chdb

chdb.query("SELECT * FROM file('data.parquet', Parquet) WHERE price > 100 LIMIT 10")       # local files
chdb.query("SELECT * FROM mysql('db:3306', 'shop', 'orders', 'root', 'pass')")              # databases
chdb.query("SELECT * FROM s3('s3://bucket/data.parquet', NOSIGN) LIMIT 10")                 # cloud storage
chdb.query("SELECT * FROM deltaLake('s3://bucket/delta/table', NOSIGN) LIMIT 10")           # data lakes

# Cross-source join
chdb.query("""
    SELECT u.name, o.amount FROM mysql('db:3306', 'crm', 'users', 'root', 'pass') AS u
    JOIN file('orders.parquet', Parquet) AS o ON u.id = o.user_id ORDER BY o.amount DESC
""")

data = {"name": ["Alice", "Bob"], "score": [95, 87]}
chdb.query("SELECT * FROM Python(data) ORDER BY score DESC")                                # Python data
df = chdb.query("SELECT * FROM numbers(10)", "DataFrame")                                   # output formats
chdb.query("SELECT toDate({d:String}) + number FROM numbers({n:UInt64})",
    "DataFrame", params={"d": "2025-01-01", "n": 30})                                      # parametrized

Table functions → table-functions.md | SQL functions → sql-functions.md | Full API → api-reference.md

Session — Stateful Analysis Pipelines

from chdb import session as chs
sess = chs.Session("./analytics_db")   # persistent; Session() for in-memory

sess.query("CREATE TABLE users ENGINE=MergeTree() ORDER BY id AS SELECT * FROM mysql('db:3306','crm','users','root','pass')")
sess.query("CREATE TABLE events ENGINE=MergeTree() ORDER BY (ts,user_id) AS SELECT * FROM s3('s3://logs/events/*.parquet',NOSIGN)")
sess.query("""
    SELECT u.country, count() AS cnt, uniqExact(e.user_id) AS users
    FROM events e JOIN users u ON e.user_id = u.id
    WHERE e.ts >= today() - 7 GROUP BY u.country ORDER BY cnt DESC
""", "Pretty").show()
sess.close()

Read the full file on GitHub · 117 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 117 lines · 214 tokens per session scan A a123aff5731f

Subscribe to this mod's changes

chdb-sql is a skill published in the GitHub repository ClickHouse/agent-skills (550 stars, last pushed 18d ago), licensed Apache-2.0. It adds 214 tokens to every session and 1,292 once invoked, about $0.0009 per session on Opus 5.5. A static security scan graded it A with 0 findings. It is 88% identical to chdb-sql, differing in 4 lines, and is treated as a copy.

Related

Other skills, from other repositories

use-gfs-mcp

GFS MCP Server for AI agent integration. Provides Model Context Protocol tools for database version control with automatic schema versioning.

Guepard-Corp/gfs · 30 tokens

use-gfs-cli

Git-like version control for databases using the GFS CLI. Manage database states with commits, branches, time travel, and schema versioning.

Guepard-Corp/gfs · 33 tokens

bigquery-graph

Skill for Graph Query Language (GQL) or SQL/PGQ queries against a property graph. Includes path finding, multi-hop traversal, topological connection, shortest path, node reachability, edge connectivity, and semantic graph queries.

google/adk-python · 52 tokens

migration-review

Review database migration files when a change adds or modifies paths under migrations/. Use it before merge to collect forward, rollback, locking, and data-safety evidence.

rohitg00/ai-engineering-from-scratch · 35 tokens

dbx

Use the DBX CLI to inspect DBX-managed database connections, explore schemas, run bounded read-only queries, generate DBML or schema documentation, and open tables in DBX Desktop. Use when the user asks to work with a database configured in DBX from a shell-capable AI agent. Never enable writes unless the user…

t8y2/dbx · 74 tokens

azure-resource-manager-mysql-dotnet

Azure MySQL Flexible Server SDK for .NET. Database management for MySQL Flexible Server deployments. Use for creating servers, databases, firewall rules, configurations, backups, and high availability. Triggers: "MySQL", "MySqlFlexibleServer", "MySQL Flexible Server", "Azure Database for MySQL", "MySQL database…

microsoft/skills · 87 tokens