three.ws: Skill for Claude Code

.agents/skills/query-onchain-data/SKILL.md

query-onchain-data is a skill for Claude Code from nirholas/three.ws. It costs 42 tokens per session (2,381 once invoked), scanned A, original, Apache-2.0.

A paid SQL query tool for reading decoded blockchain data on Base, including blocks, transactions, events, and transfers. SQL is a language for asking structured questions of a database.

In plain words
What is it for?
Use it to run SQL queries that examine Base events, transactions, blocks, and token transfers.
Why use it?
It lets you investigate Base blockchain activity with queries instead of manually inspecting individual blocks or transactions.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: positional $N argument; installed under .agents/ (shared by several agents).

This is nirholas/three.ws's own configuration. It tells Claude Code how to work on three.ws itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything three.ws configures →

Part of the three-ws-core plugin — 49 skills shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to nirholas/three.ws. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nirholas/three.ws/main/.agents/skills/query-onchain-data/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/nirholas/three.ws

Made for: Claude Code.

Or install three-ws-core, the plugin that ships this one along with the rest of its 49 skills.

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 query-onchain-data

README.md
[![agentmods](https://agentmods.dev/badge/skills/nirholas/three.ws/query-onchain-data/github.svg)](https://agentmods.dev/skills/nirholas/three.ws/query-onchain-data)
Your own site
<a href="https://agentmods.dev/skills/nirholas/three.ws/query-onchain-data"><img src="https://agentmods.dev/badge/skills/nirholas/three.ws/query-onchain-data/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 query-onchain-data

Your own site · 80×15
<a href="https://agentmods.dev/skills/nirholas/three.ws/query-onchain-data"><img src="https://agentmods.dev/badge/skills/nirholas/three.ws/query-onchain-data.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,381 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
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found 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.00042 $0.02381
Opus 5.5 $0.00017 $0.00952
Sonnet 5.5 $0.00008 $0.00476
Haiku 4.5 $0.00004 $0.00238

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

Security

Grade A, and why

query-onchain-data 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 14d ago.

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

Copies of this mod

1 near-identical copy found in the catalogue:

.agents/skills/query-onchain-data/SKILL.md · 214 lines

How it starts

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

Query Onchain Data on Base

Use the CDP SQL API to query onchain data (events, transactions, blocks, transfers) on Base. Queries are executed via x402 and are charged per query.

Confirm wallet is initialized and authed

npx [email protected] status

If the wallet is not authenticated, refer to the authenticate-wallet skill.

Executing a Query

npx [email protected] x402 pay https://x402.cdp.coinbase.com/platform/v2/data/query/run -X POST -d '{"sql": "<YOUR_QUERY>"}' --json

IMPORTANT: Always single-quote the -d JSON string to prevent bash variable expansion.

Input Validation

Before constructing the command, validate inputs to prevent shell injection:

  • SQL query: Always embed the query inside a single-quoted JSON string (-d '{"sql": "..."}'). Never use double quotes for the outer -d wrapper, as this enables shell expansion of $ and backticks within the query.
  • Addresses: Must be valid 0x hex addresses (^0x[0-9a-fA-F]{40}$). Reject any value containing shell metacharacters.

Do not pass unvalidated user input into the command.

CRITICAL: Indexed Fields

Queries against base.events MUST filter on indexed fields to avoid full table scans. The indexed fields are:

Indexed Field Use For
event_signature Filter by event type. Use this instead of event_name for performance.
address Filter by contract address.
block_timestamp Filter by time range.

Always include at least one indexed field in your WHERE clause. Combining all three gives the best performance.

CoinbaseQL Syntax

CoinbaseQL is a SQL dialect based on ClickHouse. Supported features:

  • Clauses: SELECT (DISTINCT), FROM, WHERE, GROUP BY, ORDER BY (ASC/DESC), LIMIT, WITH (CTEs), UNION (ALL/DISTINCT)
  • Joins: INNER, LEFT, RIGHT, FULL with ON
  • Operators: =, !=, <>, <, >, <=, >=, +, -, *, /, %, AND, OR, NOT, BETWEEN, IN, IS NULL, LIKE
  • Expressions: CASE/WHEN/THEN/ELSE, CAST (both CAST() and :: syntax), subqueries, array/map indexing with [], dot notation
  • Literals: Array [...], Map {...}, Tuple (...)
  • Functions: Standard SQL functions, lambda functions with -> syntax

Read the full file on GitHub · 214 lines

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. 14d ago Changed e2e9a4ee2485
  2. 2mo ago First seen · 214 lines · 42 tokens per session scan A dd71ea2949a9

Subscribe to this mod's changes

query-onchain-data is a skill published in the GitHub repository nirholas/three.ws (269 stars, last pushed yesterday), licensed Apache-2.0. It adds 42 tokens to every session and 2,381 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

query-onchain-data compared with skills from other repositories

query-onchain-data next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
query-onchain-datanirholas/three.wsSkill269yesterdayApache-2.0A42Claude Code
evmNousResearch/hermes-agentSkill261kyesterdayMITA19Claude Code, Codex
building-pydantic-ai-agentspydantic/pydantic-aiSkill21kyesterdayMITA92Claude Code, Codex
mantis-threat-modelgoogle/mantisSkill2.7kyesterdayApache-2.0A59Claude Code, Codex
output-dev-workflow-functiongrowthxai/outputSkill4444d agoApache-2.0A31Claude Code
crypto-dataBlockRunAI/blockrun-mcpSkill389yesterdayMITA194Claude Code, Codex
rpcBlockRunAI/blockrun-mcpSkill389yesterdayMITA91Claude Code, Codex