Agent skill

Clickhouse Cost Tuning

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Optimize ClickHouse Cloud costs — compute scaling, storage tiering, compression, and query efficiency for lower bills.

MITAuto-check passedDatabases

Install Clickhouse Cost Tuning

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill clickhouse-cost-tuning -a claude-code

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

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace clickhouse-cost-tuning --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/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/clickhouse-cost-tuning .claude/skills/clickhouse-cost-tuning && 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
clickhouse-cost-tuning
GitHub stars
2.8k
Token cost
~1.4k tokens
SKILL.md length
554 words
Files
3 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Optimize ClickHouse Cloud costs — compute scaling, storage tiering, compression, and query efficiency for lower bills.

  • Works in 7 steps: Understand what you pay for → Find the top cost driver → Improve compression → …
  • Analyzing ClickHouse Cloud bills
  • SKILL.md covers Overview, Prerequisites, Instructions and Output, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Clickhouse Cost Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Optimize ClickHouse Cloud costs — compute scaling, storage tiering, compression, and query efficiency for lower bills. Use when analyzing ClickHouse Cloud bills, reducing storage costs, or optimizing compute utilization. Trigger with "clickhouse cost", "clickhouse billing", "reduce clickhouse spend", "clickhouse pricing", "clickhouse expensive", "clickhouse storage cost".

Its SKILL.md is about 1.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/examples.md` and `references/implementation.md`). Compatibility notes: Designed for Claude Code

It sits in Databases, covering Data warehousing and Cloud cost optimization. It works with ClickHouse. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Analyzing ClickHouse Cloud bills
  • Reducing storage costs
  • Optimizing compute utilization
  • With clickhouse cost

Example prompts

  • “clickhouse cost”
  • “clickhouse billing”
  • “reduce clickhouse spend”
  • “/clickhouse-cost-tuning”

Requirements

  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Understand what you pay for
  2. Find the top cost driver
  3. Improve compression
  4. Expire and tier old data with TTL
  5. Cut compute cost
  6. Make queries cheaper
  7. Monitor going forward

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are sql).

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

  • Network

    Links to these hosts (documentation or services it may open):

    • clickhouse.com

    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.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Clickhouse Cost Tuning loads about 1.4k tokens when it runs, and up to ~3.7k if it reads all its reference files. Until then it costs about 99 tokens; SKILL.md has 554 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~99
When it runs · the whole SKILL.md, loaded when a task matches
~1.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.7k

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

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 554 words, ~1,432 tokens.

Download SKILL.mdSave it as .claude/skills/clickhouse-cost-tuning/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
clickhouse-cost-tuning
description
Optimize ClickHouse Cloud costs — compute scaling, storage tiering, compression, and query efficiency for lower bills. Use when analyzing ClickHouse Cloud bills, reducing storage costs, or optimizing compute utilization. Trigger with "clickhouse cost", "clickhouse billing", "reduce clickhouse spend", "clickhouse pricing", "clickhouse expensive", "clickhouse storage cost".
allowed-tools
Read
compatibility
Designed for Claude Code
version
1.7.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, database, analytics, clickhouse, olap

ClickHouse Cost Tuning

Overview

Reduce ClickHouse Cloud costs through storage optimization, compression tuning, TTL policies, compute scaling, and query efficiency improvements. This skill walks the bill from top driver to fix: identify what you actually pay for, then apply the codec, TTL, compute, and query changes that move the number.

Deep copy-paste queries for every step live in references/implementation.md; end-to-end scenarios live in references/examples.md.

Prerequisites

  • ClickHouse Cloud account with billing access
  • Understanding of current data volumes and query patterns

Instructions

Step 1: Understand what you pay for

ClickHouse Cloud bills on four axes — and the biggest one is usually compute, not storage, because ClickHouse compresses data 10-20x.

ComponentPricing ModelKey Driver
ComputePer-hour per replicavCPU + memory tier
StoragePer GB-monthCompressed data on disk
NetworkPer GB egressQuery result sizes
BackupsPer GB storedBackup retention
Step 2: Find the top cost driver

Break storage down by table, then by column, to find bloated data. The starter query — full breakdowns in references/implementation.md:

sql
SELECT database, table,
    formatReadableSize(sum(bytes_on_disk)) AS compressed_size,
    round(sum(data_uncompressed_bytes) / sum(bytes_on_disk), 1) AS compression_ratio
FROM system.parts WHERE active
GROUP BY database, table ORDER BY sum(bytes_on_disk) DESC;

A column with a low compression ratio (e.g. 2x on a text/JSON blob) is your lever.

Step 3: Improve compression

Apply codecs matched to the data shape — ZSTD(3) for JSON/text, Delta, ZSTD for sequential IDs, DoubleDelta, ZSTD for timestamps — then OPTIMIZE ... FINAL to re-merge. Full codec cheat sheet and verification queries in references/implementation.md.

Step 4: Expire and tier old data with TTL

Add TTL to delete or move cold data automatically, or drop whole partitions for an immediate one-time reclaim. See the tiered hot/cold/delete TTL pattern in references/implementation.md.

Step 5: Cut compute cost

Enable auto-scaling and idle suspension in the Cloud Console, cap per-query cores and memory (max_threads, max_memory_usage), and batch small writes with async_insert. Exact settings in references/implementation.md.

Step 6: Make queries cheaper

Find the most-scanned queries in system.query_log, replace repeated full scans with materialized views, and use PREWHERE to read fewer columns. Queries in references/implementation.md.

Step 7: Monitor going forward

Track per-query read bytes/rows and duration in your application so cost regressions surface early. TypeScript cost-tracking wrapper in references/implementation.md.

Show full SKILL.md (218 more words)Show less

Output

Applying this skill produces:

  • A ranked storage breakdown (by table and column) identifying the top cost drivers.
  • Concrete ALTER TABLE ... MODIFY COLUMN ... CODEC(...) statements for bloated columns.
  • A TTL / partition-drop plan for cold data.
  • Cloud compute settings (auto-scale bounds, idle timeout, per-query limits).
  • A shortlist of the most expensive queries from system.query_log with materialized-view or PREWHERE fixes.
  • The completed cost-optimization checklist in references/implementation.md.

Error Handling

IssueCauseSolution
Storage growing fastNo TTL, no dropsAdd TTL or schedule partition drops
High compute billFull-scan queriesAdd materialized views, fix ORDER BY
Egress chargesLarge result setsAdd LIMIT, use aggregations
Idle compute costNo auto-suspendEnable idle timeout in Cloud console

Examples

Three worked scenarios take a real symptom through diagnosis → fix → verification — see references/examples.md:

  • Storage bill doubled — trace it to a poorly-compressed JSON column and cut the table ~60% with a ZSTD(3) codec.
  • Compute is the real driver — replace a 30-second full-count() dashboard query with a materialized view and enable idle suspension.
  • Old data you never query — add tiered hot/cold/delete TTL and drop stale partitions for an immediate reclaim.

Resources

Next Steps

For broader design patterns — schema layout, ingestion pipelines, and replica topology that keep costs low by construction — see the clickhouse-reference-architecture skill in this pack.

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/.curated/clickhouse-cost-tuning of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/examples.md
  • references/implementation.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Clickhouse Cost Tuning 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.

Clickhouse Cost Tuning compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Clickhouse Cost Tuning this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.4kAutomated safety check: PassMIT
Keeper Stress AnalysisClickHouse/ClickHouse50k—~4.7kAutomated safety check: PassApache-2.0
Perf ComparisonClickHouse/ClickHouse50k—~3.9kAutomated safety check: NotesApache-2.0
Patch Release CheckClickHouse/ClickHouse50k—~4kAutomated safety check: NotesApache-2.0
Clickhouse Architecture Advisorvemetric/vemetric3952 repos~791Automated safety check: PassApache-2.0
Decompress BinaryClickHouse/ClickHouse50k—~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • Keeper Stress Analysis

    ClickHouse/ClickHouse

    Analyze ClickHouse Keeper stress-test results from play.clickhouse.com / keeperstresstests data warehouse.

    50k GitHub stars~4.7k tokensUpdated today
    DatabasesAuto-check passed
  • Perf Comparison

    ClickHouse/ClickHouse

    Evaluate ClickHouse performance test results from existing CI/dashboard data or local perf.py runs.

    50k GitHub stars~3.9k tokensUpdated today
    DatabasesAuto-check: notes
  • Patch Release Check

    ClickHouse/ClickHouse

    Check whether ClickHouse's supported versions (last 3 majors + latest LTS) have recent stable patch releases, diagnose why the scheduled AutoReleases pipeline failed, and identify which releases…

    50k GitHub stars~4k tokensUpdated today
    DatabasesAuto-check: notes
  • MUST USE when designing ClickHouse architectures, selecting between ingestion or modeling patterns, or translating best practices into workload-specific system designs.

    395 GitHub starsUsed in 2 repos~791 tokens
    DatabasesAuto-check passed
  • Decompress Binary

    ClickHouse/ClickHouse

    Extract the inner ELF from a ClickHouse self-extracting clickhouse binary, including when its architecture differs from the host (e.g.

    50k GitHub stars~1.1k tokensUpdated today
    DatabasesAuto-check passed
  • Good PRs

    ClickHouse/ClickHouse

    Show a report of open ClickHouse PRs whose only non-green CI check is "CH Inc sync" (or that are fully green) — i.e.

    50k GitHub stars~1.8k tokensUpdated today
    DatabasesAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Clickhouse Cost Tuning

What does Clickhouse Cost Tuning do?

Optimize ClickHouse Cloud costs — compute scaling, storage tiering, compression, and query efficiency for lower bills. Clickhouse Cost Tuning is an agent skill from jeremylongshore/tons-of-skills-marketplace. Optimize ClickHouse Cloud costs — compute scaling, storage tiering, compression, and query efficiency for lower bills.

When should I use Clickhouse Cost Tuning?

Clickhouse Cost Tuning fits situations like: analyzing ClickHouse Cloud bills; reducing storage costs; optimizing compute utilization; with clickhouse cost.

How do I install Clickhouse Cost Tuning in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clickhouse-cost-tuning -a claude-code`. Or copy the skill folder (skills/.curated/clickhouse-cost-tuning in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/clickhouse-cost-tuning in your project. Claude Code loads it when a task matches its description.

How do I install Clickhouse Cost Tuning in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill clickhouse-cost-tuning -a codex`. Or copy the skill folder (skills/.curated/clickhouse-cost-tuning in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/clickhouse-cost-tuning in your project. Codex loads it when a task matches its description.

Can I use Clickhouse Cost Tuning 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 jeremylongshore/tons-of-skills-marketplace --skill clickhouse-cost-tuning -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/clickhouse-cost-tuning, .gemini/skills/clickhouse-cost-tuning, .github/skills/clickhouse-cost-tuning and .opencode/skills/clickhouse-cost-tuning in your project.

What does Clickhouse Cost Tuning need to run?

SKILL.md names no scripts, command-line tools or credentials: Clickhouse Cost Tuning is instructions for the agent only. Its frontmatter pre-approves these tools: Read. Compatibility (from SKILL.md): Designed for Claude Code.

Does Clickhouse Cost Tuning access the network?

SKILL.md names 1 domain. As links in the text: clickhouse.com. This is read from the text; nothing was executed.

Is Clickhouse Cost Tuning 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 Clickhouse Cost Tuning use?

Clickhouse Cost Tuning is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Clickhouse Cost Tuning use?

About 1.4k tokens (SKILL.md is roughly 5.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.2k tokens, read only when the agent opens those files.

What are the alternatives to Clickhouse Cost Tuning?

Skills that share tags, products or a category with Clickhouse Cost Tuning: Keeper Stress Analysis (ClickHouse/ClickHouse, 50k stars), Perf Comparison (ClickHouse/ClickHouse, 50k stars), Patch Release Check (ClickHouse/ClickHouse, 50k stars) and Clickhouse Architecture Advisor (vemetric/vemetric, 395 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Clickhouse Cost Tuning?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.