skills/mine.tool-gaps/SKILL.md
Use when the user says: "find tool gaps", "session archaeology", or "missing cli features". Mines session history for recurring patterns that should be scripts or CLI tools.
npx skillsauth add NodeJSmith/Claudefiles mine.tool-gapsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Mine Claude Code session history for workarounds — pipes to python3 -c, complex jq expressions, repeated curl sequences — that reveal missing CLI functionality or recurring patterns worth scripting.
$ARGUMENTS — optional tool name. Can be:
/mine.tool-gaps claude-tmuxDetermine mode and scope from $ARGUMENTS.
Targeted mode (tool name given):
~/.local/bin/ for scriptsrules/common/capabilities-*.md file; note if thin or absentExploratory mode (no args):
--since flagGoal: Extract bash commands from session history and filter for signal patterns.
<tool> | python3 -c or <tool> | python3 - — inline Python to post-process output<tool> | jq with non-trivial expressions (anything beyond .field or .[0])curl <url> | jq/python — raw unwrapped API callsdocker exec ... python manage.py ... — manual container commands& backgrounding — suggests missing batch/multi-arg modefor X in ...; do <tool> ...; done — for-loop iterating the same tool — same signal as abovegit status, git log, git add, git commit, etc.)cd, ls, pwd, find)echo, printf, cat)ado-api builds list)pytest, nox, ruff, pyright)Use two data sources in sequence. First, cm-search-conversations for session discovery, then direct grep on session JSONL files for raw bash commands.
# Step 1: Find sessions that mentioned the tool
cm-search-conversations --query "<tool>" --max-results 10 --format json
# Note: max-results caps at 10. Step 2 grep is a broader cross-check.
# Step 2: Search session JSONL files for bash commands involving the tool
# Filter for Bash tool_use entries (not hook_progress records which also have "command")
grep -rh "<tool>" ~/.claude/projects/*/*.jsonl 2>/dev/null | grep '"name":"Bash"' | grep -o '"command":"[^"]*"' | head -40
For deeper extraction from a specific session (UUID from Step 1; the glob resolves the project slug):
# Step 3: Extract bash commands from a specific session
grep '"name":"Bash"' ~/.claude/projects/*/<session-uuid>.jsonl 2>/dev/null | grep -o '"command":"[^"]*"' | head -40
Collect the raw command lines that involve the tool. Look for signal patterns.
Search session JSONL files directly for signal patterns. If the user selected a date range in Phase 1, filter session files by modification time using find -mtime:
# Find session files modified within the date range (e.g., -90 for 90 days)
find ~/.claude/projects -name "*.jsonl" -not -path "*/subagents/*" -mtime -90 2>/dev/null > /tmp/claude-sessions-list.txt
Then search those files for signal patterns:
# Find sessions with inline Python (strong signal)
xargs grep -l "python3 -c" < /tmp/claude-sessions-list.txt 2>/dev/null | head -20
# Find sessions with complex jq (moderate signal)
xargs grep -l "| jq" < /tmp/claude-sessions-list.txt 2>/dev/null | head -20
# Find sessions with raw curl (unwrapped API calls)
xargs grep -l '"curl ' < /tmp/claude-sessions-list.txt 2>/dev/null | head -20
# Find multi-call batching patterns (batch mode gap signal)
xargs grep -l ' & ' < /tmp/claude-sessions-list.txt 2>/dev/null | head -20
Then extract bash commands from the identified session files:
# Extract bash command lines from a session file
grep '"name":"Bash"' <session-file> | grep -o '"command":"[^"]*"' | head -40
Collect the raw patterns across sessions.
Goal: Identify tools causing permission prompts due to batching patterns — not to recommend allow-list entries (that's mine.permissions-audit's job), but to find tools that need a batch/multi-arg mode because the multi-call workaround breaks allow-list matching.
Run in parallel with or after the archaeology phase:
# Scan debug logs for for-loop artifacts and batched tool calls
ls -t ~/.claude/debug/*.txt 2>/dev/null | head -20 | xargs grep -h "ruleContent" 2>/dev/null | grep -oP '"ruleContent": "\K[^"]+' | sort | uniq -c | sort -rn | head -40
for <var> in ...; do <tool>; done or just do <tool> / done — this means the tool is being iterated and needs a multi-input mode& or newlines separating calls — the multi-call structure broke allow-list matchingIf a tool appears in BOTH archaeology workarounds AND the permission friction list, rank it higher in Phase 3. Dual-signal findings are more reliable than single-source ones.
Cluster raw findings into named gaps.
For targeted mode:
<tool> --help or read the source)For exploratory mode:
Ranking criteria:
| jq > simple pipeMinimum threshold for a finding: appears in 2+ sessions OR involves >1 line of inline code OR is corroborated by permission friction.
Present findings ranked by priority, then use AskUserQuestion to get decisions.
Format:
## Tool Gap Analysis: <tool or "Session History">
### High priority
1. **`<tool> --search <term>`** (4 sessions, ~10 lines inline Python each)
Sessions repeatedly filtered output with `python3 -c "import sys,json; ..."` to search by
title keyword. The API supports `?search=` natively — this would be a 2-line flag addition.
### Medium priority
2. **`<tool> export --format csv`** (2 sessions)
Two sessions piped to `python3 -c` to write CSV manually. The tool has no export command.
### Worth noting
3. **New script: `<tool>-bulk`** (2 sessions)
Both sessions ran the same 3-command sequence to do a bulk update. A thin wrapper would save
the pattern.
### Permission friction → batch mode gap
4. **`<tool> <id>...` multi-arg support** (permission friction signal)
`<tool>` was called 6 times in one block using `&` backgrounding, causing permission prompts
because multi-line commands don't match `Bash(<tool>:*)` allow-list patterns. The fix is a
native `<tool> <id1> <id2> ...` form — one call, no newlines, no friction.
(Note: if you just want to stop the prompts without changing the tool, use `mine.permissions-audit`.)
Permission friction findings should only appear here when there is a clear batch/multi-call pattern in the archaeology. If the permission prompt has no corresponding workaround pattern, omit it — it belongs in mine.permissions-audit, not here.
Then ask which gaps to address and how (custom gate — tool gaps have implement/issue/skip paths that don't fit the standard inline resolution flow):
AskUserQuestion:
question: "Which gaps are worth addressing?"
header: "Gaps to fix"
multiSelect: true
options:
- label: "<gap name> — implement now"
description: "<1-line summary, effort estimate>"
- label: "<gap name> — create issue"
description: "File it and come back later"
- label: "<gap name> — skip"
description: "Not worth automating"
For each selected gap, confirm the action:
/mine.buildBased on user decisions:
Implement now:
Hand off to /mine.build with the gap description. Do not draft code in this skill — /mine.build assesses complexity and routes to direct implementation or the full caliper workflow. Say:
"Handing off to
/mine.buildfor<gap name>. This will assess complexity and route to the right implementation workflow."
Create issue:
Draft and file immediately using gh-issue create.
Run get-skill-tmpdir mine-tool-gaps-issue to create a temp directory, then write the body to <dir>/body.md:
## Gap
<description of what's missing>
## Evidence
- Found in N sessions (most recent: <date>)
- Workaround: `<command that appears repeatedly>`
- Example: `<paste the actual pattern>`
## Proposed solution
<flag name, subcommand, or new script>
## Source
Identified by /mine.tool-gaps on <date>.
Create the issue:
gh-issue create --title "<concise gap description>" --body-file "<dir>/body.md"
Update capabilities:
If the tool is missing from the appropriate rules/common/capabilities-*.md file or has a thin entry, offer to draft the section. Say what you'd add and ask for confirmation before writing.
/mine.challenge for thatdevelopment
Use when the user says: "document how X works", "write up how this works", "durable explanation", "explain this for the docs", "document this subsystem". Writes a durable, architectural-altitude explanation that survives code churn.
development
Use when picking up a fresh session after /clear, a stop, or an unanswered AskUserQuestion. Reconstructs the prior session's intent from its transcript tail and surfaces any unresolved decision; user-invoked only — for a hand-written end-of-day handoff use /mine-good-morning instead.
development
Use when the user says: "what did we discuss", "continue where we left off", "remember when", "as I mentioned", "you suggested", "we decided", "search my conversations", "find the conversation where", "what did we work on", or uses implicit signals like past-tense references, possessives without context, or assumptive questions. Direct search over past Claude Code sessions via cass.
tools
Use when the user says: "what context do I have", "relevant history for this task", "what have we done related to this". Also usable proactively when starting work that likely has prior history. Assembles a structured context brief from past session history via cass, scoped to the current task and workspace.