[Bug]: opencode overwriting files on startup #2083

Closed
opened 2026-02-16 17:34:05 -05:00 by yindo · 1 comment
Owner

Originally created by @malhashemi on GitHub (Oct 13, 2025).

Originally assigned to: @thdxr on GitHub.

Version: v0.15.0
Change introduced: “Ensured @opencode-ai/plugin is available in .opencode folder”


Description

Since v0.15.0, every time opencode starts it automatically overwrites several key project files, including:
• package.json
• bun.lock
• .gitignore

This happens even when these files already exist and contain valid project-specific dependencies or settings.

I understand the intent might be to ensure consistency within .opencode, but in practice it’s replacing the project’s own configuration each time.


Impact

I have multiple tools and plugins that rely on custom Bun dependencies.
With this new behavior, I have to revert those file change every single time I start opencode.

Questions

  1. Is this the intended behavior?
  2. Should I now have a dedicated package.json inside each tool/plugin directory to prevent opencode from touching the root files?

Expected Behavior

opencode should respect existing project configuration files and only modify them when explicitly needed — not overwrite them on startup.


Environment

  • opencode: v0.15.0
  • Runtime: Bun
Originally created by @malhashemi on GitHub (Oct 13, 2025). Originally assigned to: @thdxr on GitHub. Version: v0.15.0 Change introduced: “Ensured @opencode-ai/plugin is available in .opencode folder” --- ### Description Since v0.15.0, every time opencode starts it automatically overwrites several key project files, including: • package.json • bun.lock • .gitignore This happens even when these files already exist and contain valid project-specific dependencies or settings. I understand the intent might be to ensure consistency within .opencode, but in practice it’s replacing the project’s own configuration each time. --- ### Impact I have multiple tools and plugins that rely on custom Bun dependencies. With this new behavior, I have to revert those file change every single time I start opencode. ### Questions 1. Is this the intended behavior? 2. Should I now have a dedicated package.json inside each tool/plugin directory to prevent opencode from touching the root files? --- ### Expected Behavior opencode should respect existing project configuration files and only modify them when explicitly needed — not overwrite them on startup. --- Environment - opencode: v0.15.0 - Runtime: Bun
yindo closed this issue 2026-02-16 17:34:05 -05:00
Author
Owner

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

yeah we need to fix this

This is a duplicate of: #3109

@rekram1-node commented on GitHub (Oct 13, 2025): yeah we need to fix this This is a duplicate of: #3109
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2083