octodamus-core: Skill for Claude Code

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

query-onchain-data is a skill for Claude Code from Octodamus/octodamus-core. It costs 42 tokens per session (2,361 once invoked), scanned A, a copy of query-onchain-data, MIT.

A guide for querying decoded blockchain data on Base, an Ethereum-compatible network, through Coinbase’s CDP SQL API. It covers blocks, transactions, events, transfers, and the required wallet authentication and input checks.

In plain words
What is it for?
Use it to query Base events, transactions, blocks, and transfers with the CDP API and x402 payment commands.
Why use it?
It helps retrieve onchain data with safer SQL commands while avoiding invalid addresses, shell-injection risks, and unnecessarily broad event queries.

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 Octodamus/octodamus-core's own configuration. It tells Claude Code how to work on octodamus-core 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 octodamus-core configures →

Reuse

Borrowing it

Nothing to install: this file belongs to Octodamus/octodamus-core. 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/Octodamus/octodamus-core/main/.agents/skills/query-onchain-data/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/Octodamus/octodamus-core

Made for: Claude Code.

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/octodamus/octodamus-core/query-onchain-data/github.svg)](https://agentmods.dev/skills/octodamus/octodamus-core/query-onchain-data)
Your own site
<a href="https://agentmods.dev/skills/octodamus/octodamus-core/query-onchain-data"><img src="https://agentmods.dev/badge/skills/octodamus/octodamus-core/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/octodamus/octodamus-core/query-onchain-data"><img src="https://agentmods.dev/badge/skills/octodamus/octodamus-core/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,361 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.
Origin 91% copy Near-identical to another mod 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.02361
Opus 5 $0.00021 $0.01180
Sonnet 5 $0.00008 $0.00472
Haiku 4.5 $0.00004 $0.00236

Measured 12d ago against content hash 3218afdf4c20, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 12d 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

This is a copy

91% identical to query-onchain-data — 22 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

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

How it starts

The opening of the file, as written. The whole thing — 210 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 · 210 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. 12d ago First seen · 210 lines · 42 tokens per session scan A 3218afdf4c20

Subscribe to this mod's changes

query-onchain-data is a skill published in the GitHub repository Octodamus/octodamus-core (1 stars, last pushed yesterday), licensed MIT. It adds 42 tokens to every session and 2,361 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to query-onchain-data, differing in 22 lines, and is treated as a copy.