Skip to main content

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

1

Focus on the cell

Click inside the cell you want to modify. The cell should be in edit mode (showing the code editor).
2

Trigger Inline Edit

Press the keyboard shortcut:
  • macOS: ⌘ K
  • Windows/Linux: Ctrl K
Or click the Inline Edit button in the SignalPilot toolbar.
Inline Edit button in toolbar
3

Type your edit instruction

A prompt appears where you describe the change you want:
Examples:
- "change the loop to a list comprehension"
- "rename variable x to customer_id"
- "add error handling for missing keys"
- "add comments explaining each step"
Be specific about what you want changed. The AI only modifies the current cell.
4

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.
5

Execute the cell

After accepting the edit, run the cell to apply the changes:
  • Shift+Enter to run and advance
  • Ctrl+Enter to run in place
The edit updates the code, but you must execute it to update the output.

Example Workflow

Original cell:
# Download SPY data for last 5 years
spy_data = yf.download('SPY', period='5y')
Inline Edit instruction:
Download last 1 year prices instead
Updated cell:
# Download SPY data for last 1 year
spy_data = yf.download('SPY', period='1y')
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”
For broader changes involving multiple cells, use Chat or Planning instead.

Inline Edit vs Chat

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
Workflow:
  1. Focus cell
  2. Press ⌘K / Ctrl K
  3. Describe change
  4. Accept or reject
Best for: “Change X to Y in this cell”

Keyboard Shortcuts

Trigger Inline Edit:
  • macOS: ⌘ K
  • Windows/Linux: Ctrl K
Accept suggestion: Enter or TabReject suggestion: EscModify instruction: Click the edit icon in the prompt

Tips for Better Results

Good: “rename variable df to customer_data”Bad: “make it better”The more specific your instruction, the more accurate the edit.
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.
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.
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

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.
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.
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.
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
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
And as always, SignalPilot follows a zero data retention policy.
Currently, Inline Edit works best with code cells. For markdown cells, you can use Chat mode to request edits or edit them manually.
Try:
  1. Be more specific: “change the timeout parameter to 60” instead of “make it slower”
  2. Add context: “in the API request, change the timeout to 60 seconds”
  3. Use simpler language: “rename x to customer_id” instead of “refactor the variable nomenclature”
  4. Try again: Click modify and rephrase your instruction
If it still doesn’t work, consider using Chat mode for more complex edits.

Next Steps