Huge number of mystery files in a system folder? #3671

Closed
opened 2026-02-16 17:41:03 -05:00 by yindo · 6 comments
Owner

Originally created by @ariane-emory on GitHub (Dec 19, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

I just noticed that on my system, this folder: /private/var/folders/21/jfcl6xvd31547_0brmr5hgx80000gn/T/ contains 52,000+ subdirectories with names similar to opencode-test-22nlhdyc9rj.

It seems like opencode is generating several thousand of these directories every day.

What are these directories? Why is opencode generating so many of them, and why aren't they collecting instead of being cleaned up?

OpenCode version

1.0.168

Steps to reproduce

  1. Look in directories following a similar naming scheme to the one described to find these opencode-test-* directories.
  2. Observe that there are thousands of them.

Screenshot and/or share link

Image

Operating System

MacOS Sequoia latest

Terminal

No response

Originally created by @ariane-emory on GitHub (Dec 19, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description I just noticed that on my system, this folder: `/private/var/folders/21/jfcl6xvd31547_0brmr5hgx80000gn/T/` contains 52,000+ subdirectories with names similar to `opencode-test-22nlhdyc9rj`. It seems like opencode is generating several thousand of these directories every day. What are these directories? Why is opencode generating so many of them, and why aren't they collecting instead of being cleaned up? ### OpenCode version 1.0.168 ### Steps to reproduce 1. Look in directories following a similar naming scheme to the one described to find these `opencode-test-*` directories. 2. Observe that there are thousands of them. ### Screenshot and/or share link <img width="803" height="1042" alt="Image" src="https://github.com/user-attachments/assets/796a677c-604c-4e31-9b63-021f6a4adb6a" /> ### Operating System MacOS Sequoia latest ### Terminal _No response_
yindo added the bugperf labels 2026-02-16 17:41:03 -05:00
yindo closed this issue 2026-02-16 17:41:03 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 19, 2025):

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

  • #4592: Leftover dot-prefixed temp directory in global node_modules breaks npm -g update on Windows
  • #5734: Subagent sessions accumulate without cleanup option - causes storage bloat and UI clutter
  • #5792: Security Issue: Suspicious Temporary Libraries Loaded by OpenCode Process (also mentions /private/tmp/ temp directory issues)

The core issue appears to be that OpenCode generates temporary directories and files that are not properly cleaned up, accumulating over time and consuming significant disk space. Your observation about 52,000+ opencode-test-* directories aligns with the broader pattern of temp file accumulation reported in these other issues.

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

@github-actions[bot] commented on GitHub (Dec 19, 2025): This issue might be a duplicate of existing issues. Please check: - #4592: Leftover dot-prefixed temp directory in global node_modules breaks npm -g update on Windows - #5734: Subagent sessions accumulate without cleanup option - causes storage bloat and UI clutter - #5792: Security Issue: Suspicious Temporary Libraries Loaded by OpenCode Process (also mentions `/private/tmp/` temp directory issues) The core issue appears to be that OpenCode generates temporary directories and files that are not properly cleaned up, accumulating over time and consuming significant disk space. Your observation about 52,000+ `opencode-test-*` directories aligns with the broader pattern of temp file accumulation reported in these other issues. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Dec 19, 2025):

isnt this just the tests in opencode repo? arent u running tests or somethjng

@rekram1-node commented on GitHub (Dec 19, 2025): isnt this just the tests in opencode repo? arent u running tests or somethjng
Author
Owner

@ariane-emory commented on GitHub (Dec 19, 2025):

@rekram1-node That could definitely be where they're coming from, but why are there so many and why isn't something cleaning them up? Generating 52,000+ files in a handful of days and just leaving them laying around seems like it's a bit much.

@ariane-emory commented on GitHub (Dec 19, 2025): @rekram1-node That could definitely be where they're coming from, but why are there so many and why isn't something cleaning them up? Generating 52,000+ files in a handful of days and just leaving them laying around seems like it's a bit much.
Author
Owner

@rekram1-node commented on GitHub (Dec 19, 2025):

idk ill aee if i have the problem cant speak to ur dev environment or what u do but im fairly confient this isnt an issue w opencode maybe its a local dev issue but shouldnt be a prod one

@rekram1-node commented on GitHub (Dec 19, 2025): idk ill aee if i have the problem cant speak to ur dev environment or what u do but im fairly confient this isnt an issue w opencode maybe its a local dev issue but shouldnt be a prod one
Author
Owner

@rekram1-node commented on GitHub (Dec 19, 2025):

Yeah it's just opencode tests, ig somehting is't being cleaned up

@rekram1-node commented on GitHub (Dec 19, 2025): Yeah it's just opencode tests, ig somehting is't being cleaned up
Author
Owner

@rekram1-node commented on GitHub (Dec 19, 2025):

think this is fix:

https://github.com/sst/opencode/commit/dae0168ed8aec08bf127641604eaaccb9e564683

@rekram1-node commented on GitHub (Dec 19, 2025): think this is fix: https://github.com/sst/opencode/commit/dae0168ed8aec08bf127641604eaaccb9e564683
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3671