|
| 1 | +--- |
| 2 | +title: "Checkpoints and Messages" |
| 3 | +description: "When working with AI coding assistants, it's easy to lose control as they make rapid changes to your codebase. That's why we built Checkpoints - your safety net for experimenting confidently." |
| 4 | +--- |
| 5 | + |
| 6 | +Checkpoints automatically save snapshots of your workspace after each step in a task. This powerful feature lets you: |
| 7 | + |
| 8 | +- Track and review changes made during a task |
| 9 | +- Roll back to any previous point if needed |
| 10 | +- Experiment confidently with auto-approve mode |
| 11 | +- Maintain full control over your workspace |
| 12 | + |
| 13 | +### ⚙️ How Checkpoints Work |
| 14 | + |
| 15 | +Cline creates a checkpoint after each tool use (file edits, commands, etc.). These checkpoints: |
| 16 | + |
| 17 | +- Work alongside your Git workflow without interference |
| 18 | +- Maintain context between restores |
| 19 | +- Use a shadow Git repository to track changes |
| 20 | + |
| 21 | +For example, if you're working on a feature and Cline makes multiple file changes, each change creates a checkpoint. This means you can review each modification and, if needed, roll back to any point without affecting your main Git repository. |
| 22 | + |
| 23 | +#### Viewing Changes & Restoring to Checkpoint |
| 24 | + |
| 25 | +After each tool use, you can: |
| 26 | + |
| 27 | +1. Click the "Compare" button to see modified files |
| 28 | +2. Click the "Restore" button to open restore options |
| 29 | + |
| 30 | +<Frame> |
| 31 | + <img src="/assets/robot_panel_dark.png" alt="Checkpoint comparison and restore options" /> |
| 32 | +</Frame> |
| 33 | + |
| 34 | +#### Rolling Back |
| 35 | + |
| 36 | +To restore to a previous point: |
| 37 | + |
| 38 | +1. Click the "Restore" button next to any step |
| 39 | +2. Choose from three options: |
| 40 | + - **Restore Task and Workspace**: Reset both codebase and task to that point |
| 41 | + - **Restore Task Only**: Keep codebase changes but revert task context |
| 42 | + - **Restore Workspace Only**: Reset codebase while preserving task context |
| 43 | + |
| 44 | +Example: If Cline makes changes you don't like while styling a component, you can use "Restore Workspace Only" to revert the code changes while keeping the conversation context, allowing you to try a different approach. |
| 45 | + |
| 46 | +### 💡 Use Cases |
| 47 | + |
| 48 | +Checkpoints let you be more experimental with Cline. While human coding is often methodical and iterative, AI can make substantial changes quickly. Checkpoints help you track these changes and revert if needed. |
| 49 | + |
| 50 | +#### 1. Using Auto-Approve Mode |
| 51 | + |
| 52 | +- Provides safety net for rapid iterations |
| 53 | +- Makes it easy to undo unexpected results |
| 54 | + |
| 55 | +#### 2. Testing Different Approaches |
| 56 | + |
| 57 | +- Try multiple solutions confidently |
| 58 | +- Compare different implementations |
| 59 | +- Quickly revert to working states |
| 60 | +- Ideal for exploring different design patterns or architectural approaches |
| 61 | + |
| 62 | +<Frame caption="In this case, I didn't like the changes Cline made to my robot dog-walking website (still working on the robots) and I wanted to revert both the codebase and the task to before any changes were made so I could start fresh."> |
| 63 | + <img src="/assets/robot_panel_dark.png" alt="Checkpoint restore demo" /> |
| 64 | +</Frame> |
| 65 | + |
| 66 | +### ✨ Best Practices |
| 67 | + |
| 68 | +1. Use checkpoints as safety nets when experimenting |
| 69 | +2. Leverage auto-approve mode more confidently, knowing you can always roll back |
| 70 | +3. Restore selectively based on needs: |
| 71 | + |
| 72 | + - Use "Restore Task and Workspace" for a fresh start, reversing changes to files and the task conversation. |
| 73 | + - Use "Restore Task Only" to try different prompts, but leave all files as they exist |
| 74 | + - Use "Restore Workspace Only" to attempt different implementations, or prune context from the task |
| 75 | + |
| 76 | +🛟 Checkpoints are your safety net when working with Cline, enabling you to experiment freely while maintaining full control over your codebase. Whether you're refactoring a complex component, trying different implementation approaches, or using auto-approve mode for rapid development, checkpoints ensure you can always review changes and roll back if needed. |
| 77 | + |
| 78 | +#### 🗑️ Deleting Checkpoints |
| 79 | + |
| 80 | +You can delete all checkpoints by using the **"Delete All History"** button in the task history menu. Note that this will also delete all tasks. Checkpoints are stored in VS Code's globalStorage. |
| 81 | + |
| 82 | +--- |
| 83 | + |
| 84 | +## Editing Messages |
| 85 | + |
| 86 | +Cline allows you to edit chat messages in a task after they've been submitted (with the exception of the message that started the task). |
| 87 | + |
| 88 | +Perhaps you didn't get the results you wanted, thought of a better way to phrase your request, or need to add more information. Editing your message allows you to re-submit a request without starting over or restoring your files or workspace with checkpoints. There are two Restore options: |
| 89 | + |
| 90 | +- **"Restore Chat"** restores just the task state and re-submits an API request to your provider with your edited message. |
| 91 | + |
| 92 | +- **"Restore All"** restores both the task state and workspace state before re-submitting an API request. "Workspace state" refers to the condition of your workspace (files, content, etc.) at different points in the conversation. |
| 93 | + |
| 94 | +**Interactive Editing:** |
| 95 | + |
| 96 | +- Messages can be clicked to enter edit mode |
| 97 | +- Cline automatically selects all text when entering edit mode |
| 98 | + |
| 99 | +**Keyboard Shortcuts:** |
| 100 | + |
| 101 | +- Escape: Exit edit mode |
| 102 | +- Enter: Restore just the task |
| 103 | +- Cmd/Ctrl + Enter: Restore the task and workspace |
| 104 | +- Shift + Enter: Insert new line / line break |
| 105 | + |
| 106 | +<Frame> |
| 107 | + <img src="/assets/robot_panel_dark.png" alt="Message editing interface" /> |
| 108 | +</Frame> |
0 commit comments