New advertisers: 50% off your first month with code FIRSTMONTHSee slots

Query and analyze Claude Code usage history stored in a ccrecall database.

version
0.0.23
GitHub stars
37
View on GitHub

What it does

  • Covers token usage by model, project, and day, plus session history and thinking block search
  • Provides an analytics skill for querying token usage and session history from the ccrecall database
  • Designed for reviewing how Claude Code is used across your projects and sessions

Add marketplace

/plugin marketplace add spences10/claude-code-toolkit

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install analytics@claude-code-toolkit

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Session Analytics

Query your Claude Code usage data from the ccrecall SQLite database.

Prerequisites

# Sync transcripts to SQLite (requires bun)
bun x ccrecall sync

Database location: ~/.claude/ccrecall.db

CLI Commands

bun x ccrecall sync      # Import transcripts (incremental)
bun x ccrecall stats     # Show session/message/token counts
bun x ccrecall sessions  # List recent sessions
bun x ccrecall search    # Full-text search across messages
bun x ccrecall tools     # Show most-used tools
bun x ccrecall query     # Execute raw SQL

Quick Queries

Token usage by model

SELECT model,
       COUNT(*) as messages,
       SUM(input_tokens) as input_tok,
       SUM(output_tokens) as output_tok
FROM messages
WHERE model IS NOT NULL
GROUP BY model;

Daily usage

SELECT date(timestamp/1000, 'unixepoch') as day,
       COUNT(*) as msgs,
       SUM(output_tokens) as tokens
FROM messages
GROUP BY day
ORDER BY day DESC
LIMIT 7;

Usage by project

SELECT s.project_path,
       COUNT(m.uuid) as messages,
       SUM(m.output_tokens) as tokens
FROM sessions s
JOIN messages m ON m.session_id = s.id
GROUP BY s.project_path
ORDER BY tokens DESC
LIMIT 10;

Tool usage

SELECT tool_name, COUNT(*) as count
FROM tool_calls
GROUP BY tool_name
ORDER BY count DESC;

Search thinking blocks

SELECT substr(thinking, 1, 200) as preview,
       datetime(timestamp/1000, 'unixepoch') as time
FROM messages
WHERE thinking LIKE '%your search term%'
ORDER BY timestamp DESC
LIMIT 10;

Using with mcp-sqlite-tools

If you have mcp-sqlite-tools configured, Claude can query directly:

  1. Open database: open_database ~/.claude/ccrecall.db
  2. Tables: sessions, messages, tool_calls, tool_results, teams, team_members, team_tasks
  3. Run queries above or ask Claude to analyze patterns

GitHub

https://github.com/spences10/ccrecall

From the spences10/claude-code-toolkit README

claude-code-toolkit

Productivity and ecosystem tools for Claude Code.

For vendor-agnostic skills usable outside Claude Code's plugin marketplace, use spences10/skills.

Quick Start

# Add marketplace
/plugin marketplace add spences10/claude-code-toolkit

# Install plugins
/plugin install mcp-essentials
/plugin install analytics
/plugin install toolkit-skills
/plugin install claude-workflow
/plugin install dev-environment
/plugin install devops-skills
/plugin install dev-practices
/plugin install nopeek

Plugins

mcp-essentials

Setup guide for recommended MCP servers:

ServerPurpose
mcp-omnisearchUnified search (Tavily, Kagi, GitHub, Perplexity)
mcp-sqlite-toolsSafe SQLite operations
mcpickManage MCP servers, plugins, cache, and profiles

Skills: mcp-setup — setup guide for configuring MCP servers

analytics

Query Claude Code usage from ccrecall database:

  • Token usage by model/project/day
  • Session history
  • Thinking block search

Skills: analytics — query token usage and session history

toolkit-skills

Core skills for the toolkit ecosystem.

SkillDescription
ecosystem-guideGuide to choosing the right tool across the ecosystem
researchVerify sources before presenting findings
skill-creatorDesign and create Claude Skills using progressive disclosure
reflectExtract learnings from sessions and persist to skills
plugin-devValidate, test, and distribute Claude Code plugins

claude-workflow

Claude Code workflow patterns.

SkillDescription
advanced-promptingHigh-leverage prompts that challenge Claude's defaults
claude-md-maintenanceMaintain CLAUDE.md files effectively
orchestrationMulti-agent orchestration patterns for team mode
structured-rpiEnhanced Research-Plan-Implement workflow with structured phase gates

dev-environment

Development environment setup.

SkillDescription
terminal-optimizationTerminal setup for Claude Code (Ghostty, statusline, tmux)
worktree-masteryGit worktree patterns for parallel Claude sessions

devops-skills

DevOps patterns.

SkillDescription
ci-debug-workflowDebug failing CI pipelines and reproduce bugs locally
techdebt-finderFind duplicated code, inconsistent patterns, and refactoring opportunities
deslopIdentify and remove AI-generated code patterns (slop)
improve-codebase-architectureFind architectural improvement opportunities and deepen shallow modules

dev-practices

Development practice skills.

SkillDescription
tddTest-Driven Development workflow with red-green-refactor cycle

nopeek

Secret safety for Claude Code sessions. Powered by the nopeek CLI.

HookEventWhat it does
redact-outputPreToolUse(Bash)Best-effort pattern redaction for selected cloud CLI stdout; not stderr

Tell your coding agent: Use npx nopeek if you need keys. Swap npx for pnpx or bunx if that's what you use. The agent selects keys and uses run for each credential-dependent command. init is an optional cloud-auth audit, not an installation prerequisite.

Security migration: Update to nopeek CLI 0.0.17 or newer and nopeek plugin 0.0.24 or newer. Stored credentials and CLI profiles are no longer automatically loaded into sessions, and load no longer writes CLAUDE_ENV_FILE. Remove legacy SessionStart registrations and restart affected sessions. The retired session-load.sh entry point only prints migration guidance; it never reads stored keys. Neither updating nor deleting stored keys clears old environments, session files, histories, or transcripts. Rotate exposed credentials.

Persistence remains explicit, global plaintext, and not project-scoped; load --persist now requires --only. Prefer per-command run instead. run --only filters the file, not inherited parent variables, and does not prevent child output or argument disclosure. Redaction is not a guarantee.

Skills: nopeek — per-command credentials, migration, and limitations

Regression checks (synthetic credentials only):

python3 -m unittest discover -s plugins/nopeek/tests -v
claude plugin validate plugins/nopeek

See the cross-agent assessment for source-backed comparisons and the tested delivery boundary.

Ecosystem

Related projects for Claude Code power users. For portable skills across compatible agents, use spences10/skills.

ProjectWhat it does
nopeekPer-command credential loading that reduces accidental disclosure
svelte-skills-kitProduction-ready Svelte 5 & SvelteKit skills (90%+ verified accuracy)
claude-skills-cliCreate skills with progressive disclosure validation and 84% activation hooks
mcpickManage MCP servers, plugins, cache, and profiles from the CLI
ccrecallSync Claude Code transcripts to SQLite for usage analytics and search

Local Development

git clone git@github.com:spences10/claude-code-toolkit.git ~/repos/claude-code-toolkit

# Add local marketplace
/plugin marketplace add ~/repos/claude-code-toolkit

# Install plugin
/plugin install mcp-essentials

Releasing Updates

Version lives in one place: .claude-plugin/marketplace.json. Bump all "version" values there, commit, and push. Users with auto-update get changes on startup. Others run /plugin update plugin-name@spences10-claude-code-toolkit.

Details

Marketplace
spences10/claude-code-toolkit
Source
plugins/analytics
Author
Scott Spence
Category
Analytics
License
MIT
Keywords
analytics, tokens, sessions
Listed since
Apr 7, 2026

More from spences10/claude-code-toolkit

All 8

Similar to analytics

More Developer Tools