Agent skill

Querying Tempo

by tempoxyz in tempoxyz/tidx

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

MITAuto-check passedDatabases

Install Querying Tempo

skills CLI
$ npx skills add tempoxyz/tidx --skill querying-tempo -a claude-code

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

GitHub CLI
$ gh skill install tempoxyz/tidx querying-tempo --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/tempoxyz/tidx.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/querying-tempo .claude/skills/querying-tempo && 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
querying-tempo
GitHub stars
107
Token cost
~3.1k tokens
SKILL.md length
840 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
MIT

At a glance

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

  • Querying Tempo chain data
  • SKILL.md covers Query Interfaces, Tables & Schemas, Query Examples and Event CTE Queries, plus 3 more sections
  • Calls curl
  • Working with tidx

What it does

Querying Tempo is an agent skill from tempoxyz/tidx. Query indexed Tempo chain data via tidx HTTP API and CLI. Covers SQL queries for blocks, txs, logs, receipts, event CTE decoding, engine routing (PostgreSQL OLTP vs ClickHouse OLAP), live streaming. Use when querying Tempo chain data or working with tidx.

Its SKILL.md is about 3.1k 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, REST APIs and SQL. It works with PostgreSQL, ClickHouse, SQL and Rust. The repository describes itself as: tidx indexes Tempo chain data into a hybrid PostgreSQL + ClickHouse architecture for fast point lookups (OLTP) and lightning-fast analytics (OLAP). The licence is MIT.

When your agent uses it

  • Querying Tempo chain data
  • Working with tidx

Example prompts

  • “/querying-tempo”

What it can do on your machine

Read from SKILL.md and the folder at commit c075f3a. 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

    Shell commands in SKILL.md call:

    • curl

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

  • Network

    No URLs in SKILL.md. Its commands use curl, which can reach the network depending on how they are called.

    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

Querying Tempo loads about 3.1k tokens when it runs. Until then it costs about 68 tokens; SKILL.md has 840 words of instructions outside code blocks.

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

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 tempoxyz/tidx at commit c075f3a, republished under its MIT licence (© tempoxyz). 840 words, ~3,060 tokens.

Download SKILL.mdSave it as .claude/skills/querying-tempo/SKILL.md (or your agent's skills folder).
name
querying-tempo
description
Query indexed Tempo chain data via tidx HTTP API and CLI. Covers SQL queries for blocks, txs, logs, receipts, event CTE decoding, engine routing (PostgreSQL OLTP vs ClickHouse OLAP), live streaming. Use when querying Tempo chain data or working with tidx.

Querying tidx

tidx exposes indexed Tempo chain data through SQL. Queries run against four core tables: blocks, txs, logs, and receipts. Two query engines are available: PostgreSQL (OLTP) for point lookups and real-time queries, and ClickHouse (OLAP) for heavy analytics.

Query Interfaces

HTTP API
GET /query?sql&chainId&engine&signature&timeout_ms&limit&live
ParamRequiredDefaultDescription
sqlyes—SQL query (SELECT only)
chainIdyes—Chain ID (e.g., 4217 for Presto mainnet)
enginenoautoForce engine: postgres or clickhouse
signatureno—Event signature for CTE decoding (repeatable)
timeout_msno5000Query timeout in ms
limitno10000Max rows (hard cap: 10,000)
livenofalseEnable SSE live streaming (PostgreSQL only)

Response format:

json
{
  "ok": true,
  "columns": ["num", "hash", "gas_used"],
  "rows": [[1, "0xabc...", 21000]],
  "row_count": 1,
  "engine": "postgres",
  "query_time_ms": 12.5
}
CLI
bash
tidx query --url <url> --chain-id <chain_id> [OPTIONS] <sql>
FlagShortRequiredDefaultDescription
--url-uyes—tidx HTTP API URL (e.g., http://localhost:8080)
--chain-id-nyes—Chain ID
--engine-enoautoForce engine: postgres or clickhouse
--format-fnotableOutput: table, json, csv, toon
--limit-lno10000Max rows
--signature-sno—Event signature (repeatable)
--timeout-tno30000Timeout in ms
bash
tidx query --url http://localhost:8080 --chain-id 4217 \
  "SELECT num FROM blocks ORDER BY num DESC LIMIT 5"

# With basic auth (credentials extracted from URL)
tidx query --url http://user:pass@localhost:8080 --chain-id 4217 \
  "SELECT num FROM blocks ORDER BY num DESC LIMIT 5"

Tables & Schemas

blocks
ColumnTypeDescription
numINT8Block number
hashBYTEABlock hash
parent_hashBYTEAParent block hash
timestampTIMESTAMPTZBlock timestamp
timestamp_msINT8Timestamp in milliseconds
gas_limitINT8Gas limit
gas_usedINT8Gas used
minerBYTEABlock producer
extra_dataBYTEAExtra data (nullable)
txs
ColumnTypeDescription
block_numINT8Block number
block_timestampTIMESTAMPTZBlock timestamp
idxINT4Transaction index
hashBYTEATransaction hash
typeINT2Transaction type
fromBYTEASender address
toBYTEARecipient (nullable for contract creation)
valueTEXTValue in wei (text for uint256)
inputBYTEACalldata
gas_limitINT8Gas limit
max_fee_per_gasTEXTMax fee per gas
max_priority_fee_per_gasTEXTMax priority fee
gas_usedINT8Gas used (nullable)
nonce_keyBYTEANonce key
nonceINT8Nonce
fee_tokenBYTEAFee token address (nullable, Tempo-specific)
fee_payerBYTEAFee payer address (nullable, Tempo-specific)
callsJSONBInternal calls (nullable)
call_countINT2Number of calls
logs
ColumnTypeDescription
block_numINT8Block number
block_timestampTIMESTAMPTZBlock timestamp
log_idxINT4Log index
tx_idxINT4Transaction index
tx_hashBYTEATransaction hash
addressBYTEAContract address
selectorBYTEAFirst 4 bytes of topic0 (event selector)
topic0–topic3BYTEAEvent topics (nullable)
dataBYTEAABI-encoded event data
receipts
ColumnTypeDescription
block_numINT8Block number
block_timestampTIMESTAMPTZBlock timestamp
tx_idxINT4Transaction index
tx_hashBYTEATransaction hash
fromBYTEASender
toBYTEARecipient (nullable)
contract_addressBYTEADeployed contract address (nullable)
gas_usedINT8Gas used
cumulative_gas_usedINT8Cumulative gas
effective_gas_priceTEXTEffective gas price (nullable)
statusINT21 = success, 0 = revert (nullable)
fee_payerBYTEAFee payer (nullable, Tempo-specific)

Query Examples

Blocks
bash
# Latest 5 blocks
curl "http://localhost:8080/query?chainId=4217&sql=SELECT num, gas_used FROM blocks ORDER BY num DESC LIMIT 5"

# Block by number
tidx query "SELECT * FROM blocks WHERE num = 1000000"

# Blocks in a time range
tidx query "SELECT num, gas_used FROM blocks WHERE timestamp > now() - interval '1 hour' ORDER BY num DESC LIMIT 100"
Transactions
bash
# Lookup by hash
tidx query "SELECT * FROM txs WHERE hash = '0x1234...'"

# Transactions from an address (uses `from` index)
curl "http://localhost:8080/query?chainId=4217&sql=SELECT hash, value, gas_used FROM txs WHERE \"from\" = '0xdAC17F958D2ee523a2206206994597C13D831ec7' ORDER BY block_num DESC LIMIT 10"

# Contract creations
tidx query "SELECT hash, \"from\" FROM txs WHERE \"to\" IS NULL ORDER BY block_num DESC LIMIT 10"
Receipts
bash
# Failed transactions
tidx query "SELECT tx_hash, \"from\", gas_used FROM receipts WHERE status = 0 ORDER BY block_num DESC LIMIT 10"

# Contract deployments
tidx query "SELECT tx_hash, contract_address FROM receipts WHERE contract_address IS NOT NULL ORDER BY block_num DESC LIMIT 10"

# Transactions paid by a fee payer (Tempo-specific)
tidx query "SELECT tx_hash, \"from\", fee_payer FROM receipts WHERE fee_payer IS NOT NULL ORDER BY block_num DESC LIMIT 10"
Raw Logs
bash
# Logs by contract address
tidx query "SELECT block_num, tx_hash, data FROM logs WHERE address = '0xABC...' ORDER BY block_num DESC LIMIT 10"

# Logs by event selector
tidx query "SELECT * FROM logs WHERE selector = '0xddf252ad' ORDER BY block_num DESC LIMIT 10"

Event CTE Queries

Event CTEs let you decode raw log data into typed columns using an ABI event signature. Pass the signature via --signature / &signature= and query the event name as a virtual table.

Signature format: EventName(type [indexed] name, ...)

Basic Transfer query
bash
# CLI
tidx query \
  -s "Transfer(address indexed from, address indexed to, uint256 value)" \
  'SELECT "from", "to", "value" FROM Transfer ORDER BY block_num DESC LIMIT 10'

# HTTP
curl "http://localhost:8080/query?chainId=4217&signature=Transfer(address%20indexed%20from,%20address%20indexed%20to,%20uint256%20value)&sql=SELECT%20%22from%22,%20%22to%22,%20%22value%22%20FROM%20Transfer%20ORDER%20BY%20block_num%20DESC%20LIMIT%2010"
Filter by address (predicate pushdown)

Filters on indexed params are automatically pushed down to topic-level WHERE clauses for index utilization:

bash
tidx query \
  -s "Transfer(address indexed from, address indexed to, uint256 value)" \
  'SELECT "to", "value" FROM Transfer WHERE "from" = '\''0xdAC17F958D2ee523a2206206994597C13D831ec7'\'' ORDER BY block_num DESC LIMIT 10'

The "from" = '0x...' filter is rewritten to topic1 = '\x000...dac17f...' at the raw logs level.

Filter by contract address
bash
tidx query \
  -s "Transfer(address indexed from, address indexed to, uint256 value)" \
  'SELECT "from", "to", "value" FROM Transfer WHERE address = '\''0xABC...'\'' ORDER BY block_num DESC LIMIT 10'

address and block_num are raw columns that are always pushed down into the CTE.

Show full SKILL.md (328 more words)Show less
Multiple signatures
bash
tidx query \
  -s "Transfer(address indexed from, address indexed to, uint256 value)" \
  -s "Approval(address indexed owner, address indexed spender, uint256 value)" \
  'SELECT * FROM Transfer LIMIT 5'
Available decoded columns

Each CTE always includes these raw columns: block_num, block_timestamp, log_idx, tx_idx, tx_hash, address, selector, topic1, topic2, topic3, data.

Plus decoded columns from the signature params (e.g., "from", "to", "value" for Transfer).

Supported ABI types

address, uint8–uint256, int8–int256, bool, bytes, bytes1–bytes32, string

PostgreSQL helper functions

Available for manual decoding in raw queries (not needed with CTEs):

  • abi_uint(bytea) → NUMERIC — Decode unsigned integer
  • abi_int(bytea) → NUMERIC — Decode signed integer
  • abi_address(bytea) → BYTEA — Extract 20-byte address from 32-byte slot
  • abi_bool(bytea) → BOOLEAN — Decode boolean
  • abi_bytes(bytea, offset) → BYTEA — Decode dynamic bytes
  • abi_string(bytea, offset) → TEXT — Decode dynamic string
  • format_address(bytea) → TEXT — Format as 0x... hex string

Hex Literals

In PostgreSQL queries, '0x...' hex literals (40+ chars) are automatically converted to '\x...' bytea format. You can write:

sql
WHERE "from" = '0xdAC17F958D2ee523a2206206994597C13D831ec7'

No need to manually use '\x...' syntax.

Engine Routing: PostgreSQL vs ClickHouse

PostgreSQL (OLTP) — default

Best for:

  • Point lookups — tx by hash, block by number, address history
  • Real-time queries — latest blocks, recent activity, live streaming
  • Low-latency — sub-second responses for indexed lookups
  • Small result sets — WHERE on indexed columns with LIMIT
bash
# Point lookup (fast, uses hash index)
curl "http://localhost:8080/query?chainId=4217&sql=SELECT * FROM txs WHERE hash = '0x1234...'&engine=postgres"

# Recent activity (fast, uses block_num DESC index)
curl "http://localhost:8080/query?chainId=4217&sql=SELECT * FROM blocks ORDER BY num DESC LIMIT 10&engine=postgres"
ClickHouse (OLAP) — engine=clickhouse

Best for:

  • Aggregations — COUNT, SUM, AVG over millions of rows
  • Full table scans — analytics without narrow WHERE clauses
  • Time-series — GROUP BY hour/day/week over large ranges
  • Heavy JOINs — cross-table analytics
bash
# Daily gas usage (heavy aggregation → ClickHouse)
curl "http://localhost:8080/query?chainId=4217&engine=clickhouse&sql=SELECT toDate(block_timestamp) as day, SUM(gas_used) as total_gas, COUNT(*) as tx_count FROM txs GROUP BY day ORDER BY day DESC LIMIT 30"

# Transfer volume by token (full scan with decode → ClickHouse)
curl "http://localhost:8080/query?chainId=4217&engine=clickhouse&signature=Transfer(address%20indexed%20from,%20address%20indexed%20to,%20uint256%20value)&sql=SELECT address as token, COUNT(*) as transfers, SUM(\"value\") as volume FROM Transfer GROUP BY token ORDER BY transfers DESC LIMIT 20"
When to use which
Use caseEngineWhy
Tx by hashPostgreSQLB-tree index, O(1)
Address tx historyPostgreSQLIndexed, small result
Latest N blocksPostgreSQLIndex scan on num DESC
Live streaming (SSE)PostgreSQLOnly engine that supports live=true
Daily/hourly aggregationsClickHouseColumnar scan, fast GROUP BY
Token holder snapshotsClickHouseFull scan + SUM
Top contracts by gasClickHouseFull scan + aggregation
Time-series chartsClickHouseColumnar, time functions

Rule of thumb: If your query has a tight WHERE on an indexed column → PostgreSQL. If it scans many rows with GROUP BY → ClickHouse.

Live Streaming (SSE)

Add live=true to get real-time updates via Server-Sent Events. PostgreSQL only.

bash
curl -N "http://localhost:8080/query?chainId=4217&live=true&sql=SELECT num, gas_used FROM blocks ORDER BY num DESC LIMIT 1"

Events:

  • result — Query results for each new block
  • lagged — Client fell behind, some blocks skipped
  • error — Query error

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

Files

Just SKILL.md in .agents/skills/querying-tempo of tempoxyz/tidx.

Open the folder on GitHubat commit c075f3a

Compare with similar skills

Querying Tempo 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.

Querying Tempo compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Querying Tempo this skilltempoxyz/tidx107—~3.1kAutomated safety check: PassMIT
Chdb SQLvemetric/vemetric3941 repos~1.2kAutomated safety check: PassApache-2.0
Semantic Analystsidequery/sidemantic129—~982Automated safety check: PassAGPL-3.0
Database MigrationRain-kl/OpenFlare288—~1.3kAutomated safety check: PassApache-2.0
Optimizing Clickhouse And Hogql QueriesPostHog/posthog40k—~5.7kAutomated safety check: PassCustom licence
Gram Demo Seedspeakeasy-api/gram272—~2.5kAutomated safety check: PassAGPL-3.0

Similar skills

  • 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
  • Semantic Analyst

    sidequery/sidemantic

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

    129 GitHub stars~982 tokensUpdated yesterday
    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
  • Workflow for optimizing ClickHouse and HogQL queries. An agent skill from PostHog/posthog.

    40k GitHub stars~5.7k tokensUpdated today
    DatabasesAuto-check passed
  • Gram Demo Seed

    speakeasy-api/gram

    A skill your agent uses when adding a new feature or changing an existing one that surfaces data in the dashboard — the demo org (app.getgram.ai/explore-demo) must show it — and when editing or…

    272 GitHub stars~2.5k tokensUpdated today
    DatabasesAuto-check passed
  • Official

    Debug a customer's data warehouse source, schema, or table from a support ticket, using PostHog's own production data.

    40k GitHub stars~6.3k tokensUpdated today
    DatabasesAuto-check: warnings

Categories

Questions about Querying Tempo

What does Querying Tempo do?

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

When should I use Querying Tempo?

Querying Tempo fits situations like: querying Tempo chain data; working with tidx.

How do I install Querying Tempo in Claude Code?

Run `npx skills add tempoxyz/tidx --skill querying-tempo -a claude-code`. Or copy the skill folder (.agents/skills/querying-tempo in tempoxyz/tidx) into .claude/skills/querying-tempo in your project. Claude Code loads it when a task matches its description.

How do I install Querying Tempo in Codex?

Run `npx skills add tempoxyz/tidx --skill querying-tempo -a codex`. Or copy the skill folder (.agents/skills/querying-tempo in tempoxyz/tidx) into .agents/skills/querying-tempo in your project. Codex loads it when a task matches its description.

Can I use Querying Tempo 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 tempoxyz/tidx --skill querying-tempo -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/querying-tempo, .gemini/skills/querying-tempo, .github/skills/querying-tempo and .opencode/skills/querying-tempo in your project.

What does Querying Tempo need to run?

Going by SKILL.md and its folder, Querying Tempo needs the command-line tools its instructions call (curl).

Does Querying Tempo access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Querying Tempo 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 Querying Tempo use?

Querying Tempo is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Querying Tempo use?

About 3.1k tokens (SKILL.md is roughly 12k 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 Querying Tempo?

Skills that share tags, products or a category with Querying Tempo: Chdb SQL (vemetric/vemetric, 394 stars), Semantic Analyst (sidequery/sidemantic, 129 stars), Database Migration (Rain-kl/OpenFlare, 288 stars) and Optimizing Clickhouse And Hogql Queries (PostHog/posthog, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Querying Tempo?

tempoxyz (a GitHub organization) maintains it in tempoxyz/tidx, which has 107 GitHub stars. The repository was last updated on October 8, 2026.

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