[FEATURE] Unable to efficiently read large Jupyter notebooks - Request to bring NotebookRead tool back
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:
- Context overflow: Loading a large notebook overwhelms the context window, making it difficult for Claude to focus on relevant sections
- Inefficient navigation: Line numbers don't map meaningfully to notebook structure. I need to manually calculate which lines correspond to which cells or sections
- No structure awareness: The
Readtool doesn't understand notebook semantics (cells, headings, outputs), treating.ipynbfiles as plain text JSON - 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_LENGTHlimits
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:
- Markdown headings (primary use case): Load all cells under a specific heading, similar to JupyterLab's Table of Contents
- Cell ranges: Load cells by index (e.g., cells 5-20)
- Cell IDs: Load a specific cell by its ID
- 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:
- Identify the heading "## Data Preprocessing"
- Use
NotebookReadwithmode="heading"andselector="## Data Preprocessing" - Receive only the cells under that heading (with outputs if requested)
- 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_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗