/csvql:csvqlfrom csvql
Runs SQL queries directly on CSV, TSV, and Excel files using the csvql CLI. Use instead of reading large data files into context.
Ships in csvql. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
csvql runs SQL directly on CSV files in place. Read-only, no import, no database. Use it instead of reading the file into context or writing a pandas script.
Never print the data file into the conversation. No cat, head, tail, file-read tool or script on a .csv, .tsv or .xlsx file, not even a quick look at the first rows. Use the schema step for that. Raw rows put personal data in the conversation and nothing takes it back out.
Before running any shell command, look for the csvql MCP tools: csv_list, csv_schema, csv_query, usually named mcp__csvql__.... Your client may list them by name only, so load them if needed. If they exist, use them instead of the shell. The server enforces the folder sandbox, the denied columns, the output cap and the audit log. The CLI run through a shell enforces only the flags you pass. csv_query returns at most about 100 rows / 12 KB per call, so aggregate rather than page through a table.
If they do not exist, use the CLI as described below. csvql install registers the MCP server for next time.
After the schema step and before the first query, check the column names for personal data: names, emails, phone numbers, addresses, dates of birth, national or tax IDs, account or card numbers, IP addresses, free-text notes.
If there are any, treat them as blocked from the first query, without asking first. Carry on with the task, then tell the user which columns you blocked and that they can allow any of them.
--deny-columns email,ssn to every command. A query that reads a denied column fails with DeniedColumn, and SELECT * leaves those columns out. Names match as whole words, so list variants such as customer_ssn too.SELECT *. csv_schema returns a few sample rows, so some values may already be in context; say so. Tell the user to add --deny-columns to the server args and restart to make the block real.Prefer counts, sums and averages by group over row listings. Do not return rows that identify a person unless the user asks for exactly that.
This is guidance, not enforcement. Only --deny-columns and --root actually block a query.
command -v csvql || echo missing
If missing, ask the user before installing, then use one of:
brew install melihbirim/csvql/csvql # macOS, Linux
pip install csvql-query # Python
npm install -g csvql-query # Node, CLI is csvql-query
Prebuilt binaries: https://github.com/melihbirim/csvql/releases
csvql --schema data.csv (columns, inferred types, row count, size).csvql "SELECT region, SUM(revenue) AS total FROM 'sales.csv' GROUP BY region ORDER BY total DESC LIMIT 10"
csvql "SELECT COUNT(*) FROM 'events.csv' WHERE status = 'error'"
csvql "SELECT o.id, c.name FROM 'orders.csv' o JOIN 'customers.csv' c ON o.customer_id = c.id"
gunzip -c data.csv.gz | csvql "SELECT COUNT(*) FROM '-' WHERE age > 30"
LIMIT so the output stays small. Add --json when you need to parse results, --markdown to show the user a table.-d '\t' for TSV or another delimiter--no-input-header when the file has no header row (columns become c1..cN)-o out.csv to write results to a file--strict to error instead of skipping rows whose WHERE value is not numeric--deny-columns a,b to refuse any query that reads those columns--root <dir> to confine file access to that folder--audit <file> to append one JSONL record per query, when the user needs a record of what was runSELECT, WHERE (AND/OR/NOT, LIKE/ILIKE, IN, BETWEEN, IS NULL), GROUP BY, HAVING, ORDER BY, LIMIT, DISTINCT, JOIN and LEFT JOIN (chained), col IN (SELECT ...). Aggregates: COUNT, SUM, AVG, MIN, MAX, MEDIAN, QUANTILE, MODE, STDDEV, VARIANCE, GROUP_CONCAT, COUNT(DISTINCT). Date and string functions such as STRFTIME, DATEDIFF, LOWER, UPPER, SUBSTR, ROUND. Arithmetic (+ - * /, parentheses) over columns and numbers in SELECT, WHERE and inside SUM, AVG, MIN, MAX, STDDEV and VARIANCE, and over aggregate results: SUM(price * qty), WHERE price * qty > 100, SUM(a) / COUNT(*). Column names with spaces go in double quotes: SELECT "First Name" FROM 'people.csv'.
Not supported: arithmetic around function calls (ROUND(a) * 2), RIGHT/FULL/CROSS JOIN, window functions, UNION, subqueries in FROM, any writes. DATEDIFF and DATEADD take columns, not literals. For those, fall back to another tool.
--strictRun csvql --help for the full reference.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub melihbirim/csvql --plugin csvqlOther plugins' skills for the same job