Clickhouse Logs Queries
supabase/supabase
Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint).
Profile a ClickHouse query using the sampling query profiler and system.tracelog.
$ npx skills add ClickHouse/ClickHouse --skill cpu-profile -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ClickHouse/ClickHouse cpu-profile --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ClickHouse/ClickHouse.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/cpu-profile .claude/skills/cpu-profile && rm -rf skills-srcUse ~/.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/
Install the "cpu-profile" agent skill from https://github.com/ClickHouse/ClickHouse/tree/master/.claude/skills/cpu-profile into .claude/skills/cpu-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpu-profile", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ClickHouse/ClickHouse/tree/master/.claude/skills/cpu-profileType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ClickHouse/ClickHouse --skill cpu-profile -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ClickHouse/ClickHouse cpu-profile --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ClickHouse/ClickHouse.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.claude/skills/cpu-profile .agents/skills/cpu-profile && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "cpu-profile" agent skill from https://github.com/ClickHouse/ClickHouse/tree/master/.claude/skills/cpu-profile into .agents/skills/cpu-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpu-profile", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ClickHouse/ClickHouse --skill cpu-profile -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ClickHouse/ClickHouse cpu-profile --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ClickHouse/ClickHouse.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.claude/skills/cpu-profile .cursor/skills/cpu-profile && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "cpu-profile" agent skill from https://github.com/ClickHouse/ClickHouse/tree/master/.claude/skills/cpu-profile into .cursor/skills/cpu-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpu-profile", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ClickHouse/ClickHouse.git --path .claude/skills/cpu-profile--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ClickHouse/ClickHouse --skill cpu-profile -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ClickHouse/ClickHouse cpu-profile --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ClickHouse/ClickHouse.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.claude/skills/cpu-profile .gemini/skills/cpu-profile && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "cpu-profile" agent skill from https://github.com/ClickHouse/ClickHouse/tree/master/.claude/skills/cpu-profile into .gemini/skills/cpu-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpu-profile", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ClickHouse/ClickHouse cpu-profileInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ClickHouse/ClickHouse --skill cpu-profile -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ClickHouse/ClickHouse.git skills-src && mkdir -p .github/skills && cp -r skills-src/.claude/skills/cpu-profile .github/skills/cpu-profile && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "cpu-profile" agent skill from https://github.com/ClickHouse/ClickHouse/tree/master/.claude/skills/cpu-profile into .github/skills/cpu-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpu-profile", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ClickHouse/ClickHouse --skill cpu-profile -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ClickHouse/ClickHouse cpu-profile --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ClickHouse/ClickHouse.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.claude/skills/cpu-profile .opencode/skills/cpu-profile && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "cpu-profile" agent skill from https://github.com/ClickHouse/ClickHouse/tree/master/.claude/skills/cpu-profile into .opencode/skills/cpu-profile/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "cpu-profile", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
cpu-profileProfile a ClickHouse query using the sampling query profiler and system.tracelog.
Cpu Profile is an agent skill from ClickHouse/ClickHouse. Profile a ClickHouse query using the sampling query profiler and system.tracelog. Use when the user wants to find CPU hotspots, analyze where time is spent in a query, or investigate performance bottlenecks.
Its SKILL.md is about 1.9k 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 Data warehousing and Performance optimization. It works with ClickHouse and SQL. The repository describes itself as: ClickHouse® is a real-time analytics database management system. The licence is Apache-2.0.
5 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit cd023af. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
TaskBashReadGrepGlobAskUserQuestionFrom allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are sql and bash).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
speedscope.appFrom URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Cpu Profile loads about 1.9k tokens when it runs. Until then it costs about 55 tokens; SKILL.md has 557 words of instructions outside code blocks.
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.
The automated check noted patterns worth knowing about, such as sudo or a known installer.
allowed-tools: Task, Bash, Read, Grep, Glob, AskUserQuestionAutomated 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.
The full file from ClickHouse/ClickHouse at commit cd023af, republished under its Apache-2.0 licence (© ClickHouse). 557 words, ~1,873 tokens.
.claude/skills/cpu-profile/SKILL.md (or your agent's skills folder).Profile a ClickHouse query using the built-in sampling query profiler (system.trace_log).
Collects CPU stack traces at configurable intervals and analyzes them to find hotspots.
$ARGUMENTS (optional): Either a query_id to analyze existing traces, or a SQL query to execute with profiling enabled.If $ARGUMENTS looks like a UUID (e.g., a1b2c3d4-e5f6-...), treat it as a query_id and skip to Step 3.
If $ARGUMENTS is a SQL query or query description, proceed to Step 2.
If $ARGUMENTS is empty, ask the user:
If the user wants to see recent slow queries:
SELECT
query_id,
query_duration_ms,
formatReadableSize(memory_usage) AS peak_memory,
left(query, 120) AS query_preview
FROM system.query_log
WHERE type = 'QueryFinish'
AND event_date >= today() - 1
AND query_duration_ms > 1000
AND query NOT LIKE '%system.%'
ORDER BY query_duration_ms DESC
LIMIT 20
SETTINGS allow_introspection_functions = 1Generate a unique query ID and run the query with aggressive profiling settings (100us sampling = ~10,000 samples/sec).
Use clickhouse-client in non-interactive mode with an explicit --query_id to avoid any race with concurrent queries:
PROFILE_QID="cpu-profile-$(uuidgen)"
clickhouse-client --query_id "$PROFILE_QID" -q "
SELECT ...
SETTINGS query_profiler_cpu_time_period_ns = 100000,
query_profiler_real_time_period_ns = 100000
"Alternatively, if running interactively, parse the Query id: <uuid> line that clickhouse-client prints before each query.
After execution, verify the query completed and collect metadata:
SELECT query_id, query_duration_ms, formatReadableSize(memory_usage) AS peak_memory
FROM system.query_log
WHERE type = 'QueryFinish' AND query_id = '{query_id}'
SETTINGS allow_introspection_functions = 1Wait 2 seconds for trace_log to flush, then proceed to Step 3.
Run these analyses in parallel using Task tool (3 tasks):
SELECT
count() AS samples,
round(100.0 * count() / (SELECT count() FROM system.trace_log WHERE query_id = '{query_id}' AND trace_type = 'CPU'), 2) AS pct,
demangle(addressToSymbol(trace[1])) AS function
FROM system.trace_log
WHERE query_id = '{query_id}'
AND trace_type = 'CPU'
GROUP BY function
ORDER BY samples DESC
LIMIT 30
SETTINGS allow_introspection_functions = 1SELECT
count() AS samples,
arrayStringConcat(
arrayMap(x -> demangle(addressToSymbol(x)), trace),
'\n '
) AS stack
FROM system.trace_log
WHERE query_id = '{query_id}'
AND trace_type = 'CPU'
GROUP BY trace
ORDER BY samples DESC
LIMIT 15
SETTINGS allow_introspection_functions = 1SELECT
concat(
arrayStringConcat(
arrayReverse(arrayMap(x -> demangle(addressToSymbol(x)), trace)),
';'
),
' ',
toString(count())
)
FROM system.trace_log
WHERE query_id = '{query_id}'
AND trace_type = 'CPU'
GROUP BY trace
ORDER BY count() DESC
SETTINGS allow_introspection_functions = 1
FORMAT TSVRawSave this output to tmp/cpu_profile_{query_id}.collapsed for optional flamegraph generation.
Also collect metadata:
SELECT
count() AS total_samples,
min(event_time_microseconds) AS first_sample,
max(event_time_microseconds) AS last_sample,
dateDiff('millisecond', min(event_time_microseconds), max(event_time_microseconds)) AS profile_duration_ms
FROM system.trace_log
WHERE query_id = '{query_id}' AND trace_type = 'CPU'
SETTINGS allow_introspection_functions = 1Using outputs from all three agents, produce a structured report:
Ask the user:
trace_type = 'Real' to find wall-clock hotspots (IO waits, lock contention)flamegraph.pl is available, render SVG:flamegraph.pl --title "CPU Profile: {query_id}" --countname samples --width 1800 \
tmp/cpu_profile_{query_id}.collapsed > tmp/cpu_flamegraph_{query_id}.svgaddressToLine for source file:line mapping:SELECT
count() AS samples,
demangle(addressToSymbol(trace[1])) AS function,
addressToLine(trace[1]) AS source_location
FROM system.trace_log
WHERE query_id = '{query_id}' AND trace_type = 'CPU'
GROUP BY function, source_location
ORDER BY samples DESC
LIMIT 30
SETTINGS allow_introspection_functions = 1Repeat drill-down until user selects "Done".
query_profiler_cpu_time_period_ns setting controls sampling frequency. Default is 1,000,000,000 (1 sample/sec). Use 100,000 (100us) for detailed profiling of short queries, 1,000,000 (1ms) for longer queries.trace_type = 'CPU' counts CPU time; trace_type = 'Real' counts wall-clock time (includes IO waits).allow_introspection_functions = 1 is required for addressToSymbol, demangle, addressToLine.clickhouse-common-static-dbg package must be installed for symbol resolution.FROM clusterAllReplicas(default, system.trace_log) to collect traces from all nodes.system.trace_log are stored as arrays of addresses, with index 1 being the innermost (leaf) frame./cpu-profile — Interactive: choose a query to profile/cpu-profile a1b2c3d4-e5f6-7890-abcd-ef1234567890 — Analyze existing traces for a query_id/cpu-profile SELECT count() FROM lineitem WHERE l_shipdate > '1995-01-01' — Execute and profile a query© ClickHouse, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .claude/skills/cpu-profile of ClickHouse/ClickHouse.
Open the folder on GitHubat commit cd023af
Cpu Profile 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.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Cpu Profile this skillClickHouse/ClickHouse | 50k | — | ~1.9k | Automated safety check: Notes | Apache-2.0 | |
| Clickhouse Logs Queriessupabase/supabase | 111k | — | ~2.4k | Automated safety check: Pass | Apache-2.0 | |
| Chdb SQLvemetric/vemetric | 394 | 1 repos | ~1.2k | Automated safety check: Pass | Apache-2.0 | |
| Clickhouse System QueriesFrankChen021/datastoria | 327 | — | ~731 | Automated safety check: Pass | Custom licence | |
| Webapp Buildersidequery/sidemantic | 129 | — | ~5.5k | Automated safety check: Pass | AGPL-3.0 | |
| Modelersidequery/sidemantic | 129 | — | ~4.2k | Automated safety check: Pass | Apache-2.0 |
supabase/supabase
Write, review, and migrate Supabase logs queries against the ClickHouse-backed logs table (the logs.all.otel analytics endpoint).
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…
FrankChen021/datastoria
Query ClickHouse system tables to inspect query logs, monitor cluster health, check replication status, and analyze slow queries.
sidequery/sidemantic
Build interactive analytics webapps, demos, dashboards, or embedded app surfaces from Sidemantic semantic models using copyable component primitives and deterministic query inspection.
sidequery/sidemantic
Build, validate, and manage semantic models using Sidemantic.
tempoxyz/tidx
Query indexed Tempo chain data via tidx HTTP API and CLI. An agent skill from tempoxyz/tidx.
ClickHouse/ClickHouse
Analyze ClickHouse Keeper stress-test results from play.clickhouse.com / keeperstresstests data warehouse.
ClickHouse/ClickHouse
Evaluate ClickHouse performance test results from existing CI/dashboard data or local perf.py runs.
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…
ClickHouse/ClickHouse
Analyze a jemalloc (or other) allocation profile in collapsed stack format.
ClickHouse/ClickHouse
Bisect a ClickHouse regression using pre-built master binaries from CI.
ClickHouse/ClickHouse
Generate PR descriptions for ClickHouse/ClickHouse that match maintainer expectations.
Works with
Categories
Profile a ClickHouse query using the sampling query profiler and system.tracelog. Cpu Profile is an agent skill from ClickHouse/ClickHouse.tracelog.
Cpu Profile fits situations like: the user wants to find CPU hotspots; analyze where time is spent in a query; investigate performance bottlenecks.
Run `npx skills add ClickHouse/ClickHouse --skill cpu-profile -a claude-code`. Or copy the skill folder (.claude/skills/cpu-profile in ClickHouse/ClickHouse) into .claude/skills/cpu-profile in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ClickHouse/ClickHouse --skill cpu-profile -a codex`. Or copy the skill folder (.claude/skills/cpu-profile in ClickHouse/ClickHouse) into .agents/skills/cpu-profile in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ClickHouse/ClickHouse --skill cpu-profile -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cpu-profile, .gemini/skills/cpu-profile, .github/skills/cpu-profile and .opencode/skills/cpu-profile in your project.
SKILL.md names no scripts, command-line tools or credentials: Cpu Profile is instructions for the agent only. Its frontmatter pre-approves these tools: Task, Bash, Read, Grep, Glob, AskUserQuestion.
SKILL.md names 1 domain. As links in the text: speedscope.app. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Cpu Profile is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.9k tokens (SKILL.md is roughly 7.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Cpu Profile: Clickhouse Logs Queries (supabase/supabase, 111k stars), Chdb SQL (vemetric/vemetric, 394 stars), Clickhouse System Queries (FrankChen021/datastoria, 327 stars) and Webapp Builder (sidequery/sidemantic, 129 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ClickHouse (a GitHub organization) maintains it in ClickHouse/ClickHouse, which has 50,288 GitHub stars. The repository holds 24 skills in this directory. The repository was last updated on October 8, 2026.
Source: ClickHouse/ClickHouse on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.