diff --git a/src/core/task/Task.ts b/src/core/task/Task.ts index cf16df8dcc..dbb3e07eee 100644 --- a/src/core/task/Task.ts +++ b/src/core/task/Task.ts @@ -1673,6 +1673,14 @@ export class Task extends EventEmitter implements TaskLike { // Kicks off the checkpoints initialization process in the background. getCheckpointService(this) + // Create an initial checkpoint at the very beginning of task execution + // This allows users to completely reset to the initial state before any changes + // Use allowEmpty=true to ensure checkpoint is created even with no file changes + // Use suppressMessage=true to avoid cluttering the UI with this automatic checkpoint + if (this.enableCheckpoints) { + await this.checkpointSave(true, true) + } + let nextUserContent = userContent let includeFileDetails = true