CC

CCQL – SQL Queries for Claude Code

Hacker News

CCQL – SQL Queries for Claude Code

I built *CCQL*, a CLI tool that lets you run SQL queries directly against your Claude Code data (history, transcripts, prompts, sessions, etc.). If you use Claude Code regularly, you quickly accumulate a large amount of interaction data. CCQL makes that data queryable with SQL so you can analyze how you actually use the agent. *Examples* ```bash # What tools does Claude use most? ccql "SELECT tool_name, COUNT( ) AS uses FROM transcripts GROUP BY tool_name ORDER BY uses DESC LIMIT 10" # Find prompts mentioning a topic ccql "SELECT display, timestamp FROM history WHERE display LIKE '%authentication%'" # Cross-session analysis ccql "SELECT _session_id, COUNT( ) FROM transcripts GROUP BY _session_id" ``` *Built-in commands* ```bash ccql prompts --session ses_123 ccql duplicates --threshold 0.8 ccql search "error" ``` *Interesting technical bit* Claude Code stores its data in a structured local format. CCQL loads that data into an embedded SQL engine (GlueSQL) with a clean, read-first model, so you can safely explore usage patterns without mutating anything. *Features* * SQL queries across history, transcripts, prompts, sessions, and todos * Fuzzy duplicate detection (find repeated or near-duplicate prompts) * Full-text search with regex * Safe writes with automatic backups * Output formats: table, JSON, JSONL *Install* ```bash # macOS brew install douglance/tap/ccql # npm (any platform) npx @douglance/ccql "SELECT * FROM history LIMIT 10" # Cargo cargo install ccql ``` Built in Rust using GlueSQL. MIT licensed. GitHub: [ https://github.com/douglance/ccql ]( https://github.com/douglance/ccql ) I’ve been using this to understand my own Claude usage patterns—what prompts I repeat, which tools get called most, and how conversations evolve across sessions. Curious what queries others would find useful.

Share card

Actual performance

4points
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: mac, macos, agent · Missing: agents, cursor, apple
82%82% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersIH features products with proven revenue · Missing: supports, reddit linkedin, podcasting
49%49% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsMay not resonate with HN audience · Strong signals: io · Missing: https docs, excited, just released
45%45% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
AppSumoMay struggle as an AppSumo deal · Strong signals: platform · Missing: plus, intuitive, reviews
32%32% predicted probability of success on AppSumo, based on ML models trained on real launch data.
TrustMRRLess likely to generate early MRR · Missing: mobile apps, ios, personal
30%30% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
20%20% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Correct prediction on native model

Similar products

Di
DigData – convert SQL to MongoDB queries66%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

DigData – convert SQL to MongoDB queries

Hacker News6
sq
sqltop – Find the most resource consuming SQL Server queries55%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

sqltop – Find the most resource consuming SQL Server queries

Hacker News18
Vi
Visualize SQL Queries56%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Visualize SQL Queries

Hacker News259
AI2sql
AI2sql21%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Write SQL queries with no knowledge of SQL

AppSumo4
Cs
Csql – Python lib for composeable SQL queries57%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Csql – Python lib for composeable SQL queries

Hacker News89
De
DeployQL- collaborative, trackable SQL queries71%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

DeployQL- collaborative, trackable SQL queries

Hacker News5
We
Webapp to Format SQL Queries for Readability64%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Webapp to Format SQL Queries for Readability

Hacker News4
FS
FSQL – Search through your file system with SQL-esque queries62%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

FSQL – Search through your file system with SQL-esque queries

Hacker News341
Op
Optimize SQL Queries for Free72%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Optimize SQL Queries for Free

Hacker News1
Cr
Create a KPI Dashboard by Pasting SQL Queries69%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Create a KPI Dashboard by Pasting SQL Queries

Hacker News8