Skip to content

Commit 544315d

Browse files
docs: add describe annotation to snapshot config field (#17861)
Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
1 parent f13da80 commit 544315d

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

packages/opencode/src/config/config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,12 @@ export namespace Config {
10521052
})
10531053
.optional(),
10541054
plugin: z.string().array().optional(),
1055-
snapshot: z.boolean().optional(),
1055+
snapshot: z
1056+
.boolean()
1057+
.optional()
1058+
.describe(
1059+
"Enable or disable snapshot tracking. When false, filesystem snapshots are not recorded and undoing or reverting will not undo/redo file changes. Defaults to true.",
1060+
),
10561061
share: z
10571062
.enum(["manual", "auto", "disabled"])
10581063
.optional()

packages/web/src/content/docs/config.mdx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,23 @@ Customize keybinds in `tui.json`.
424424

425425
---
426426

427+
### Snapshot
428+
429+
OpenCode uses snapshots to track file changes during agent operations, enabling you to undo and revert changes within a session. Snapshots are enabled by default.
430+
431+
For large repositories or projects with many submodules, the snapshot system can cause slow indexing and significant disk usage as it tracks all changes using an internal git repository. You can disable snapshots using the `snapshot` option.
432+
433+
```json title="opencode.json"
434+
{
435+
"$schema": "https://opencode.ai/config.json",
436+
"snapshot": false
437+
}
438+
```
439+
440+
Note that disabling snapshots means changes made by the agent cannot be rolled back through the UI.
441+
442+
---
443+
427444
### Autoupdate
428445

429446
OpenCode will automatically download any new updates when it starts up. You can disable this with the `autoupdate` option.

0 commit comments

Comments
 (0)