Skip to content

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

Closed

Description

@LEON-gittech

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.

Activity

  1. github-actions commented on Jan 12, 2026

    @github-actions
    Contributor

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

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


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

  2. mguttmann commented on Jan 17, 2026

    @mguttmann

    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.

  3. imehtamav commented on Feb 12, 2026

    @imehtamav

    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.

  4. github-actions commented on Apr 14, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

  5. HomuraTokido commented on Jun 18, 2026

    @HomuraTokido

    Still no way to toggle permissions at runtime in Desktop/TUI. The /yolo\ slash command PRs (#27851, #27855, #9073, #11833) all died. Either a slash command or a Shift+Tab style mode toggle would solve this. Is this on the roadmap?

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