An agent fixes search. It edits src/search.ts with a file tool, creates search-report.txt from the terminal, and posts a comment on a pull request. You open the rewind menu and want to return to the state before that request. The conversation, the files, the Git state, and the comment live in different places. Start by asking which of those states the agent can restore.
The working directory determines where the file lands
The harness starts a command as a process in its execution environment. The relative path search-report.txt resolves from that process’s working directory. In a local checkout, pwd shows the directory and git status --short shows the state of the tree. Plain git diff shows tracked differences between the working tree and the index. Use git diff --cached for staged changes. A new report file appears in git status even before it shows up in a diff, provided Git does not ignore it. git diff reference · git status reference
Two agents editing one directory both see the current file contents. With two Git worktrees, each can have its own files, HEAD, and index, while Git objects are shared. This gives workers separate working trees. The execution environment still determines whether a process can reach the sibling checkout or the network. Git worktrees
What a checkpoint captures
Claude Code creates a checkpoint before a user message that starts a turn. Its /rewind menu can restore the conversation, tracked file changes, or both. In this example, the edit to src/search.ts through the file tool is covered by code restoration. If only Bash created search-report.txt and Claude Code had never tracked it, the report stays on disk. The documentation also explains that a checkpoint can restore edits made through Bash to a file that is already tracked. Checkpoint behavior and limits
Git keeps a separate record of commits and index state. The Claude Code menu works with the conversation and file snapshots, so use Git to inspect the branch history. The comment lives on GitHub. Changing it takes a separate GitHub action with its own permissions.
When handing the task to another agent, record which state it needs. A reviewer normally needs a specific patch version and the path to its working tree. Continuing the conversation requires the session. Restoring an external system requires a record of the actions already performed there.