Skip to content

[Bug]: opencode overwriting files on startup #3145

Closed as duplicate
Closed as duplicate

Description

@malhashemi

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

Activity

  1. rekram1-node commented on Oct 13, 2025

    @rekram1-node
    Collaborator

    yeah we need to fix this

    This is a duplicate of: #3109

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions