agentleFS
teng-linteng-lin/notebooklm-py/CLAUDE.md

notebooklm-py

CLAUDE.md20k starsChanged 3 months agoMITView on GitHub

Guidance for Claude Code working in this repository. Follow conventions in CONTRIBUTING.md. notebooklm-py is an unofficial async Python client for Google NotebookLM, driving Google's internal batchexecute RPC protocol to automate notebooks, sources, chat, and studio artifacts. Critical constraint: Obfuscated RPC method IDs in src/notebooklm/rpc/_identifiers.py are undocumented and Google changes them periodically — the #1 breakage class. rpc/types.py re-exports them for backwards compatibility. See docs/installation.md for the full installation guide. Always install the full extras set (mcp, server, impersonate); omitting them…

Trending

More talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 1 mentionFeb 2026: 0 mentionsMar 2026: 1 mentionApr 2026: 0 mentionsMay 2026: 9 mentionsJun 2026: 7 mentionsJul 2026: 3 mentionsAug 2026: 9 mentionsSep 2026: 3 mentionsOct 2026: 19 mentionsNov 2026: 2 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the teng-lin/notebooklm-py repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about teng-lin/notebooklm-py

The biggest 5 of 54 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 54

Talked about on GitHub, Hacker News and Bluesky (54 times).

On GitHub · 50

45 more on GitHub

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always install the full extras set (mcp, server, impersonate).

    line 28
  2. Very specific:

    Ensure all inline claude[bot] review threads are addressed and resolved before merging.

    line 99

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

Guidance for Claude Code working in this repository. Follow conventions in CONTRIBUTING.md.

Project Overview

notebooklm-py is an unofficial async Python client for Google NotebookLM, driving Google's internal batchexecute RPC protocol to automate notebooks, sources, chat, and studio artifacts.

Critical constraint: Obfuscated RPC method IDs in src/notebooklm/rpc/_identifiers.py are undocumented and Google changes them periodically — the #1 breakage class. rpc/types.py re-exports them for backwards compatibility.

Development Commands

See docs/installation.md for the full installation guide.

# Contributor install (matches CI test jobs):
uv sync --frozen --extra browser --extra dev --extra markdown \
        --extra mcp --extra server --extra impersonate
source .venv/bin/activate
uv run playwright install chromium

uv run pytest                     # all tests (e2e excluded by default)
uv run pytest --cov               # with coverage
uv run pytest tests/e2e -m e2e    # e2e (requires auth)
uv run notebooklm --help          # CLI

Always install the full extras set (mcp, server, impersonate); omitting them causes adapter suites to skip silently, masking errors and failing the 90% coverage threshold.

# Approximate nightly coverage gate:
uv run pytest -n auto --dist loadgroup --cov=src/notebooklm \
  --cov-report=term-missing --cov-fail-under=90

--dist loadgroup is required to honor @pytest.mark.xdist_group. Avoid piping test commands into tail/grep to prevent masking non-zero exit codes.

Before Pushing

CI enforces formatting, linting, type checks, and tests:

uv run ruff check .
uv run ruff format --check .
uv run mypy src/notebooklm scripts/_live_auth_scenarios --ignore-missing-imports
uv run pytest

Architecture

Adapters (cli/, mcp/, server/) → _app/ (business logic) → client.py + _runtime/ → selected backend (_web/ or _android/) → raw.py (rpc/ is Web compatibility facade).

See docs/architecture.md for layered design, call flows, cross-cutting policies (loop affinity, idempotency, schema validation), and the full file map.

Common Pitfalls

  1. RPC method IDs change — re-capture network traffic and update rpc/_identifiers.py.
  2. Position-sensitive nested params — mirror existing shapes; source-id nesting varies ([id] / [[id]] / [[[id]]] / [[[[id]]]]).
  3. CSRF tokens expire — call client.refresh_auth() or re-run notebooklm login.
  4. Rate limiting — add delays between bulk operations.
  5. Concurrency — one NotebookLMClient is bound to its open() event loop: one per thread, never reuse across loops or AuthTokens tenants (see concurrency contract).

Usage

async with NotebookLMClient.from_storage() as client:
    notebooks = await client.notebooks.list()
    await client.sources.add_url(nb_id, url)
    answer = await client.chat.ask(nb_id, question)
    status = await client.artifacts.generate_audio(nb_id)
  • CLI: Top-level commands (login, use, status, list, ask) and groups (source, label, artifact, generate, download, note, mcp, research). Reference: docs/cli-reference.md.
  • MCP Server: Console script notebooklm-mcp exposes _app/ logic over MCP. Install with notebooklm mcp install <client>. Reference: docs/mcp-guide.md.
  • REST Server: Console script notebooklm-server exposes /v1 routes over _app/. Requires NOTEBOOKLM_SERVER_TOKEN. Reference: docs/installation.md#rest-api-server.

Testing

  • Unit: tests/unit/ (offline; includes _app, CLI, server, guardrails).
  • Integration: tests/integration/ (VCR cassette replay matching method, scheme, host, port, path, rpcids, freq). Record with NOTEBOOKLM_VCR_RECORD=1 uv run pytest tests/integration/ -v.
  • E2E: tests/e2e/ (real API, @pytest.mark.e2e, requires auth).
  • Details: docs/development.md.

Documentation Map

Key references in docs/: installation, cli-reference, python-api, architecture, development, mcp-guide, troubleshooting, and adr/.

Pull Request Workflow (required)

Drive PRs to merge:

  1. Poll gh pr checks <PR> until all pass; investigate and fix any failures.
  2. Trigger Claude review by commenting @claude review on the PR.
  3. Address every review comment (gemini-code-assist, coderabbitai, claude[bot]): fix, push, reply on the thread (Addressed in <SHA>: …), and resolve threads.
  4. Merge only when all checks pass, all threads are resolved, and mergeStateStatus is CLEAN.

Note on @claude review:

  • claude[bot] posts a sticky summary issue comment and inline diff comments (gh api /repos/<owner>/<repo>/pulls/<PR>/comments). It does not submit a formal GitHub reviewDecision, so check comments directly.
  • Ensure all inline claude[bot] review threads are addressed and resolved before merging.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.