How this skill is triggered — by the user, by Claude, or both
Slash command
/cc-meta:mining-session-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Target**: $ARGUMENTS
Target: $ARGUMENTS
Mines Claude Code session transcripts for recurring patterns that feed compound learning. Converts raw session data into actionable improvements.
| Position | Name | Required | Default | Description |
|---|---|---|---|---|
| 1 | time-range | no | 7d | Period to scan. E.g. 7d, 30d, this-week. |
| 2 | output-path | no | docs/patterns/session-patterns.md | Where to write findings. |
Examples:
/mining-session-patterns # Last 7 days, default output
/mining-session-patterns 30d # Last 30 days
/mining-session-patterns 7d ./patterns.md # Custom output path
~/.claude/projects/*/*.jsonl # Session transcripts
Critical: Never bulk-read full .jsonl files. Use sampling strategy below
to respect context budget.
Discover session files — Glob ~/.claude/projects/*/*.jsonl. Filter by
mtime within time-range. Select up to 10 files, preferring recent.
Sample each file — Read first 20 lines + last 20 lines per file. This captures session setup (tools, config) and final outcomes (errors, completions). Skip files smaller than 5 lines.
Extract patterns from sampled lines:
type: "tool_error" or
error messages in tool results, then the next tool call on the same target.Format findings — Structure as tables per Output Format below. Every row must suggest a concrete improvement or be omitted.
Write output — Write to output-path. Create parent directories
if needed.
# Session Patterns — <start-date> to <end-date>
## Error-Fix Sequences
| Error Pattern | Recovery Strategy | Frequency | Candidate Learning |
|---------------|-------------------|-----------|-------------------|
| <tool>: <error summary> | <what worked> | N occurrences | <rule or skill suggestion> |
## Tool Failure Rates
| Tool | Calls | Failures | Rate | Common Cause |
|------|-------|----------|------|--------------|
| Bash | N | N | N% | <top failure reason> |
## Cost Signals
| Session | Messages | Est. Tokens | Task Complexity |
|---------|----------|-------------|-----------------|
| <uuid-short> | N | ~Nk | small/medium/large |
## Recommended Actions
- <Concrete improvement derived from patterns above>
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub qte77/claude-code-plugins --plugin cc-meta