.ipynb files), enabling AI-assisted editing with full cell-level context awareness. This feature was developed in collaboration with Amazon to bring AI coding assistance to data science workflows.
Getting started
Jupyter notebook support is built into Cline — no separate installation is required. You need the Jupyter notebook extension enabled in VS Code. Once you open any.ipynb file, you’ll see AI-assisted buttons appear in your notebook interface.
Toolbar actions
Cline adds three actions to your notebook interface:Generate cell
Creates a new cell with AI assistance, using surrounding cells for context. Click the sparkle icon in the notebook toolbar.
Explain cell
Provides a detailed explanation of what a cell does, including its outputs. Click Explain in any cell’s title bar.
Improve cell
Suggests enhancements to an existing cell — performance, clarity, or error handling. Click Improve in any cell’s title bar.
Generate cell
Click the sparkle icon in the notebook toolbar to generate a new cell with AI assistance. The AI receives context from surrounding cells, so it understands the variables, DataFrames, and imports already in scope. You can reference existing objects in your prompt without re-explaining them. Example prompts:- Be specific about what you want the cell to do
- Reference existing variables by name — the AI can see them in context
- Mention preferred libraries if you have a preference (e.g., “use seaborn” or “use plotly”)
Explain cell
Click Explain in any cell’s title bar to get a detailed explanation of what the cell does. This is useful for:- Revisiting old notebooks you haven’t touched in a while
- Onboarding to a teammate’s analysis
- Understanding complex chained operations like pandas
groupby/mergesequences
- Works best on cells that have been executed, since outputs give additional context
- Works well on cells with complex transformations or unfamiliar library APIs
Improve cell
Click Improve in any cell’s title bar to enhance an existing cell with AI suggestions. Use this to:- Optimize slow pandas operations with vectorized equivalents
- Add error handling and input validation
- Refactor for readability and clarity
- Convert explicit loops to more idiomatic operations
- Mention the aspect you want to improve: performance, readability, error handling
- The AI will explain its changes so you understand what it did
How cell context works
Unlike traditional source files, Jupyter notebooks are JSON documents containing arrays of cells. Each cell has its own type, source content, metadata, execution count, and outputs. When you use a Jupyter command, Cline extracts structured context that includes:- Cell type — code, markdown, or raw
- Source content — the cell’s code or text as an array of lines
- Cell metadata and configuration
- Execution count for code cells
- Outputs — including data, text output, and error traces
JSON structure preservation
Cline is designed to work carefully with the cell JSON structure:- Cell boundaries are kept intact
- Execution counts are preserved
- Cell metadata is maintained
- Outputs remain associated with their source cells
Keyboard shortcuts
You can bind any Jupyter command to a keyboard shortcut for faster access:Open keyboard shortcuts
Press Cmd/Ctrl + K, then Cmd/Ctrl + S to open the VS Code keyboard shortcuts editor.
Search for the command
Search for
cline.jupyterGenerateCell, cline.jupyterExplainCell, or cline.jupyterImproveCell.Limitations
- Notebook support requires the Jupyter notebook extension to be enabled in VS Code
- Cell context extraction depends on VS Code’s notebook API — this feature is not available in JetBrains or the Cline CLI
- Very large notebooks may exceed the context capacity of smaller models; use a model with a larger context window for complex notebooks
Related
- Features Overview — Overview of Cline features
- Models & Providers — Choosing the right model for your workflow
- Auto Approve — Control which file operations Cline can perform without prompting