Very slow session due to 98GB of git snapshots #2109

Open
opened 2026-02-16 17:34:11 -05:00 by yindo · 5 comments
Owner

Originally created by @kanaka on GitHub (Oct 14, 2025).

Originally assigned to: @thdxr on GitHub.

I'm using opencode with sonnet 4.5 (aws bedrock) to make some relatively small changes to a Go program. I've sent it two prompts: one to create an AGENTS.md with guidance for future sessions, and a second to make two smallish changes to the main.go. The process has now been running for 2.5 hours. I looked at my AWS cloudwatch logs for Bedrock and I can see that there are 5-8 minutes between API requests. Then I remembered that I forgot to put a opencode.jsonc in this directory to disable git snapshots (yes, this has happened before). This isn't a particular big repo but it does download a lot of deps (about 1GB) for the go build. Seems like opencode's git snapshotting algorithm isn't very smart about avoiding generated binary files.

Adding an opencode.jsonc to deactivate git snapshots, removing the snapshot data, and restarting the session and the task completed in less than 60 seconds. So something is pessimal with how github snapshots are being handled.

Originally created by @kanaka on GitHub (Oct 14, 2025). Originally assigned to: @thdxr on GitHub. I'm using opencode with sonnet 4.5 (aws bedrock) to make some relatively small changes to a Go program. I've sent it two prompts: one to create an AGENTS.md with guidance for future sessions, and a second to make two smallish changes to the `main.go`. The process has now been running for 2.5 hours. I looked at my AWS cloudwatch logs for Bedrock and I can see that there are 5-8 minutes between API requests. Then I remembered that I forgot to put a `opencode.jsonc` in this directory to disable git snapshots (yes, this has happened before). This isn't a particular big repo but it does download a lot of deps (about 1GB) for the go build. Seems like opencode's git snapshotting algorithm isn't very smart about avoiding generated binary files. Adding an opencode.jsonc to deactivate git snapshots, removing the snapshot data, and restarting the session and the task completed in less than 60 seconds. So something is pessimal with how github snapshots are being handled.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 14, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3176: Reports the same core problem with OpenCode's git snapshotting behavior causing massive performance issues and system instability due to indiscriminate use of 'git add .' without size limits or configuration options
  • #2304: Describes socket connection errors and hangs when operating in directories with .git folders, which could be related to the same underlying git snapshot processing issues
  • #1126: Reports session growth to 88GB due to git snapshot corruption, showing similar massive storage consumption problems with OpenCode's git handling

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 14, 2025): This issue might be a duplicate of existing issues. Please check: - #3176: Reports the same core problem with OpenCode's git snapshotting behavior causing massive performance issues and system instability due to indiscriminate use of 'git add .' without size limits or configuration options - #2304: Describes socket connection errors and hangs when operating in directories with .git folders, which could be related to the same underlying git snapshot processing issues - #1126: Reports session growth to 88GB due to git snapshot corruption, showing similar massive storage consumption problems with OpenCode's git handling Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 14, 2025):

@kanaka we are going to do some major optimizations around this soon, sorry about that

@rekram1-node commented on GitHub (Oct 14, 2025): @kanaka we are going to do some major optimizations around this soon, sorry about that
Author
Owner

@taylorjonl commented on GitHub (Feb 8, 2026):

Do you know when these optimizations around this are going to happen? I am likely going to have to stop using opencode because it just keeps spawning git commands and consuming disk space in my repo. I tried disabling snapshot with this in my config:

{
  "$schema": "https://opencode.ai/config.json",
  "snapshot": false
}

I put this in a file at the root of the repo and at my ~/.config/opencode/opencode.json, but it still just keeps spawning git. I can't even use my computer with opencode running.

@taylorjonl commented on GitHub (Feb 8, 2026): Do you know when these optimizations around this are going to happen? I am likely going to have to stop using opencode because it just keeps spawning git commands and consuming disk space in my repo. I tried disabling snapshot with this in my config: ``` { "$schema": "https://opencode.ai/config.json", "snapshot": false } ``` I put this in a file at the root of the repo and at my ~/.config/opencode/opencode.json, but it still just keeps spawning git. I can't even use my computer with opencode running.
Author
Owner

@itlackey commented on GitHub (Feb 10, 2026):

Snapshots are filling my hard drive to 0% free space. Please add a free space check to the optimizations

@itlackey commented on GitHub (Feb 10, 2026): Snapshots are filling my hard drive to 0% free space. Please add a free space check to the optimizations
Author
Owner

@taylorjonl commented on GitHub (Feb 10, 2026):

I found out that you have to disable snapshots in the config, then you have to delete the snapshots folder cache that opencode has, or it just keeps doing the bad thing.

@taylorjonl commented on GitHub (Feb 10, 2026): I found out that you have to disable snapshots in the config, then you have to delete the snapshots folder cache that opencode has, or it just keeps doing the bad thing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2109