[FEATURE] Keyboard shortcut to toggle IDE context sharing
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
When Claude Code is connected to an IDE (VS Code, Cursor, etc.), the current editor selection is automatically sent as context with every prompt. There is no quick way to toggle this on/off during a session.
The only option is the /ide slash command, which requires typing and interrupts flow. I often want IDE context off to avoid sending irrelevant selections, but occasionally need to quickly enable it to reference a specific selection — then disable it again. The /ide command is too slow for this back-and-forth.
This is distinct from the persistence request in #1703 — that issue is about remembering the setting across sessions. This is about rapid runtime toggling within a single session.
Proposed Solution
Add a keybinding action (e.g., app:toggleIdeContext) that can be:
- Bound to a custom keyboard shortcut via
~/.claude/keybindings.json - Assigned a sensible default (e.g.,
Ctrl+IorMeta+I)
Example keybinding config:
[
{
"key": "ctrl+i",
"action": "app:toggleIdeContext"
}
]
A brief status indicator in the TUI (e.g., "IDE: on/off") would also help confirm the current state.
Alternative Solutions
- Currently using
/ideto toggle, but it requires typing and breaks flow mid-conversation - Could disconnect the IDE entirely, but then lose the ability to send selections when needed
- No existing keybinding action covers this — checked
~/.claude/keybindings.jsonavailable actions
Priority
Medium - Would be very helpful
Feature Category
Interactive mode (TUI)
Use Case Example
- I'm working in VS Code with Claude Code in the integrated terminal
- I have some code selected in the editor, but I want to ask an unrelated question — the selection context is noise
- I press
Ctrl+Ito toggle IDE context off, send my prompt - Next, I select a specific function and want Claude to review it — I press
Ctrl+Ito toggle back on - This takes <1 second vs typing
/ideand selecting options each time
Additional Context
- Affects both VS Code integrated terminal and standalone terminals (e.g., iTerm2) that auto-connect to the IDE
- Related issues: #1703 (persistence), #26285 (frequent disconnections making
/ideeven more painful)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗