background-edit.mdx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ---
  2. title: "Background Edit"
  3. sidebarTitle: "Background Edit"
  4. ---
  5. Background Edit lets Cline make file changes without opening the diff editor, so you can keep writing code while Cline works on other files in the background.
  6. <Note>
  7. This feature is marked as experimental.
  8. </Note>
  9. ## How It Works
  10. By default, Cline opens a side-by-side diff editor tab for each file it modifies. With Background Edit enabled:
  11. - Edits write directly to your files without opening new tabs
  12. - Changes appear as collapsible diff blocks in the chat panel
  13. - Your editor focus stays on whatever file you had open
  14. ## Enabling Background Edit
  15. 1. Click the settings icon (gear) in the top-right corner of the Cline panel
  16. 2. Go to "**Feature Settings**"
  17. 3. Toggle "**Enable Background Edit**" on
  18. ## Viewing Changes
  19. File changes display directly in the chat panel with:
  20. - **File action icons** showing whether the file was added, updated, or deleted
  21. - **Stats** showing additions (+) and deletions (-) at a glance
  22. - **Collapsible diffs** you can expand or collapse by clicking the file header
  23. - **Real-time streaming** as changes appear line-by-line
  24. Green highlights additions, red highlights deletions.
  25. ## When to Use It
  26. This feature works well when you:
  27. - Use [auto-approve mode](/features/auto-approve) and prefer reviewing changes after the fact
  28. - Work on tasks with many small file changes
  29. - Want to stay focused on your current file
  30. Stick with the default diff editor if you prefer reviewing each change before it saves, or need to make inline edits to Cline's proposed changes.
  31. ## Relationship with Other Features
  32. - **Checkpoints**: Still created after each file operation
  33. - **Auto-approve**: Pairs well for uninterrupted workflows
  34. - **Message editing**: Restoring from a previous message works as expected