nb-query

nb-query is a skill for Claude Code, Codex from rongarede/claude-skills-research. It costs 113 tokens per session (1,988 once invoked), scanned A, original, MIT.

A detailed query workflow for searching a NotebookLM knowledge library and producing an answer with source tracking, outside fact checks, and images from a local article archive. NotebookLM is a tool for asking questions about a collection of supplied documents.

In plain words
What is it for?
Use it for in-depth research across saved articles: synchronize the library, collect source-backed findings, map citations to documents, verify facts, trace relevant images, and save the final answer.
Why use it?
It preserves the raw answer and citation mapping, checks important claims against external sources, and keeps the research process repeatable instead of leaving sources and intermediate results scattered.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it for in-depth research across saved articles: synchronize the library, collect source-backed findings, map citations to documents, verify facts, trace relevant images, and save the final answer.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/rongarede/claude-skills-research/nb-query
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.

Any agent
npx skills add rongarede/claude-skills-research --skill nb-query
Clone the repo
git clone --depth 1 https://github.com/rongarede/claude-skills-research

Made for: Claude Code, Codex.

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 nb-query

README.md
[![agentmods](https://agentmods.dev/badge/skills/rongarede/claude-skills-research/nb-query/github.svg)](https://agentmods.dev/skills/rongarede/claude-skills-research/nb-query)
Your own site
<a href="https://agentmods.dev/skills/rongarede/claude-skills-research/nb-query"><img src="https://agentmods.dev/badge/skills/rongarede/claude-skills-research/nb-query/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.

agentmods 80×15 button for nb-query

Your own site · 80×15
<a href="https://agentmods.dev/skills/rongarede/claude-skills-research/nb-query"><img src="https://agentmods.dev/badge/skills/rongarede/claude-skills-research/nb-query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,988 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00113 $0.01988
Opus 5 $0.00056 $0.00994
Sonnet 5 $0.00023 $0.00398
Haiku 4.5 $0.00011 $0.00199

Measured 12d ago against content hash 400f8bbe0278, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

nb-query scanned grade A with 0 findings 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 12d ago.

The scan reads SKILL.md. This mod also ships 6 executable files (scripts/add_article_links.py, scripts/build_source_mapping.py, scripts/check_articles_dir.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/nb-query/SKILL.md · 210 lines

How it starts

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

NotebookLM 深度查询(带引用溯源 + 核查 + 本地图片溯源)

对 NotebookLM Skill 的增强 Wrapper,采用超富集模式查询。

核心理念

  1. 超富集查询:不追求言简意赅,尽可能搜集资料,宁多勿少
  2. 过程可追溯:所有中间产物存储到工作目录,支持断点续查
  3. 外部核查:强制使用外部检索验证关键信息的准确性和时效性
  4. 本地图片溯源:不依赖 NotebookLM 的图片输出,从本地文章存档中提取正确的图片

工作目录结构

~/Downloads/nb-query-<主题关键词>-<日期>/
├── 00-metadata.md              # 任务元信息
├── 01-raw-response.json        # NotebookLM 原始 JSON 输出
├── 02-raw-answer.md            # 原始回答(带引用序号)
├── 02-raw-answer-with-images.md # 带图片的回答
├── 03-citation-map.json        # 序号 → 标题映射
├── 03-title-stats.json         # 文章统计
├── 03-citation-table.md        # 引用对照表(含链接)
├── 03.1-link-results.json      # 链接映射结果
├── 03.5-all-images.json        # 原始图片列表
├── 03.5-image-mapping.json     # 过滤后的图片映射
├── 04-fact-verification.md     # 外部检索核查结果
└── 05-final.md                 # 最终输出

执行流程

阶段 -1:同步知识库(BLOCKING)

每次查询前,先确保本地文章存档与 NotebookLM 同步:

/sync-notebooklm-kb

阶段 0:初始化与依赖检查

# 创建工作目录
WORK_DIR=~/Downloads/nb-query-<topic-in-english>-$(date +%Y%m%d)
mkdir -p "$WORK_DIR"

# 检查本地文章存档依赖
python scripts/check_articles_dir.py

命名规范:主题用英文/拼音,如 nb-query-ai-tools-workflow-20260115

写入 00-metadata.md:任务元信息(时间、查询主题、笔记本、状态)

阶段 1:准备阶段

# 确认笔记本上下文
notebooklm status

# 获取 source 列表(必须用 --json)
notebooklm source list --json > /tmp/nb_sources_raw.json

# 构建映射表
python scripts/build_source_mapping.py

阶段 2:超富集查询

查询 prompt 模板(强制详细 + 禁止图片输出):

请针对以下问题,提供**尽可能详尽、全面**的回答:
{用户的原始问题}

要求:
1. 不要精简:宁可冗长也不要遗漏
2. 超富集搜集:所有相关内容都整合进来
3. 多角度覆盖:从不同维度汇总信息
4. 保留细节:具体数字、日期、案例都保留
5. 标注引用:每个信息点都标注 [1], [2] 等
6. 不做总结性压缩
7. 禁止输出图片链接
8. 标记配图位置:用 <!-- IMAGE_PLACEHOLDER: [引用号] --> 标记
notebooklm ask "..." --json > "$WORK_DIR/01-raw-response.json"

从 JSON 提取 answer 写入 02-raw-answer.md

阶段 3:生成引用对照表

WORK_DIR="$WORK_DIR" python scripts/generate_citation_table.py

阶段 3.1:添加外部链接

WORK_DIR="$WORK_DIR" python scripts/add_article_links.py

输出:03-citation-table.md(含链接)

Read the full file on GitHub · 210 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 210 lines · 113 tokens per session scan A 400f8bbe0278

Subscribe to this mod's changes

nb-query is a skill published in the GitHub repository rongarede/claude-skills-research (2 stars, last pushed 5mo ago), licensed MIT. It adds 113 tokens to every session and 1,988 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.