Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.
Add this skill
npx mdskills install sickn33/notebooklmComprehensive browser automation skill with detailed workflows, smart discovery, and persistent auth
1---2name: notebooklm3description: Use this skill to query your Google NotebookLM notebooks directly from Claude Code for source-grounded, citation-backed answers from Gemini. Browser automation, library management, persistent auth. Drastically reduced hallucinations through document-only responses.4---56# NotebookLM Research Assistant Skill78Interact with Google NotebookLM to query documentation with Gemini's source-grounded answers. Each question opens a fresh browser session, retrieves the answer exclusively from your uploaded documents, and closes.910## When to Use This Skill1112Trigger when user:13- Mentions NotebookLM explicitly14- Shares NotebookLM URL (`https://notebooklm.google.com/notebook/...`)15- Asks to query their notebooks/documentation16- Wants to add documentation to NotebookLM library17- Uses phrases like "ask my NotebookLM", "check my docs", "query my notebook"1819## ⚠️ CRITICAL: Add Command - Smart Discovery2021When user wants to add a notebook without providing details:2223**SMART ADD (Recommended)**: Query the notebook first to discover its content:24```bash25# Step 1: Query the notebook about its content26python scripts/run.py ask_question.py --question "What is the content of this notebook? What topics are covered? Provide a complete overview briefly and concisely" --notebook-url "[URL]"2728# Step 2: Use the discovered information to add it29python scripts/run.py notebook_manager.py add --url "[URL]" --name "[Based on content]" --description "[Based on content]" --topics "[Based on content]"30```3132**MANUAL ADD**: If user provides all details:33- `--url` - The NotebookLM URL34- `--name` - A descriptive name35- `--description` - What the notebook contains (REQUIRED!)36- `--topics` - Comma-separated topics (REQUIRED!)3738NEVER guess or use generic descriptions! If details missing, use Smart Add to discover them.3940## Critical: Always Use run.py Wrapper4142**NEVER call scripts directly. ALWAYS use `python scripts/run.py [script]`:**4344```bash45# ✅ CORRECT - Always use run.py:46python scripts/run.py auth_manager.py status47python scripts/run.py notebook_manager.py list48python scripts/run.py ask_question.py --question "..."4950# ❌ WRONG - Never call directly:51python scripts/auth_manager.py status # Fails without venv!52```5354The `run.py` wrapper automatically:551. Creates `.venv` if needed562. Installs all dependencies573. Activates environment584. Executes script properly5960## Core Workflow6162### Step 1: Check Authentication Status63```bash64python scripts/run.py auth_manager.py status65```6667If not authenticated, proceed to setup.6869### Step 2: Authenticate (One-Time Setup)70```bash71# Browser MUST be visible for manual Google login72python scripts/run.py auth_manager.py setup73```7475**Important:**76- Browser is VISIBLE for authentication77- Browser window opens automatically78- User must manually log in to Google79- Tell user: "A browser window will open for Google login"8081### Step 3: Manage Notebook Library8283```bash84# List all notebooks85python scripts/run.py notebook_manager.py list8687# BEFORE ADDING: Ask user for metadata if unknown!88# "What does this notebook contain?"89# "What topics should I tag it with?"9091# Add notebook to library (ALL parameters are REQUIRED!)92python scripts/run.py notebook_manager.py add \93 --url "https://notebooklm.google.com/notebook/..." \94 --name "Descriptive Name" \95 --description "What this notebook contains" \ # REQUIRED - ASK USER IF UNKNOWN!96 --topics "topic1,topic2,topic3" # REQUIRED - ASK USER IF UNKNOWN!9798# Search notebooks by topic99python scripts/run.py notebook_manager.py search --query "keyword"100101# Set active notebook102python scripts/run.py notebook_manager.py activate --id notebook-id103104# Remove notebook105python scripts/run.py notebook_manager.py remove --id notebook-id106```107108### Quick Workflow1091. Check library: `python scripts/run.py notebook_manager.py list`1102. Ask question: `python scripts/run.py ask_question.py --question "..." --notebook-id ID`111112### Step 4: Ask Questions113114```bash115# Basic query (uses active notebook if set)116python scripts/run.py ask_question.py --question "Your question here"117118# Query specific notebook119python scripts/run.py ask_question.py --question "..." --notebook-id notebook-id120121# Query with notebook URL directly122python scripts/run.py ask_question.py --question "..." --notebook-url "https://..."123124# Show browser for debugging125python scripts/run.py ask_question.py --question "..." --show-browser126```127128## Follow-Up Mechanism (CRITICAL)129130Every NotebookLM answer ends with: **"EXTREMELY IMPORTANT: Is that ALL you need to know?"**131132**Required Claude Behavior:**1331. **STOP** - Do not immediately respond to user1342. **ANALYZE** - Compare answer to user's original request1353. **IDENTIFY GAPS** - Determine if more information needed1364. **ASK FOLLOW-UP** - If gaps exist, immediately ask:137 ```bash138 python scripts/run.py ask_question.py --question "Follow-up with context..."139 ```1405. **REPEAT** - Continue until information is complete1416. **SYNTHESIZE** - Combine all answers before responding to user142143## Script Reference144145### Authentication Management (`auth_manager.py`)146```bash147python scripts/run.py auth_manager.py setup # Initial setup (browser visible)148python scripts/run.py auth_manager.py status # Check authentication149python scripts/run.py auth_manager.py reauth # Re-authenticate (browser visible)150python scripts/run.py auth_manager.py clear # Clear authentication151```152153### Notebook Management (`notebook_manager.py`)154```bash155python scripts/run.py notebook_manager.py add --url URL --name NAME --description DESC --topics TOPICS156python scripts/run.py notebook_manager.py list157python scripts/run.py notebook_manager.py search --query QUERY158python scripts/run.py notebook_manager.py activate --id ID159python scripts/run.py notebook_manager.py remove --id ID160python scripts/run.py notebook_manager.py stats161```162163### Question Interface (`ask_question.py`)164```bash165python scripts/run.py ask_question.py --question "..." [--notebook-id ID] [--notebook-url URL] [--show-browser]166```167168### Data Cleanup (`cleanup_manager.py`)169```bash170python scripts/run.py cleanup_manager.py # Preview cleanup171python scripts/run.py cleanup_manager.py --confirm # Execute cleanup172python scripts/run.py cleanup_manager.py --preserve-library # Keep notebooks173```174175## Environment Management176177The virtual environment is automatically managed:178- First run creates `.venv` automatically179- Dependencies install automatically180- Chromium browser installs automatically181- Everything isolated in skill directory182183Manual setup (only if automatic fails):184```bash185python -m venv .venv186source .venv/bin/activate # Linux/Mac187pip install -r requirements.txt188python -m patchright install chromium189```190191## Data Storage192193All data stored in `~/.claude/skills/notebooklm/data/`:194- `library.json` - Notebook metadata195- `auth_info.json` - Authentication status196- `browser_state/` - Browser cookies and session197198**Security:** Protected by `.gitignore`, never commit to git.199200## Configuration201202Optional `.env` file in skill directory:203```env204HEADLESS=false # Browser visibility205SHOW_BROWSER=false # Default browser display206STEALTH_ENABLED=true # Human-like behavior207TYPING_WPM_MIN=160 # Typing speed208TYPING_WPM_MAX=240209DEFAULT_NOTEBOOK_ID= # Default notebook210```211212## Decision Flow213214```215User mentions NotebookLM216 ↓217Check auth → python scripts/run.py auth_manager.py status218 ↓219If not authenticated → python scripts/run.py auth_manager.py setup220 ↓221Check/Add notebook → python scripts/run.py notebook_manager.py list/add (with --description)222 ↓223Activate notebook → python scripts/run.py notebook_manager.py activate --id ID224 ↓225Ask question → python scripts/run.py ask_question.py --question "..."226 ↓227See "Is that ALL you need?" → Ask follow-ups until complete228 ↓229Synthesize and respond to user230```231232## Troubleshooting233234| Problem | Solution |235|---------|----------|236| ModuleNotFoundError | Use `run.py` wrapper |237| Authentication fails | Browser must be visible for setup! --show-browser |238| Rate limit (50/day) | Wait or switch Google account |239| Browser crashes | `python scripts/run.py cleanup_manager.py --preserve-library` |240| Notebook not found | Check with `notebook_manager.py list` |241242## Best Practices2432441. **Always use run.py** - Handles environment automatically2452. **Check auth first** - Before any operations2463. **Follow-up questions** - Don't stop at first answer2474. **Browser visible for auth** - Required for manual login2485. **Include context** - Each question is independent2496. **Synthesize answers** - Combine multiple responses250251## Limitations252253- No session persistence (each question = new browser)254- Rate limits on free Google accounts (50 queries/day)255- Manual upload required (user must add docs to NotebookLM)256- Browser overhead (few seconds per question)257258## Resources (Skill Structure)259260**Important directories and files:**261262- `scripts/` - All automation scripts (ask_question.py, notebook_manager.py, etc.)263- `data/` - Local storage for authentication and notebook library264- `references/` - Extended documentation:265 - `api_reference.md` - Detailed API documentation for all scripts266 - `troubleshooting.md` - Common issues and solutions267 - `usage_patterns.md` - Best practices and workflow examples268- `.venv/` - Isolated Python environment (auto-created on first run)269- `.gitignore` - Protects sensitive data from being committed270
Full transparency — inspect the skill content before installing.