[BUG] JupyterNotebook new cell constantly inserted at the beginning of a notebook

Resolved 💬 13 comments Opened Jul 28, 2025 by lit-af Closed Jan 5, 2026

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: <!-- output of claude --version -->
  • Operating System: Linux 6.8.0-64-generic
  • Terminal: <!-- e.g. iTerm2, Terminal App -->

## Bug Description
The NotebookEdit tool with edit_mode="insert" inserts cells at the beginning of
the notebook instead of at the end when no cell_id is specified, contrary to
expected behavior.

## Steps to Reproduce

  1. Open a Jupyter notebook with multiple cells using NotebookEdit
  2. Use NotebookEdit with edit_mode="insert" and cell_type="code" without

specifying a cell_id parameter

  1. Observe where the new cell is inserted

## Expected Behavior
When using edit_mode="insert" without specifying a cell_id, the new cell
should be inserted at the end of the notebook (as the last cell).

## Actual Behavior
The new cell is inserted at the beginning of the notebook (as the first cell)
instead of at the end.

## Additional Context

  • Workaround: Must specify the cell_id of the last cell to insert after it
  • This affects user experience when trying to add cells to the end of notebooks

during analysis workflows

  • The tool documentation suggests that omitting cell_id should insert at the

beginning, but user expectation is that "insert" without position means "append to
end"

Duplicate of: https://github.com/anthropics/claude-code/issues/2925

View original on GitHub ↗

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