Checkpoint System
Rewind your workspace to the state before any previous AI prompt.
Checkpoint System
Kiwi Code automatically snapshots your files before each AI prompt. If the AI makes changes you don't like, rewind to any previous state with a single command.
Using Rewind
/rewindA picker opens showing your prompt history. Select a prompt to restore your files to the state before that prompt was sent.
You can also select "Latest Code" to return to the most recent state after rewinding.
Cannot rewind during streaming
Wait for the current AI response to finish before using /rewind.
How It Works
You send a prompt
The runtime snapshots every file the AI is about to modify.
The AI makes changes
Files are created, edited, or deleted as the AI works.
You can rewind
Type /rewind and pick any previous prompt. Your files are restored to how they were before that prompt.
Only files the AI actually touches are tracked — your other files are never modified by rewind.
Example
Prompt 1: "Add authentication middleware"
→ AI creates src/middleware/auth.py and edits src/app.py
Prompt 2: "Add rate limiting"
→ AI creates src/middleware/rate_limit.py and edits src/app.py
/rewind → select "Add rate limiting"
→ src/middleware/rate_limit.py is deleted
→ src/app.py is restored to its state after prompt 1
→ src/middleware/auth.py is untouchedWhat Gets Stored
Checkpoint data is stored per-run at ~/.kiwi/runs/<run_id>/. Each run tracks:
- Snapshots of file contents before each prompt
- Prompt history with timestamps
- File change records (which files were touched per prompt)
Smart Rewind
Rewind is efficient — it only restores the files that actually changed between your current state and the target:
- Moving backwards (prompt 5 → prompt 3): Only reverts files changed in prompts 3–4
- Moving forwards (prompt 3 → prompt 5): Restores to latest, then reverts to target
- Latest Code: Returns to the most recent state of all tracked files
Limitations
| Limitation | Detail |
|---|---|
| Files only | Directories and non-file changes aren't tracked |
| Tracked files only | Only files the AI touched — not all files in your project |
| Per-run | Each conversation has its own checkpoints. Can't rewind across runs |
| No partial restore | /rewind restores all files to the target state at once |
Cleanup
Snapshots accumulate over long sessions. To free disk space:
# Remove checkpoints for a specific run
rm -rf ~/.kiwi/runs/<run_id>/
# Remove all checkpoint data
rm -rf ~/.kiwi/runs/