Notebook Edit - Claude Code
Modify Jupyter notebook cells directly without touching JSON.
Notebook Edit lets Claude modify .ipynb files as cells, not as raw JSON. It understands the notebook format so edits don't corrupt the file.
What it does
The tool targets a specific cell by ID or index, replaces its source, or inserts a new cell. It preserves outputs, metadata, and cell types (code, markdown, raw) unless you explicitly overwrite them. This is how Claude works in data science projects without breaking the notebook on save.
When to use it
- Editing existing
.ipynbfiles in data science, ML, or analysis repos. - Adding a new cell to an exploratory notebook.
- Cleaning up a notebook before committing.
- Any task where hand-editing JSON would be error-prone.
Gotchas
- Cell IDs are the most stable reference. Index-based edits break if cells are reordered.
- Outputs don't get cleared automatically - use a separate step if you want a clean notebook.
- Large output blobs stay in context when Claude reads the notebook. Clear outputs first for cheaper reads.
Official docs: https://code.claude.com/docs/en/tools-reference.md
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
Was this helpful?




