Skip to content
Back to skills

Mine

ASecurity

Mine Claude Code session data for analytics — token usage, tool rankings, skill invocations, session search, and prompt history. Use when asked about session stats, token costs, tool frequency, skill usage patterns, or finding past sessions by prompt text.

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
ai-agentsbash

Works with

  • claude code

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add SDiamante13/dotfiles --skill mine --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Mine?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Mine
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sdiamante13-mine/badge)](https://www.skillsdirectory.com/skills/sdiamante13-mine)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: mine
description: "Mine Claude Code session data for analytics — token usage, tool rankings, skill invocations, session search, and prompt history. Use when asked about session stats, token costs, tool frequency, skill usage patterns, or finding past sessions by prompt text."
---

# mine

Mine `~/.claude/projects/` session JSONL and index files for analytics and forensics.

## Trigger Cues
- Explicit `/mine` invocation
- "How many tokens did I use?" / "What are my most-used tools?"
- "Find the session where I discussed X"
- "Which skills do I use most?"
- "Show me token usage by project/day"

## Data Model
- Sessions: `~/.claude/projects/<project>/<session-id>.jsonl`
- Index: `~/.claude/projects/<project>/sessions-index.json`
- Memory: `~/.claude/projects/<project>/memory/`

## Scripts

All scripts are in `~/.claude/skills/mine/scripts/`. Run them via Bash.

### 1. Search sessions
Find sessions by prompt text, project, or date range.
```bash
bash ~/.claude/skills/mine/scripts/mine-sessions.sh --prompt "auth" --limit 10
bash ~/.claude/skills/mine/scripts/mine-sessions.sh --project dotfiles --since 2026-03-01
```

### 2. View session prompts
Extract user/assistant messages from a session.
```bash
bash ~/.claude/skills/mine/scripts/mine-prompts.sh --session <path-to-jsonl>
bash ~/.claude/skills/mine/scripts/mine-prompts.sh --session <path> --roles user --limit 20
```

### 3. Rank tool usage
See which tools are called most across sessions.
```bash
bash ~/.claude/skills/mine/scripts/mine-tools.sh --limit 20
bash ~/.claude/skills/mine/scripts/mine-tools.sh --project ka-ching --since 2026-03-01
```

### 4. Token usage
Summarize token consumption.
```bash
bash ~/.claude/skills/mine/scripts/mine-tokens.sh --by project --limit 10
bash ~/.claude/skills/mine/scripts/mine-tokens.sh --by day --since 2026-03-20
bash ~/.claude/skills/mine/scripts/mine-tokens.sh --by session --project dotfiles
```

### 5. Rank skill invocations
See which skills are invoked most (via Skill tool_use blocks).
```bash
bash ~/.claude/skills/mine/scripts/mine-skills.sh --limit 20
bash ~/.claude/skills/mine/scripts/mine-skills.sh --since 2026-03-01
```

## Workflow
1. Start with session search or index queries to find relevant sessions.
2. Drill into a specific session with `mine-prompts.sh`.
3. Use `mine-tools.sh`, `mine-tokens.sh`, `mine-skills.sh` for aggregate analytics.

Files in this skill

  • SKILL.md2.3 KB
  • scripts/mine-prompts.sh2.1 KB
  • scripts/mine-sessions.sh1.8 KB
  • scripts/mine-skills.sh1.7 KB
  • scripts/mine-tokens.sh3 KB
  • scripts/mine-tools.sh1.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.