DuckDB Skills for Claude Code

Open original

DuckDB released a plugin that lets Claude Code query data files directly using SQL instead of writing Python scripts, making it faster and more accurate. The plugin handles everything from local CSVs to remote cloud storage and spatial data, with Claude automatically picking the right tool based on what you ask.

  • Claude can now run SQL queries against any file format (CSV, Parquet, JSON, Excel, etc.) on disk or in cloud storage, getting exact answers instead of guessing column names
  • The plugin includes specialized skills for S3/GCS exploration, spatial queries (distances, nearest neighbors), searching DuckDB docs, and recalling decisions from past sessions
  • When a query fails, Claude reads the error message and retries with corrected SQL automatically, creating a two-layer conversation (natural language with you, SQL with DuckDB)

The duckdb-skills plugin lets Claude Code use DuckDB's CLI instead of Python for data work, which is faster and more reliable. When you ask Claude a question about a data file, it now runs SQL queries directly against the file rather than writing and executing Python scripts. This matters because DuckDB can read almost any format—CSV, Parquet, JSON, Excel, spatial data, even remote files on S3 or behind authentication—and Claude gets exact answers with real column names instead of guessing. The plugin handles the translation: you talk to Claude in natural language, Claude talks to DuckDB in SQL, and when a query fails (like looking for "distance" when the column is "trip_distance"), Claude reads the error and fixes it automatically. You install duckdb-skills through Claude Code's plugin system with a single command, and it gives you access to skills grouped by task. The core ones handle reading, querying, and converting data files. The s3-explore skill lets you browse and query object storage without downloading anything. The spatial skill handles geographic questions like finding nearby cafes or checking if regions overlap. Two more skills pull from DuckDB's documentation and your session history, so Claude can answer questions about how window functions work or remind you what schema decisions you made last week. All of this runs against a single state.sql file that persists your attachments, secrets, and macros across sessions. The workflow is straightforward. Ask Claude something like "How many taxi trips were longer than 10 miles?" and it fires off a SELECT query. If the column name is wrong, DuckDB returns a binder error with candidate names, Claude reads it, retries with the right column, and gives you the answer—184,362 trips in the example. The plugin lives at github.com/duckdb/duckdb-skills, and the setup requires only that you have the DuckDB CLI installed locally.

Ask about this article