Skip to content

Feature Request: Add "ask before editing files" mode #935

Open
@andreimaxim

Description

@andreimaxim

I know this might be controversial, since most people seem to give AI agents a set of task and let them figure it out, but here it goes...

The codebases I work in tend to have a lot of legacy code (I frequently edit code that was written 7+ years) and I need to be very strategic about the changes I make. AI agents, especially Claude, tend to edit a lot of code and often their style does not match the one in the codebase, so just looking at the final version of the code means I will have a lot of code to edit. So I tend to use Claude Code a lot in its normal mode because Claude will show me a diff before editing a file, which I can reject and explain what to do better, and the AI agent starts to pick up on what I want so the next files tend to be closed to what I want.

A couple of days ago, opencode added custom modes, which allow you to customize what model you're using and what they're allowed to do. Unfortunately, the settings are boolean, meaning they are either enabled or disabled.

What I'd like to suggest is to switch to "allow", "deny", and "ask" instead of boolean values (so basically add a third mode). A sample configuration would look like this:

{
  "mode": {
    "readonly": {
      "tools": {
        "write": "ask",
        "edit": "ask",
        "bash": "allow",
        "read": "allow",
        "grep": "allow",
        "glob": "allow"
      }
    }
  }
}

When the value is "ask" and opencode would add or edit a file, it should show the diff and ask before applying the changes.

As I said above, I understand this might be controversial and could be rejected, but I thought it's worth asking for it and maybe it could appear down the line.

Thank you for the awesome project!

Metadata

Metadata

Assignees

No one assigned

    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