Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 19, 2026

The Claude agent SDK supports reverting file edits to a previous conversation state via rewindFiles(), but this wasn't exposed in the VS Code integration.

Changes

  • Enabled file checkpointing in Claude session options (enableFileCheckpointing: true)
  • Exposed rewindFiles() methods on both ClaudeCodeSession and ClaudeAgentManager
    • Session-level: rewindFiles(userMessageId, dryRun?)
    • Manager-level: rewindFiles(sessionId, userMessageId, dryRun?)
  • Added test coverage for rewind operations, error cases, and dry-run mode
  • Updated documentation with API details and use cases

Usage

// Revert to a specific message in the conversation
const result = await claudeAgentManager.rewindFiles(
    sessionId,
    userMessageId,
    false // set true for dry-run preview
);

// Returns: { canRewind: boolean, filesChanged?: string[], insertions?: number, deletions?: number, error?: string }

Each user message in a Claude session now serves as a potential restore point. The SDK automatically maintains file backups when checkpointing is enabled.

Note: This provides the API foundation. UI integration (commands, buttons, dialogs) is tracked separately as future work.

Original prompt

The Claude agent SDK has a concept of rolling back edits to a particular point in time. Implement handling of this in the claudeCodeAgent so that I can revert edits with ease


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 19, 2026 18:22
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Co-authored-by: TylerLeonhardt <2644648+TylerLeonhardt@users.noreply.github.com>
Copilot AI changed the title [WIP] Add rollback handling for claudeCodeAgent Add rollback support for Claude agent SDK file edits Jan 19, 2026
Copilot AI requested a review from TylerLeonhardt January 19, 2026 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants