PleasePrompto/notebooklm-skill

Use this skill to enable Claude Code to communicate directly with your Google NotebookLM notebooks. Query your uploaded documents and get source-grounded, citation-backed answers from Gemini. Features browser automation, library management, persistent authentication, and answers exclusively from your own knowledge base.

License:MITLanguage:Python1.9k177

Deep Analysis

Claude Code 与 Google NotebookLM 的直接集成工具,通过浏览器自动化实现源文档驱动的问答。

Recommended

Core Features

源文档问答

直接向 NotebookLM 笔记本提问,获取仅基于上传文档的答案

笔记本管理

保存、列出、选择 NotebookLM 笔记本链接,Claude 自动匹配最相关的库

自动认证

一次性 Google 登录,凭证持久化存储,后续自动使用

浏览器自动化

使用 Patchright 模拟真人操作,自动打开浏览器、填写表单、获取结果

Technical Implementation

Architecture:无状态会话模型 + 浏览器自动化
Execution Flow:
加载 SKILL.md

Claude 读取技能指令和可用命令

解析用户意图

识别是查询、添加笔记本还是管理操作

执行 Python 脚本

调用 ask_question.py 或 notebook_manager.py

启动浏览器

Patchright 打开 Chrome,加载已保存的认证状态

访问 NotebookLM

导航到目标笔记本,模拟真人输入问题

等待 Gemini 响应

监听页面变化,提取综合答案和引用

关闭浏览器

无状态设计,每次查询完立即清理

返回结果

将答案传回 Claude,支持追问机制

Key Components:
Patchright浏览器自动化引擎,Playwright 的反检测分支
Session Storage本地 JSON 文件存储认证状态和笔记本列表
Virtual Environment隔离的 Python 环境,避免依赖冲突
SKILL.mdClaude Code 技能定义文件,声明命令和使用方式
Highlights
  • 源文档驱动:答案仅来自上传文档,大幅减少 AI 幻觉
  • 无状态设计:每次查询独立,保证安全性
  • 自动化认证:一次登录,后续自动使用
  • 比本地 RAG 更简单:5分钟设置,无需向量数据库
Use Cases
  • 查询个人上传的文档知识库
  • 获取带引用的研究答案
  • 避免手动在应用间复制粘贴
  • 需要减少 AI 幻觉的研究任务
Limitations
  • 仅支持本地 Claude Code(不支持 Web UI)
  • 每次查询独立,无跨问题上下文
  • NotebookLM 免费层有速率限制
  • 需要手动上传文档到 NotebookLM
Tech Stack
Python 3.8+Patchright 1.55.2python-dotenvLocal JSON Storage

NotebookLM Claude Code Skill

Let Claude Code chat directly with NotebookLM for source-grounded answers based exclusively on your uploaded documents

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 - answers only from your uploaded documents.


⚠️ Important: Local Claude Code Only

This skill works ONLY with local Claude Code installations, NOT in the web UI.

The web UI runs skills in a sandbox without network access, which this skill requires for browser automation. You must use Claude Code locally on your machine.


The Problem

When you tell Claude Code to "search through my local documentation", here's what happens:

  • Massive token consumption: Searching through documentation means reading multiple files repeatedly
  • Inaccurate retrieval: Searches for keywords, misses context and connections between docs
  • Hallucinations: When it can't find something, it invents plausible-sounding APIs
  • Manual copy-paste: Switching between NotebookLM browser and your editor constantly

The Solution

This Claude Code Skill lets Claude Code chat directly with NotebookLM — Google's source-grounded knowledge base powered by Gemini 2.5 that provides intelligent, synthesized answers exclusively from your uploaded documents.

Your Task → Claude asks NotebookLM → Gemini synthesizes answer → Claude writes correct code

No more copy-paste dance: Claude asks questions directly and gets answers straight back in the CLI.


Why NotebookLM, Not Local RAG?

Approach Token Cost Setup Time Hallucinations Answer Quality
Feed docs to Claude 🔴 Very high Instant Yes - fills gaps Variable retrieval
Web search 🟡 Medium Instant High - unreliable sources Hit or miss
Local RAG 🟡 Medium-High Hours (embeddings, chunking) Medium - retrieval gaps Depends on setup
NotebookLM Skill 🟢 Minimal 5 minutes Minimal - source-grounded only Expert synthesis

What Makes NotebookLM Superior?

  1. Pre-processed by Gemini: Upload docs once, get instant expert knowledge
  2. Natural language Q&A: Not just retrieval — actual understanding and synthesis
  3. Multi-source correlation: Connects information across 50+ documents
  4. Citation-backed: Every answer includes source references
  5. No infrastructure: No vector DBs, embeddings, or chunking strategies needed

Installation

# 1. Create skills directory (if it doesn't exist)
mkdir -p ~/.claude/skills

# 2. Clone this repository
cd ~/.claude/skills
git clone https://github.com/PleasePrompto/notebooklm-skill notebooklm

# 3. That's it! Open Claude Code and say:
"What are my skills?"

When you first use the skill, it automatically:

  • Creates an isolated Python environment (.venv)
  • Installs all dependencies including Google Chrome
  • Sets up browser automation with Chrome (not Chromium) for maximum reliability
  • Everything stays contained in the skill folder

Quick Start

1. Check your skills

"What skills do I have?"

2. Authenticate with Google (one-time)

"Set up NotebookLM authentication"

A Chrome window opens → log in with your Google account

3. Create your knowledge base

Go to notebooklm.google.com → Create notebook → Upload your docs:

  • 📄 PDFs, Google Docs, markdown files
  • 🔗 Websites, GitHub repos
  • 🎥 YouTube videos
  • 📚 Multiple sources per notebook

Share: ⚙️ Share → Anyone with link → Copy

4. Add to your library

"Add this NotebookLM to my library: [your-link]"

5. Start researching

"What does my React docs say about hooks?"

How It Works

This is a Claude Code Skill - a local folder containing instructions and scripts that Claude Code can use when needed.

Architecture

~/.claude/skills/notebooklm/
├── SKILL.md              # Instructions for Claude
├── scripts/              # Python automation scripts
│   ├── ask_question.py   # Query NotebookLM
│   ├── notebook_manager.py # Library management
│   └── auth_manager.py   # Google authentication
├── .venv/                # Isolated Python environment (auto-created)
└── data/                 # Local notebook library

When you mention NotebookLM or send a notebook URL, Claude:

  1. Loads the skill instructions
  2. Runs the appropriate Python script
  3. Opens a browser, asks your question
  4. Returns the answer directly to you
  5. Uses that knowledge to help with your task

Core Features

  • Source-Grounded Responses - NotebookLM significantly reduces hallucinations by answering exclusively from your uploaded documents
  • Direct Integration - No copy-paste between browser and editor. Claude asks and receives answers programmatically
  • Smart Library Management - Save NotebookLM links with tags and descriptions. Claude auto-selects the right notebook
  • Automatic Authentication - One-time Google login, then authentication persists across sessions
  • Self-Contained - Everything runs in the skill folder with an isolated Python environment
  • Human-Like Automation - Uses realistic typing speeds and interaction patterns to avoid detection

Common Commands

What you say What happens
"Set up NotebookLM authentication" Opens Chrome for Google login
"Add [link] to my NotebookLM library" Saves notebook with metadata
"Show my NotebookLM notebooks" Lists all saved notebooks
"Ask my API docs about [topic]" Queries the relevant notebook
"Use the React notebook" Sets active notebook
"Clear NotebookLM data" Fresh start (keeps library)

Technical Details

Core Technology

  • Patchright: Browser automation library (Playwright-based)
  • Python: Implementation language for this skill
  • Stealth techniques: Human-like typing and interaction patterns

Dependencies

  • patchright==1.55.2: Browser automation
  • python-dotenv==1.0.0: Environment configuration
  • Automatically installed in .venv on first use

Data Storage

~/.claude/skills/notebooklm/data/
├── library.json       - Your notebook library with metadata
├── auth_info.json     - Authentication status info
└── browser_state/     - Browser cookies and session data

Session Model

This skill uses a stateless model:

  • Each question opens a fresh browser
  • Asks the question, gets the answer
  • Closes the browser immediately

Limitations

Skill-Specific

  • Local Claude Code only - Does not work in web UI (sandbox restrictions)
  • No session persistence - Each question is independent
  • No follow-up context - Can't reference "the previous answer"

NotebookLM

  • Rate limits - Free tier has daily query limits
  • Manual upload - You must upload docs to NotebookLM first
  • Share requirement - Notebooks must be shared publicly

Troubleshooting

Skill not found

ls ~/.claude/skills/notebooklm/
# Should show: SKILL.md, scripts/, etc.

Authentication issues

Say: "Reset NotebookLM authentication"

Browser crashes

Say: "Clear NotebookLM browser data"


The Bottom Line

Without this skill: NotebookLM in browser → Copy answer → Paste in Claude → Copy next question → Back to browser...

With this skill: Claude researches directly → Gets answers instantly → Writes correct code

Stop the copy-paste dance. Start getting accurate, grounded answers directly in Claude Code.