Inline Edit
Targeted AI editing — update a single code cell directly with natural language instructions instead of manually rewriting code.Best for: Small fixes, local refactors, quick adjustments, and improving readability without leaving the cell or opening chat.
How to Use Inline Edit
Focus on the cell
Click inside the cell you want to modify. The cell should be in edit mode (showing the code editor).
Trigger Inline Edit
Press the keyboard shortcut:
- macOS:
⌘ K - Windows/Linux:
Ctrl K

Review and apply
The AI shows you the updated code. You can:
- Accept — apply the change
- Reject — keep the original
- Modify — edit the instruction and try again
The change is applied only to the selected cell. Other cells remain untouched.
Example Workflow
- Example 1: Change Time Period
- Example 2: Add Error Handling
- Example 3: Refactor to List Comprehension
- Example 4: Add Documentation
Original cell:Inline Edit instruction:Updated cell:
Only the time period and comment were updated. Everything else stayed the same.
When to Use Inline Edit
Small fixes
Use for: Typos, parameter changes, simple logic adjustmentsExample: “change timeout from 30 to 60 seconds”
Local refactors
Use for: Renaming variables, converting loops, improving code styleExample: “rename all instances of df to sales_data”
Quick adjustments
Use for: Adding logging, error handling, type hintsExample: “add try-except for API request”
Improving readability
Use for: Adding comments, docstrings, breaking long linesExample: “add comments explaining each step”
Inline Edit vs Chat
- Inline Edit
- Chat (Agent/Hands-On Mode)
Scope: Single cell onlyWhen to use:
- Quick, focused changes
- You know exactly which cell to modify
- The change is self-contained
- You want to stay in the cell editor
- Focus cell
- Press
⌘K/Ctrl K - Describe change
- Accept or reject
Keyboard Shortcuts
Trigger Inline Edit:
- macOS:
⌘ K - Windows/Linux:
Ctrl K
Enter or TabReject suggestion: EscModify instruction: Click the edit icon in the promptTips for Better Results
Be specific about what to change
Be specific about what to change
Good: “rename variable df to customer_data”Bad: “make it better”The more specific your instruction, the more accurate the edit.
Focus on one change at a time
Focus on one change at a time
Good: “add error handling for file not found”Bad: “add error handling, improve variable names, and add comments”For multiple changes, use separate Inline Edits or switch to Chat.
Include context if needed
Include context if needed
Good: “change the date range to last 90 days instead of last year”Better than: “change the date”Mentioning what you’re changing from helps the AI understand the context.
Undo is always available
Undo is always available
Don’t worry about making mistakes. You can:
- Use Jupyter’s undo (
⌘Z/Ctrl Z) - Reject the suggestion before applying
- Re-run the original cell from history
- Use notebook version control
FAQ
What's the difference between Inline Edit and Chat?
What's the difference between Inline Edit and Chat?
Inline Edit updates one cell only. Chat can add, modify, or generate code across multiple cells.Use Inline Edit for focused, single-cell changes. Use Chat for broader modifications or multi-cell workflows.
Can Inline Edit break other cells?
Can Inline Edit break other cells?
No. Inline Edit applies changes only to the selected cell. The rest of your notebook remains untouched.However, if the cell defines variables or functions used elsewhere, changing them could affect downstream cells. Always review the impact.
Do I need to re-run the cell after Inline Edit?
Do I need to re-run the cell after Inline Edit?
Yes. Inline Edit updates the code but doesn’t automatically execute it. You must run the cell to see the new output.This gives you a chance to review the code before execution.
Can I undo an Inline Edit?
Can I undo an Inline Edit?
Yes. You can:
- Use Jupyter’s undo feature (
⌘Z/Ctrl Z) - Access cell history in Jupyter
- Use notebook version control (if enabled)
- Reject the suggestion before applying it
Does Inline Edit use my data?
Does Inline Edit use my data?
Inline Edit only sees the code in the current cell. It doesn’t access:
- Other cells (unless needed for context)
- Kernel state (unless you mention variables)
- External data sources
Can I use Inline Edit in markdown cells?
Can I use Inline Edit in markdown cells?
Currently, Inline Edit works best with code cells. For markdown cells, you can use Chat mode to request edits or edit them manually.
What if the AI doesn't understand my instruction?
What if the AI doesn't understand my instruction?
Try:
- Be more specific: “change the timeout parameter to 60” instead of “make it slower”
- Add context: “in the API request, change the timeout to 60 seconds”
- Use simpler language: “rename x to customer_id” instead of “refactor the variable nomenclature”
- Try again: Click modify and rephrase your instruction