lambdalisue/cclens/query
Claude Code and agent skill by lambdalisue/cclens
- community
Checking that the SKILL.md file is still in the repository.
Answer ad-hoc questions about the user's Claude Code usage with read-only SQL over the cclens store (cclens sql) — which files keep failing to edit, which tool errors most, usage per month, any slice the fixed views don't cover. Use when the user asks a specific question about their Claude Code sessions, tool errors, or skill usage.
Install
npx vskill@latest install lambdalisue/cclens/querySKILL.md
cclens query — ad-hoc SQL over the usage store
cclens extracts every Claude Code session into a local SQLite store; any slice its fixed views don't cover is one read-only query away. Answer the user's question by querying the store — never by re-parsing the raw ~/.claude/projects transcripts yourself.
1. Resolve the binary
- Binary: use
cclensifcommand -v cclensfinds it. Otherwise run every
command below through Nix instead: nix run github:lambdalisue/cclens -- <subcommand …>. If neither cclens nor nix is available, stop and tell the user how to install it (nix profile install github:lambdalisue/cclens, or cargo install --git https://github.com/lambdalisue/cclens).
Omit --db everywhere: the store defaults to a per-user path (${XDG_STATE_HOME:-~/.local/state}/cclens/cclens.db), so nothing is dropped into the current project. cclens sql errors on an absent store — run cclens analyze first in that case (also run it when the user wants current data; it is incremental and fast).
2. Query
The query is an argument, or stdin (which sidesteps shell quoting):
The store is opened read-only, so a query can never mutate it.
Schema crib — confirm with cclens sql "SELECT sql FROM sqlite_master" and sample the data before relying on an encoding:
tool_errors(view): one row per failed tool call —
session_id, project, category, excerpt, tool, target, started_epoch. category is the failure class (edit-precondition, path-not-found, blocked-by-hook, …), excerpt the actual error text (carries the failing path), target the file/command when the text omits it, project the session's cwd slug.
sessionsandeventshold everything else (skill spans, tokens, models,
timestamps); surfaces is the config catalog, where startup_tokens is what a surface costs every session and static_tokens its whole definition (a skill's body, paid only when invoked).
3. Present
Answer the user's actual question, with the query you ran shown so it can be tweaked. Timestamps in the store are UTC epoch — convert before presenting. For "how is my setup doing overall", point at /cclens:doctor instead of assembling it by hand.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/cclens/skills/query/SKILL.md
Popularity
- Repository stars
- 90
- Repository forks
- 7
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lambdalisue/cclens/query)