Cleans up backup files for a completed chat session.
This method removes the backup directory structure for the given session from all workspaces that have change set elements.
The chat request model containing session and change set information
Retrieves the original content of a file from its backup.
This method reads from backup files created by the file backup hooks that are installed by ClaudeCodeServiceImpl.ensureFileBackupHook().
The URI of the file to get backup content for
The Claude session ID used for backup organization
The original file content, or undefined if no backup exists
Service for managing file backup operations during Claude Code edit sessions.
This service handles the retrieval of original file content from backup files created by the file backup hooks in ClaudeCodeServiceImpl. The backup hooks run before file modification tools (Write, Edit, MultiEdit) and create backups in the
.claude/.edit-baks/{session_id}/
directory structure.See
packages/ai-claude-code/src/node/claude-code-service-impl.ts#ensureFileBackupHook The coupling with the backup hooks is intentional - this service reads from the same backup location that the hooks write to.