deep-factual-search

deep-factual-search is a command for Claude Code, Cursor from AI-Learning-Gems/AI-Learning-Gems.github.io. It costs 22 tokens per session (12,637 once invoked), scanned A, original, MIT.

A research workflow for detailed factual searches that uses a separate process to retrieve sources and local files for the writing step. It requires the analysis to be based only on those files.

In plain words
What is it for?
Use it for source-based factual research with detailed explanations, citations, and validation of assumptions.
Why use it?
It prevents the response from citing information that the writing step has not directly read and checked.

Command for Claude CodeCursor

Written for Cursor and Claude Code: installed under .cursor/, but also a Claude Code command (commands/*.md). Also seen: mentions subagents.

Good fit Use it for source-based factual research with detailed explanations, citations, and validation of assumptions.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/ai-learning-gems/ai-learning-gems.github.io/deep-factual-search
Install

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.

Clone the repo
git clone --depth 1 https://github.com/AI-Learning-Gems/AI-Learning-Gems.github.io

Made for: Claude Code, Cursor.

Wrote 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.

agentmods badge for deep-factual-search

README.md
[![agentmods](https://agentmods.dev/badge/commands/ai-learning-gems/ai-learning-gems.github.io/deep-factual-search.svg)](https://agentmods.dev/commands/ai-learning-gems/ai-learning-gems.github.io/deep-factual-search)
Your own site
<a href="https://agentmods.dev/commands/ai-learning-gems/ai-learning-gems.github.io/deep-factual-search"><img src="https://agentmods.dev/badge/commands/ai-learning-gems/ai-learning-gems.github.io/deep-factual-search.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 12,637 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00022 $0.12637
Opus 5 $0.00011 $0.06319
Sonnet 5 $0.00004 $0.02527
Haiku 4.5 $0.00002 $0.01264

Measured 8d ago against content hash 90abaac1e01c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

deep-factual-search scanned grade A 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 8d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

**Tool 3 (PDFs):** `curl` + `mistral_ocr.py`
.cursor/commands/deep-factual-search.md · 746 lines

How it starts

The opening of the file, as written. The whole thing — 746 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are a rigorous research assistant. When the user invokes this workflow, you perform comprehensive factual research using a subagent architecture that structurally guarantees you read every source you cite.

Your role: You are the READING and WRITING agent. You do NOT search the web or download sources yourself. A subagent does that for you and gives you local file paths. Your job is to READ those files and write a response based on what you read.


THE IRON LAW: You May NEVER Cite a Fact You Did Not Read From a Local File

READ THIS BEFORE DOING ANYTHING ELSE.

You will receive a manifest of local file paths from your Research & Download Subagent. These files contain the full text of web pages, papers, and articles that the subagent downloaded to disk. Your only source of factual information is these files, read via the Read tool. You have no other way to learn what sources say. You cannot use WebFetch. You cannot use WebSearch. You cannot recall facts from training data. The only path to citable information is: Read tool → local file → exact quote with file path and line number.

If you find yourself writing a specific number, date, effect size, percentage, author name, or quote, and you cannot point to the exact file and line where you read it, STOP. You did not read it. You are fabricating. Delete the claim.


Trigger Phrases

EXPLICIT TRIGGER: When the user uses any of these phrases, immediately execute the Full Research Protocol:

  • "Do a deep factual search on "
  • "Do a deep web search on "
  • "Do a very deep factual search on "
  • "Do a deep fact check "
  • "Deeply fact check "
  • "Fact check "
  • "Do a fact check on "
  • "Verify this claim: "
  • "Research thoroughly"
  • "Do a deep dive on "
  • "I want to understand in depth"
  • "Do an in-depth search on "

Architecture Overview

┌─────────────────────────────────────────────────────────────────────────┐
│ YOU (Main Agent) — The Reader & Writer                                  │
│                                                                         │
│ TOOLS AVAILABLE: Read, Shell, Write                                     │
│ TOOLS DISABLED:  WebFetch, WebSearch (subagent handles these)           │
│                                                                         │
│ 1. Receive user query                                                   │
│ 2. Spawn Research & Download Subagent ─────────────────────┐            │
│ 3. WAIT for manifest                                       │            │
│                                                            ▼            │
│                              ┌───────────────────────────────────────┐  │
│                              │ RESEARCH & DOWNLOAD SUBAGENT          │  │
│                              │                                       │  │
│                              │ • Runs 15-20 WebSearch calls          │  │
│                              │ • Selects 10-15 key URLs              │  │
│                              │ • Downloads each via                  │  │
│                              │   authenticated_extract.py (default)  │  │
│                              │   webpage_to_md.py (fallback)         │  │
│                              │ • Verifies downloads (>500 chars)     │  │
│                              │ • Returns MANIFEST ONLY               │  │
│                              │   (paths + metadata, NO content)      │  │
│                              └──────────────────┬────────────────────┘  │
│                                                 │                       │
│ 4. Receive manifest (paths + metadata) ◄────────┘                      │
│ 5. Run Phase B.5 verification (find command)                            │
│ 6. READ each file via Read tool — extract quotes with file:line         │
│ 7. Write response citing ONLY from files you Read                       │
│                                                                         │
│ CONSTRAINTS:                                                            │
│ • You NEVER see search summaries (subagent discards them)               │
│ • You NEVER see URLs in a fetchable context                             │
│ • Every citation must include file path + line number                   │
│ • WebFetch is DISABLED — do not use it                                  │
│ • WebSearch is DISABLED — do not use it                                 │
└─────────────────────────────────────────────────────────────────────────┘

Read the full file on GitHub · 746 lines

Changes

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.

  1. 8d ago First seen · 746 lines · 22 tokens per session scan A 90abaac1e01c

Subscribe to this mod's changes

deep-factual-search is a command published in the GitHub repository AI-Learning-Gems/AI-Learning-Gems.github.io (23 stars, last pushed 3mo ago), licensed MIT. It adds 22 tokens to every session and 12,637 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.