[BUG] JupyterNotebook new cell constantly inserted at the beginning of a notebook
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
- Open a Jupyter notebook with multiple cells using NotebookEdit
- Use NotebookEdit with
edit_mode="insert"andcell_type="code"without
specifying a cell_id parameter
- 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_idof 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_idshould 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
This issue has 13 comments on GitHub. Read the full discussion on GitHub ↗