# enableFileCheckpointing Option

> The option that lets you put files back the way they were.

**Field:** Artificial Intelligence  
**Category:** Claude Agent SDK  
**Also known as:** rewindFiles, Agent SDK file checkpointing, Claude Agent SDK enableFileCheckpointing

## Think of it like

It is like going back to a saved page in a game.

## Definition

enableFileCheckpointing is the Agent SDK option that backs up files before the agent changes them, so you can roll them back. It covers the Write, Edit and NotebookEdit tools, not shell commands. Each prompt is a checkpoint, named by its message ID. Pass that ID to rewindFiles to put the files back. The chat stays as it is.

## Example

Mia's agent rewrote a module badly. She calls rewindFiles with the ID of the prompt before it, and the old files come back.

## Why it matters

Agents make wrong edits, and an undo for files makes it safe to let them try.

## Common mistake

Expecting it to undo a shell command. Changes made through Bash are not tracked.

## Three principles

- **Backs up before edits.** Write, Edit, NotebookEdit.
- **Not shell commands.** Bash is untracked.
- **Files, not chat.** Chat stays.

## Related terms

- [Claude Code Checkpoint](https://learn.benibix.com/term/ai/claude-code-checkpoint)
- [forkSession Option](https://learn.benibix.com/term/ai/fork-session-option)
- [CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING](https://learn.benibix.com/term/ai/claude-code-disable-file-checkpointing-variable)

## Told apart from

- [forkSession vs enableFileCheckpointing](https://learn.benibix.com/compare/fork-session-option-vs-file-checkpointing-option): People think forking a session also copies the files, and it does not. forkSession copies the chat into a new session with its own ID. That lets you try a second idea. A file the fork edits is changed for real, for each session in that folder. File checkpoints are what back files up, so the edits can be rolled back.

---

Source: https://learn.benibix.com/term/ai/file-checkpointing-option
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
