Borrowing it
Nothing to install: this file belongs to theshadow27/mcp-cli. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/theshadow27/mcp-cli/main/.claude/commands/mine-rules.mdgit clone --depth 1 https://github.com/theshadow27/mcp-cliWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/theshadow27/mcp-cli/mine-rules)<a href="https://agentmods.dev/commands/theshadow27/mcp-cli/mine-rules"><img src="https://agentmods.dev/badge/commands/theshadow27/mcp-cli/mine-rules/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/theshadow27/mcp-cli/mine-rules"><img src="https://agentmods.dev/badge/commands/theshadow27/mcp-cli/mine-rules.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00796 |
| Opus 5.5 | $0.00000 | $0.00318 |
| Sonnet 5.5 | $0.00000 | $0.00159 |
| Haiku 4.5 | $0.00000 | $0.00080 |
Grade B, and why
mine-rules scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
find ~/.claude/projects -name "<conversation-id>.jsonl" 2>/dev/null How it starts
The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Mine Rules from Conversation History
Extract actionable rules and user feedback from a Claude Code conversation history to improve skills and memory.
Input
The user provides a conversation ID (UUID) and optionally a target skill name. Parse from: $ARGUMENTS
Format: <conversation-id> [skill-name]
Examples:
/mine-rules a47556cb-7200-4403-aae6-0988f88e5a71 manage/mine-rules a47556cb-7200-4403-aae6-0988f88e5a71(general — updates MEMORY.md)
Workflow
1. Locate the conversation
Search for the JSONL file in ~/.claude/projects/:
find ~/.claude/projects -name "<conversation-id>.jsonl" 2>/dev/null
If not found, report and stop.
2. Extract user messages
The file is JSONL (one JSON object per line). Extract all human/user messages. These are large files (often 5k-15k lines), so use bash to filter:
# Extract user message content from JSONL
cat <file> | jq -r 'select(.type == "human") | .message.content[]? | select(.type == "text") | .text' 2>/dev/null
If jq isn't available or the format differs, use grep/awk to extract lines with "role":"human" or "type":"human".
3. Analyze for rules
Scan all user messages for:
- Corrections — "no, don't do X" / "you should have done Y instead"
- Explicit rules — "always X" / "never Y" / "from now on..."
- Complaints about efficiency — "this wastes time" / "too slow" / "burns context"
- Process instructions — "the pipeline should be..." / "do X before Y"
- Repeated feedback — same correction given multiple times (high signal)
Focus on efficiency-related feedback — things that affect context usage, time, cost, or pipeline throughput. Skip stylistic preferences unless they affect efficiency.
4. Categorize and deduplicate
Group extracted rules by category:
- Orchestration — how to manage sessions, polling, delegation
- Pipeline — phase ordering, when to clear, skip, or reuse
- Resource management — model selection, concurrency, context preservation
- Cleanup — worktree handling, daemon discipline, session lifecycle
- Issue discipline — when to file, label, skip
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 84 lines · 0 tokens per session scan B 76b4c007e0b1
mine-rules is a command published in the GitHub repository theshadow27/mcp-cli (2 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 796 tokens. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other commands, from other repositories
minutes-ideas
Surface recent voice memos and ideas captured from any device. Use when the user asks "what ideas did I have?", "what were my recent memos?", "what did I record while walking?", or wants to recall a captured thought.
learn
Force claude-smart to extract learnings from this session now.
memory-store
Store an insight, decision, or pattern to memory.
analyze-context
USE WHEN you want to analyze project context before starting work on a task. Calls context + recall, then synthesizes goals, decisions, gotchas, and relevant memories into a pre-task brief.
cc-memory
Configure persistent memory that survives across sessions using a layered approach: split rule files for always-loaded context, auto-memory for organic learning, and optional MCP-backed long-term memory for large codebases.
lians-recall
Recall current (non-stale) facts from Lians memory, optionally as-of a past date.