[Feature]: Runtime Permission Mode Toggle (like Claude Code's Shift+Tab) #4816

Open
opened 2026-02-16 17:45:33 -05:00 by yindo · 3 comments
Owner

Originally created by @LEON-gittech on GitHub (Jan 12, 2026).

Originally assigned to: @thdxr on GitHub.

Feature Request: Runtime Permission Mode Toggle

Problem

Currently, OpenCode defaults to auto-edit mode where all file edits execute immediately without confirmation. This is too aggressive for many workflows and can lead to unintended changes.

While permissions can be configured statically in opencode.json, there is no way to toggle between permission modes at runtime without switching agents.

Claude Code solves this elegantly with Shift+Tab cycling through three modes:

  1. Normal - Edits require confirmation
  2. Plan - Read-only analysis, no edits allowed
  3. Auto - Edits execute automatically

Proposed Solution

Add a dedicated keybind (suggest Shift+Tab or configurable) that cycles through permission modes within the current agent:

[Normal Mode] ──Shift+Tab──▶ [Plan Mode] ──Shift+Tab──▶ [Auto Mode]
      ▲                                                      │
      └──────────────────────Shift+Tab───────────────────────┘

Mode behaviors:

Mode edit write bash
Normal ask ask ask (except safe commands)
Plan deny deny deny (read-only commands allowed)
Auto allow allow allow

Current Workaround

Users can create multiple agents with different permissions and use Tab to switch between them:

{
  "agent": {
    "build": {
      "permission": { "edit": "ask" }
    }
  }
}
<!-- ~/.config/opencode/agent/auto.md -->
---
permission:
  edit: allow
  write: allow
---

Problems with this workaround:

  1. Agents have separate conversation contexts
  2. Switching agents feels like starting over
  3. Not intuitive for new users expecting Claude Code behavior
  4. Requires manual configuration

Why This Matters

  1. Safety by Default - New users should not accidentally overwrite files
  2. Workflow Flexibility - Sometimes you want to review changes, sometimes you trust the AI
  3. User Expectations - Claude Code has set the standard for this interaction pattern
  4. Reduced Anxiety - Users can confidently explore knowing they have control

Implementation Suggestion

  1. Add a session-level permission override state
  2. Add keybind permission_mode_cycle (default: shift+tab if not conflicting)
  3. Show current mode in status bar or input area (e.g., [Normal], [Plan], [Auto])
  4. Persist mode preference per session or globally

Visual Indicator

Show the current mode near the input area:

┌─────────────────────────────────────────┐
│ [Normal] │ Type your message...         │
└─────────────────────────────────────────┘

Or in a status line:

build │ claude-sonnet │ Normal Mode

Configuration

Allow users to customize the default mode:

{
  "permission": {
    "defaultMode": "normal"  // "normal" | "plan" | "auto"
  }
}

Related

Note

This is different from the existing agent-switching mechanism. The goal is to change permission behavior within the same agent/session without losing conversation context.

Originally created by @LEON-gittech on GitHub (Jan 12, 2026). Originally assigned to: @thdxr on GitHub. ## Feature Request: Runtime Permission Mode Toggle ### Problem Currently, OpenCode defaults to **auto-edit mode** where all file edits execute immediately without confirmation. This is too aggressive for many workflows and can lead to unintended changes. While permissions can be configured statically in `opencode.json`, there is **no way to toggle between permission modes at runtime** without switching agents. Claude Code solves this elegantly with `Shift+Tab` cycling through three modes: 1. **Normal** - Edits require confirmation 2. **Plan** - Read-only analysis, no edits allowed 3. **Auto** - Edits execute automatically ### Proposed Solution Add a dedicated keybind (suggest `Shift+Tab` or configurable) that cycles through permission modes **within the current agent**: ``` [Normal Mode] ──Shift+Tab──▶ [Plan Mode] ──Shift+Tab──▶ [Auto Mode] ▲ │ └──────────────────────Shift+Tab───────────────────────┘ ``` **Mode behaviors:** | Mode | edit | write | bash | |------|------|-------|------| | Normal | ask | ask | ask (except safe commands) | | Plan | deny | deny | deny (read-only commands allowed) | | Auto | allow | allow | allow | ### Current Workaround Users can create multiple agents with different permissions and use `Tab` to switch between them: ```json { "agent": { "build": { "permission": { "edit": "ask" } } } } ``` ```markdown <!-- ~/.config/opencode/agent/auto.md --> --- permission: edit: allow write: allow --- ``` **Problems with this workaround:** 1. Agents have separate conversation contexts 2. Switching agents feels like starting over 3. Not intuitive for new users expecting Claude Code behavior 4. Requires manual configuration ### Why This Matters 1. **Safety by Default** - New users should not accidentally overwrite files 2. **Workflow Flexibility** - Sometimes you want to review changes, sometimes you trust the AI 3. **User Expectations** - Claude Code has set the standard for this interaction pattern 4. **Reduced Anxiety** - Users can confidently explore knowing they have control ### Implementation Suggestion 1. Add a session-level permission override state 2. Add keybind `permission_mode_cycle` (default: `shift+tab` if not conflicting) 3. Show current mode in status bar or input area (e.g., `[Normal]`, `[Plan]`, `[Auto]`) 4. Persist mode preference per session or globally ### Visual Indicator Show the current mode near the input area: ``` ┌─────────────────────────────────────────┐ │ [Normal] │ Type your message... │ └─────────────────────────────────────────┘ ``` Or in a status line: ``` build │ claude-sonnet │ Normal Mode ``` ### Configuration Allow users to customize the default mode: ```json { "permission": { "defaultMode": "normal" // "normal" | "plan" | "auto" } } ``` ### Related - Current workaround uses agent switching via `Tab` / `Shift+Tab` (agent_cycle keybinds) - Permission system: `packages/opencode/src/permission/` - Claude Code reference: https://docs.anthropic.com/en/docs/claude-code ### Note This is different from the existing agent-switching mechanism. The goal is to change permission behavior **within the same agent/session** without losing conversation context.
Author
Owner

@github-actions[bot] commented on GitHub (Jan 12, 2026):

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

  • #7627: [FEATURE]: switch mode tool - Similar request for ability to switch modes (plan/build) on-the-fly
  • #5963: [FEATURE]: Enabling dynamically changing agents and permissions while running prompt - Request to dynamically change permissions without losing context
  • #1813: Feature Request: Yolo and non-Yolo mode (auto-accept) - Directly references Claude Code's Shift+Tab mode cycling feature as desired behavior
  • #5891: [FEATURE]: Full automation support - Related request for automatic permission handling

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


For keybind-related issues, please also check our pinned keybinds documentation: #4997

@github-actions[bot] commented on GitHub (Jan 12, 2026): This issue might be a duplicate of existing issues. Please check: - #7627: [FEATURE]: switch mode tool - Similar request for ability to switch modes (plan/build) on-the-fly - #5963: [FEATURE]: Enabling dynamically changing agents and permissions while running prompt - Request to dynamically change permissions without losing context - #1813: Feature Request: Yolo and non-Yolo mode (auto-accept) - Directly references Claude Code's Shift+Tab mode cycling feature as desired behavior - #5891: [FEATURE]: Full automation support - Related request for automatic permission handling Feel free to ignore if none of these address your specific case. --- For keybind-related issues, please also check our pinned keybinds documentation: #4997
Author
Owner

@mguttmann commented on GitHub (Jan 17, 2026):

Partial implementation available in PR #9073!

Implemented:

  • Runtime toggle for YOLO/auto-accept mode via Desktop UI
  • Live switching without app restart
  • API endpoints for programmatic control

Not implemented in this PR:

  • Shift+Tab keybind cycling
  • Plan mode (read-only)

The keybind cycling between Normal/Plan/Auto modes could be added as a follow-up enhancement. This PR focuses on the core YOLO mode functionality.

@mguttmann commented on GitHub (Jan 17, 2026): Partial implementation available in PR #9073! **Implemented:** - ✅ Runtime toggle for YOLO/auto-accept mode via Desktop UI - ✅ Live switching without app restart - ✅ API endpoints for programmatic control **Not implemented in this PR:** - ❌ Shift+Tab keybind cycling - ❌ Plan mode (read-only) The keybind cycling between Normal/Plan/Auto modes could be added as a follow-up enhancement. This PR focuses on the core YOLO mode functionality.
Author
Owner

@imehtamav commented on GitHub (Feb 12, 2026):

Agents do retain conversation history within a session -- the problem is that we cannot switch agents when prompted for permission like we can with Claude Code.

Perhaps the issue is that agents and permissions are too tightly coupled, as it does make sense that you cannot switch agents while another agent is still running, but it also makes sense that you would want to switch permission modes while an agent is running.

@imehtamav commented on GitHub (Feb 12, 2026): Agents do retain conversation history within a session -- the problem is that we cannot switch agents when prompted for permission like we can with Claude Code. Perhaps the issue is that agents and permissions are too tightly coupled, as it does make sense that you cannot switch agents while another agent is still running, but it also makes sense that you would want to switch permission modes while an agent is running.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4816