Agent skill

Optimize Clickhouse SQL

by FrankChen021 in FrankChen021/datastoria

Optimize slow queries, analyze SQL performance, and collect evidence for expensive workloads.

Custom licenceAuto-check passedDatabases

Install Optimize Clickhouse SQL

skills CLI
$ npx skills add FrankChen021/datastoria --skill optimize-clickhouse-sql -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install FrankChen021/datastoria optimize-clickhouse-sql --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/FrankChen021/datastoria.git skills-src && mkdir -p .claude/skills && cp -r skills-src/resources/skills/optimize-clickhouse-sql .claude/skills/optimize-clickhouse-sql && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
optimize-clickhouse-sql
GitHub stars
327
Token cost
~1.2k tokens
SKILL.md length
577 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
Custom licence

At a glance

Optimize slow queries, analyze SQL performance, and collect evidence for expensive workloads.

  • Works in 4 steps: HAS SQL: Conversation contains a SQL… → HAS QUERY_ID: Conversation contains… → DISCOVERY REQUEST: User asks to optimize… → …
  • Tasks that involve SQL
  • SKILL.md covers Pre-flight Check, Discovery, Time Filtering and Mode Selection, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Optimize Clickhouse SQL is an agent skill from FrankChen021/datastoria. Optimize slow queries, analyze SQL performance, and collect evidence for expensive workloads.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases, covering SQL, Data warehousing and Query optimization. It works with SQL and ClickHouse. The repository describes itself as: AI-native ClickHouse console for your cluster diagnostics and query generation, optimization and data visualization.

When your agent uses it

  • Tasks that involve SQL
  • Tasks that involve Data warehousing
  • Tasks that involve Query optimization

Example prompts

  • “/optimize-clickhouse-sql”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. HAS SQL: Conversation contains a SQL query -> Go to WORKFLOW step 2 (Collect Evidence).
  2. HAS QUERY_ID: Conversation contains query_id -> Go to WORKFLOW step 2 (Call collect_sql_optimization_evidence immediately).
  3. DISCOVERY REQUEST: User asks to optimize the slowest/heaviest queries but does not provide SQL/query_id -> Go to WORKFLOW step 1…
  4. NEITHER: Call ask_user_question with exactly one question

What it can do on your machine

Read from SKILL.md and the folder at commit d0859a2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Optimize Clickhouse SQL loads about 1.2k tokens when it runs. Until then it costs about 29 tokens; SKILL.md has 577 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~29
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 577 words (~1,202 tokens).

“Workflow is evidence-driven: collect evidence with tools, then recommend based on evidence only.”

— opening of SKILL.md by FrankChen021, Custom licence
name
optimize-clickhouse-sql
metadata.author
System
metadata.show-in-sql-editor-quick-action
true

Read the full SKILL.md on GitHub

Files

Just SKILL.md in resources/skills/optimize-clickhouse-sql of FrankChen021/datastoria.

Open the folder on GitHubat commit d0859a2

Compare with similar skills

Optimize Clickhouse SQL next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Optimize Clickhouse SQL compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Optimize Clickhouse SQL this skillFrankChen021/datastoria327—~1.2kAutomated safety check: PassCustom licence
Pytorch Clickhousepytorch/test-infra113—~2.8kAutomated safety check: PassCustom licence
Chdb SQLvemetric/vemetric3941 repos~1.2kAutomated safety check: PassApache-2.0
Modelersidequery/sidemantic129—~4.2kAutomated safety check: PassApache-2.0
Querying Tempotempoxyz/tidx107—~3.1kAutomated safety check: PassMIT
Semantic Analystsidequery/sidemantic129—~982Automated safety check: PassAGPL-3.0

Similar skills

  • Pytorch Clickhouse

    pytorch/test-infra

    Load this FIRST whenever working with PyTorch CI data (any pytorch/ org repo), the torchci/HUD codebase, or the PyTorch HUD ClickHouse database.

    113 GitHub stars~2.8k tokensUpdated today
    DatabasesAuto-check passed
  • Chdb SQL

    vemetric/vemetric

    A skill your agent uses when the user wants to run SQL — especially analytical SQL — on local files (parquet/csv/json), URLs, S3 paths, or remote databases (Postgres, MySQL, MongoDB, ClickHouse…

    394 GitHub starsUsed in 1 repo~1.2k tokens
    DatabasesAuto-check passed
  • Modeler

    sidequery/sidemantic

    Build, validate, and manage semantic models using Sidemantic.

    129 GitHub stars~4.2k tokensUpdated today
    DatabasesAuto-check passed
  • Querying Tempo

    tempoxyz/tidx

    Query indexed Tempo chain data via tidx HTTP API and CLI. An agent skill from tempoxyz/tidx.

    107 GitHub stars~3.1k tokensUpdated yesterday
    DatabasesAuto-check passed
  • Semantic Analyst

    sidequery/sidemantic

    Answer analytical, KPI, metric, trend, cohort, and business-performance questions through a Sidemantic semantic layer.

    129 GitHub stars~982 tokensUpdated today
    DatabasesAuto-check passed
  • Database Migration

    Rain-kl/OpenFlare

    Wavelet 项目专用:当新增或修改数据库表结构、索引、初始化数据、系统配置 seed、模板 seed、默认管理员、goose SQL 迁移、internal/infra/persistence/migrator、ClickHouse 分析库 DDL 或数据库升级流程时必须使用。本技能指导在 internal/infra/persistence/migrator/goose 下编写…

    288 GitHub stars~1.3k tokensUpdated today
    DatabasesAuto-check passed

More from FrankChen021/datastoria

  • Clickhouse System Queries

    FrankChen021/datastoria

    Query ClickHouse system tables to inspect query logs, monitor cluster health, check replication status, and analyze slow queries.

    327 GitHub stars~731 tokensUpdated 2 mo ago
    Auto-check passed
  • Visualization

    FrankChen021/datastoria

    Rules for charts and visualization. An agent skill from FrankChen021/datastoria.

    327 GitHub stars~1.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Diagnose Clickhouse Errors

    FrankChen021/datastoria

    Diagnose ClickHouse runtime query failures when the user wants database-level cause and fix guidance from an error or numeric error code, not source-code root cause analysis.

    327 GitHub stars~610 tokensUpdated 2 mo ago
    Auto-check passed
  • SQL Expert

    FrankChen021/datastoria

    Expert system for generating, validating, and optimizing ClickHouse SQL.

    327 GitHub stars~919 tokensUpdated 2 mo ago
    Auto-check passed
  • Diagnose Clickhouse Clusters

    FrankChen021/datastoria

    Diagnose ClickHouse cluster health and provide concrete remediation.

    327 GitHub stars~1.6k tokensUpdated 2 mo ago
    Auto-check passed
  • Source Code Inspection

    FrankChen021/datastoria

    Investigate application or repository source code with searchfile and readfile to explain behavior, trace root causes of runtime or query errors, and answer with precise file citations.

    327 GitHub stars~453 tokensUpdated 2 mo ago
    Auto-check passed

Works with

Categories

Questions about Optimize Clickhouse SQL

What does Optimize Clickhouse SQL do?

Optimize slow queries, analyze SQL performance, and collect evidence for expensive workloads. Optimize Clickhouse SQL is an agent skill from FrankChen021/datastoria. Optimize slow queries, analyze SQL performance, and collect evidence for expensive workloads.

When should I use Optimize Clickhouse SQL?

Optimize Clickhouse SQL fits situations like: tasks that involve SQL; tasks that involve Data warehousing; tasks that involve Query optimization.

How do I install Optimize Clickhouse SQL in Claude Code?

Run `npx skills add FrankChen021/datastoria --skill optimize-clickhouse-sql -a claude-code`. Or copy the skill folder (resources/skills/optimize-clickhouse-sql in FrankChen021/datastoria) into .claude/skills/optimize-clickhouse-sql in your project. Claude Code loads it when a task matches its description.

How do I install Optimize Clickhouse SQL in Codex?

Run `npx skills add FrankChen021/datastoria --skill optimize-clickhouse-sql -a codex`. Or copy the skill folder (resources/skills/optimize-clickhouse-sql in FrankChen021/datastoria) into .agents/skills/optimize-clickhouse-sql in your project. Codex loads it when a task matches its description.

Can I use Optimize Clickhouse SQL in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add FrankChen021/datastoria --skill optimize-clickhouse-sql -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/optimize-clickhouse-sql, .gemini/skills/optimize-clickhouse-sql, .github/skills/optimize-clickhouse-sql and .opencode/skills/optimize-clickhouse-sql in your project.

What does Optimize Clickhouse SQL need to run?

SKILL.md names no scripts, command-line tools or credentials: Optimize Clickhouse SQL is instructions for the agent only.

Does Optimize Clickhouse SQL access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Optimize Clickhouse SQL safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Optimize Clickhouse SQL use?

Optimize Clickhouse SQL has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does Optimize Clickhouse SQL use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Optimize Clickhouse SQL?

Skills that share tags, products or a category with Optimize Clickhouse SQL: Pytorch Clickhouse (pytorch/test-infra, 113 stars), Chdb SQL (vemetric/vemetric, 394 stars), Modeler (sidequery/sidemantic, 129 stars) and Querying Tempo (tempoxyz/tidx, 107 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Optimize Clickhouse SQL?

FrankChen021 (a GitHub user) maintains it in FrankChen021/datastoria, which has 327 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on July 21, 2026.

Source: FrankChen021/datastoria on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.