[FEATURE] Include notebook cell ID in IDE selection context for Jupyter notebooks
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
When working with Jupyter notebooks in VS Code, the ide_selection context provides the selected code content and line numbers, but does not include the notebook cell_id. Since the NotebookEdit tool requires a cell_id to target a specific cell, Claude must read the entire notebook file or run a script to match the selected content against cells and find the corresponding ID before making any edit.
This adds unnecessary overhead to every notebook edit operation that originates from a user selection.
Proposed Solution
Include the cell_id (and optionally cell_type) in the ide_selection context when the selection comes from a Jupyter notebook cell. For example:
<ide_selection cell_id="76f7be6b" cell_type="code">
The user selected lines 3 to 5 from /path/to/notebook.ipynb:
x = symbols('x')
f = 2*x + 1
plot(f)
</ide_selection>
This would allow Claude to directly use NotebookEdit with the correct cell_id without any file reading or lookup step.
Alternatives Considered
- Read the full notebook file to find the cell ID by matching content — works but is slow and wasteful, especially for large notebooks.
- Run a Python script to search for the cell ID — lighter, but still an extra step for every edit.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗