claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Add runtime keyboard shortcuts for permission mode toggling

Open thamam opened this issue 1 year ago • 2 comments

Feature Request: Runtime Keyboard Shortcuts & Permission Mode Toggle

Summary

Add support for customizable keyboard shortcuts in Claude Code interactive sessions, starting with the ability to toggle permission modes during runtime (similar to Gemini CLI).

Proposed Feature

Primary Request: Ctrl+Y keyboard shortcut to toggle between permission modes during an active session

Broader Request: General keyboard shortcut customization framework

Use Case

Currently, permission modes (--permission-mode) must be set at session launch and cannot be changed mid-session. A typical workflow would be:

  1. Start session in safe mode (default) for cautious exploration
  2. Press Ctrl+Y to enter YOLO mode (bypassPermissions) for trusted bulk operations
  3. Press Ctrl+Y again to return to safe mode
  4. Continue working without session restart

Proposed Implementation

1. Runtime Permission Mode Toggle

# During active session:
Ctrl+Y → Toggle between current mode and bypassPermissions

Visual feedback in status line:

  • [SAFE] - Default permission mode
  • [YOLO] - Bypass permissions mode

2. Keyboard Shortcut Configuration

Add to settings.json:

{
  "keyboardShortcuts": {
    "Ctrl+Y": {
      "action": "togglePermissionMode",
      "modes": ["default", "bypassPermissions"]
    },
    "Ctrl+P": {
      "action": "enterPlanMode"
    }
    // ... other customizable shortcuts
  }
}

Benefits

  • No session restarts - Seamless workflow transitions
  • Safety + Speed - Start cautious, switch to fast when appropriate
  • User control - Quick escape from YOLO mode if needed
  • Parity with competitors - Gemini CLI offers runtime mode switching
  • Extensibility - Framework enables future keyboard shortcuts

Alternative Approaches Considered

  1. Slash commands (e.g., /yolo) - Less ergonomic than hotkeys
  2. Shell aliases - Requires session restart
  3. Hooks - Cannot change runtime session state

Additional Context

  • User migrating from Gemini CLI expects this functionality
  • Permission modes: default, acceptEdits, dontAsk, bypassPermissions, plan
  • Status line already exists for visual feedback integration

Priority

High - Quality-of-life improvement for power users with clear competitor precedent


Submitted on behalf of user via Claude Code automation

thamam avatar Nov 18 '25 07:11 thamam

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

github-actions[bot] avatar Dec 18 '25 10:12 github-actions[bot]

Adding another use case for this feature request:

Workflow: Plan Mode -> dontAsk Mode

Currently, Shift+Tab cycles through Normal, Auto-Accept, and Plan modes, but dontAsk mode is excluded from this cycle.

A common workflow would be:

  1. Start session in Plan Mode to safely explore and understand the codebase
  2. Toggle to dontAsk Mode once ready to execute with pre-approved tools only
  3. Return to Plan Mode if needed for further exploration

This provides a balanced approach between full bypass permissions and manual approval for each tool - letting users work efficiently with only their explicitly allowlisted tools while maintaining control.

Would love to see dontAsk added to the Shift+Tab cycle or configurable via a dedicated hotkey.

roccolangeweg avatar Jan 05 '26 13:01 roccolangeweg

would love a direct keybind to jump to dontAsk mode — cycling through modes to get back is annoying when it's my default

NerdyMihir avatar Jan 31 '26 06:01 NerdyMihir

this would be great

nepfaff avatar Feb 16 '26 19:02 nepfaff

I want it, and I like it...

hikidd avatar Feb 25 '26 06:02 hikidd

Use case: Need to toggle permission modes (especially YOLO/bypass) via keybinding without losing session state. Currently no runtime API for this.

I built a plugin attempting to solve this, but realized mid-session permission changes require core support. This is a missing primitive compared to other AI coding tools.

If Anthropic is open to community contributions on core features like this, I'd be happy to help implement it (with guidance on architecture). Totally understand if not - just wanted to offer.

B-A-M-N avatar Apr 27 '26 14:04 B-A-M-N

yes yes yes, it would save a lot of clicking

scottdaniel avatar Jul 02 '26 22:07 scottdaniel

Both halves of this exist now: press Shift+Tab during a session to cycle permission modes (default/manual, accept edits, plan, auto, and bypass when enabled), and keyboard shortcuts are customizable via /keybindings, which creates ~/.claude/keybindings.json (the action is chat:cycleMode, so you can bind it to Ctrl+Y). Docs: https://code.claude.com/docs/en/keybindings and https://code.claude.com/docs/en/permission-modes

🤖 Generated with Claude Code

bcherny avatar Aug 17 '26 03:08 bcherny

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

github-actions[bot] avatar Oct 07 '26 14:10 github-actions[bot]