Blog NotebookLM: Source-Grounded Research from Your Documents
Query Google NotebookLM notebooks directly from Claude Code for citation-backed answers from Gemini. Each question opens a headless browser session, retrieves the answer from your uploaded documents, and closes. Responses are source-grounded model answers, not proof of truth: uploaded documents may be primary or secondary, and the answer can still omit context.
Answers satisfy the FLOW evidence triple only when the returned citation includes a verifiable underlying source URL plus a publication or retrieval date. Use the underlying source title as the inline citation. Do not cite the private NotebookLM URL as the bibliography entry for public content.
Quick Reference
Prerequisites
- Google account with NotebookLM access
- Python 3.11+ (venv managed automatically by
run.py) - Google Chrome (installed automatically on first run via Patchright)
- One-time authentication setup (interactive Google login in visible browser)
Always Use run.py Wrapper
NEVER call scripts directly. ALWAYS use python3 scripts/run.py [script]:
The run.py wrapper automatically creates .venv, installs dependencies,
sets up Chrome, and executes the target script.
Auth Check (Gate Pattern)
Before any query operation, check authentication:
- If authenticated: proceed with the query
- If not authenticated: inform user and guide to setup:
"NotebookLM requires Google login. Run
/blog notebooklm setupto authenticate." - When called internally (from blog-write or blog-researcher): return silently with no error if not authenticated. Never block the writing workflow.
Setup Workflow
For /blog notebooklm setup:
Tell the user: "A browser window will open. Please log in to your Google account." Authentication persists via browser profile + cookie injection (hybrid approach).
Other auth commands:
Query Workflow
For /blog notebooklm ask <question>:
Step 1: Check Auth
Run auth check (see gate pattern above). If not authenticated, guide to setup.
Step 2: Resolve Notebook
Determine which notebook to query:
- If
--notebook-urlprovided: validate it is a NotebookLM notebook URL, then use it - If
--notebook-idprovided: look up in library - If neither: use active notebook from library
- If no active notebook: show library and ask user to select
Step 3: Ask the Question
Step 4: Analyze and Follow Up
Every response ends with a follow-up prompt. Required behavior:
- STOP: do not immediately respond to the user
- ANALYZE: compare the answer to the user's original request
- IDENTIFY GAPS: determine if more information is needed
- ASK FOLLOW-UP: if gaps exist, immediately ask a follow-up question
- REPEAT: continue until information is complete
- SYNTHESIZE: combine all answers before responding to the user
Smart Discovery Workflow
For /blog notebooklm discover <url>:
When adding a notebook without knowing its content, query it first:
NEVER guess or use generic descriptions. Always discover or ask the user.
Library Management
Internal API (for blog-write / blog-researcher)
When invoked as a Task subagent from blog-write or blog-researcher:
Input (provided by calling skill):
question: Research question relevant to the blog topicnotebook_idornotebook_url: Which notebook to querycontext: "internal" (signals graceful fallback mode)
Process:
- Check auth status: if not authenticated, return empty result silently
- Query the notebook with the research question
- Parse and return structured response
Output (returned to calling skill):
Graceful fallback: If auth is missing or query fails, return immediately with no error. The calling workflow continues with WebSearch-based research. Never block blog-write or blog-rewrite because NotebookLM is unavailable.
Data Storage
All data stored inside the skill directory:
data/library.json: Notebook metadata and librarydata/auth_info.json: Authentication statusdata/browser_state/: Chrome profile with cookies
Security: All data directories are gitignored. Never commit auth or browser state.
Error Handling
Limitations
- No session persistence (each question = new browser session)
- Rate limits on free Google accounts (50 queries/day)
- Manual upload required (user must add docs to NotebookLM web UI)
- Browser overhead (few seconds per question for launch + teardown)
- Local Claude Code only (not available in web UI)
Reference Documentation
Load on-demand: do NOT load all at startup:
references/commands.md: Full CLI commands, parameters, and workflow patternsreferences/troubleshooting.md: Error solutions, recovery procedures, debugging

