Theia API Documentation v1.65.0
    Preparing search index...

    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.

    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.

    interface FileEditBackupService {
        cleanUp(request: MutableChatRequestModel): Promise<void>;
        getLocation(workspaceRoot: URI): URI;
        getOriginal(
            workspaceUri: URI,
            sessionId: undefined | string,
        ): Promise<undefined | string>;
    }

    Implemented by

    Index

    Methods

    • 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().

      Parameters

      • workspaceUri: URI

        The URI of the file to get backup content for

      • sessionId: undefined | string

        The Claude session ID used for backup organization

      Returns Promise<undefined | string>

      The original file content, or undefined if no backup exists