Skip to content
BENIBIX Learn

NotebookEdit Tool

AI⌨️ Claude CodeBuilt-in Tools

Also known as NotebookEdit, Jupyter notebook edit, cell_id

The tool that changes one cell in a notebook.

Think of it like

It is like fixing one box on a page. The rest stays the same.

Example

Emma asks Claude to fix a chart in her notebook. It replaces that one cell, and she runs it again to see the new chart.

Why it matters

Notebooks are not plain text files, so they need a tool that knows about cells.

Definition

The NotebookEdit tool changes a Jupyter notebook one cell at a time. It finds a cell by its id. It can replace a cell, add a new cell after it, or delete it. When it replaces a code cell, the saved output of that cell is cleared, so you run the cell again to see it. Its permission rules use the same path form as Edit.

Example code

json
{"permissions": {"allow": ["Edit(notebooks/**)"]}}
An Edit rule covers notebook edits too.
NotebookEdit works on cells, not lines.

Common mistake

Expecting the old output to stay. A replaced code cell loses its saved output until you run it again.

Key takeaways

  1. 1
    One cell. By its id.
  2. 2
    Three moves. Replace, insert, delete.
  3. 3
    Output cleared. Run it again.

Learn it properly