Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/theshadow27/mcp-cli/mine-rulesgit 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.svg" alt="Measured on agentmods" 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 | $0.00000 | $0.00796 |
| Opus 5 | $0.00000 | $0.00398 |
| Sonnet 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 3d 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.
- 3d 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 4d 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
git
Git operations with intelligent commit messages and workflow optimization.
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.