[FEATURE] Unable to efficiently read large Jupyter notebooks - Request to bring NotebookRead tool back

Resolved 💬 5 comments Opened Oct 12, 2025 by duyangzhou Closed Feb 1, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I frequently work with large Jupyter notebooks (6000+ lines) that contain multiple analysis sections organized by markdown headings. Currently, Claude Code uses the Read tool with line-based offset and limit parameters to read notebook files, which creates several problems:

  1. Context overflow: Loading a large notebook overwhelms the context window, making it difficult for Claude to focus on relevant sections
  2. Inefficient navigation: Line numbers don't map meaningfully to notebook structure. I need to manually calculate which lines correspond to which cells or sections
  3. No structure awareness: The Read tool doesn't understand notebook semantics (cells, headings, outputs), treating .ipynb files as plain text JSON
  4. Time-consuming workarounds: I currently use custom bash scripts to parse notebooks and extract specific cells/sections into STDOUT, which is fragile and requires managing BASH_MAX_OUTPUT_LENGTH limits

My workflow: When analyzing notebooks, I typically want to:

  • Jump to a specific analysis section (e.g., "Data Preprocessing" or "Model Evaluation")
  • Review all cells under that heading
  • Iterate on code in that section without loading unrelated parts of the notebook

This mirrors how I work in JupyterLab using the Table of Contents panel to navigate between sections (https://jupyterlab.readthedocs.io/en/stable/user/toc.html).

Note: The Claude Code's official documentation still references a NotebookRead tool (https://docs.claude.com/en/docs/claude-code/settings#tools-available-to-claude), but this tool no longer exists in the current version.

Proposed Solution

Reintroduce a NotebookRead tool that understands Jupyter notebook structure and supports selective cell loading based on:

  1. Markdown headings (primary use case): Load all cells under a specific heading, similar to JupyterLab's Table of Contents
  2. Cell ranges: Load cells by index (e.g., cells 5-20)
  3. Cell IDs: Load a specific cell by its ID
  4. Full notebook: Load everything when needed
Ideal User Experience

When I ask Claude Code to "review the data preprocessing section in my notebook," Claude would:

  1. Identify the heading "## Data Preprocessing"
  2. Use NotebookRead with mode="heading" and selector="## Data Preprocessing"
  3. Receive only the cells under that heading (with outputs if requested)
  4. Analyze that section without context pollution from unrelated notebook content
Suggested Tool Interface
{
  name: "NotebookRead",
  description: "Read specific sections from Jupyter notebooks by heading, cell ID, or cell range. Optimized for selective loading.",
  parameters: {
    notebook_path: {
      type: "string",
      description: "Absolute path to .ipynb file",
      required: true
    },
    mode: {
      type: "string",
      enum: ["heading", "cell_id", "cell_range", "full"],
      description: "Selection mode for reading cells",
      required: true
    },
    selector: {
      type: "string",
      description: "Heading text (mode=heading), cell ID (mode=cell_id), or range like '42:66' (mode=cell_range). Omit for mode=full.",
      required: false
    },
    include_outputs: {
      type: "boolean",
      description: "Include cell execution outputs",
      default: true
    }
  }
}

Alternative Solutions

_No response_

Priority

Medium - Would be very helpful

Feature Category

CLI commands and flags

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗