[FEATURE] Expose AgentView as a rebindable context in keybindings.json (attach / detach actions)
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
In the new agent view (claude agents), attaching to a session is hardcoded to Enter / →, and detaching is hardcoded to ← on an empty prompt. For users who live in vim/neovim and keep their hands on the home row, reaching for the arrow keys breaks flow every time they switch between sessions.
The keybindings.json mechanism already exists and supports rebinding for many contexts (Chat, Select, Tabs, Footer, MessageSelector, etc.), but the keybindings docs list no AgentView context, and the agent view docs note that shortcuts are hardcoded ("interface and keyboard shortcuts may change as the feature evolves"). So there is currently no supported way to remap attach/detach to a home-row-friendly chord like Ctrl+F / Ctrl+B.
Proposed Solution
Add AgentView to the list of supported contexts in ~/.claude/keybindings.json, and expose at least the following actions:
| Action | Current default | Notes |
| :----------------------------- | :----------------------- | :------------------------------------------ |
| agentView:selectPrevious | Up | Move selection up between rows |
| agentView:selectNext | Down | Move selection down between rows |
| agentView:attach | Enter, Right | Attach to the selected session |
| agentView:detach | Left (on empty input) | Detach back to the table |
| agentView:peekToggle | Space | Open/close peek panel |
| agentView:dispatchAndAttach | Shift+Enter | Dispatch and immediately attach |
| agentView:stop | Ctrl+X | Stop / delete session |
| agentView:pin | Ctrl+T | Pin/unpin |
| agentView:rename | Ctrl+R | Rename session |
| agentView:groupToggle | Ctrl+S | Toggle grouping by state/directory |
| agentView:reorderUp / Down | Shift+Up / Shift+Down| Reorder within group |
This would let users write, for example:
{
"context": "AgentView",
"bindings": {
"ctrl+f": "agentView:attach",
"ctrl+b": "agentView:detach",
"j": "agentView:selectNext",
"k": "agentView:selectPrevious"
}
}
Alternative Solutions
- OS-level remap (
keyd,xremap,kanata) to translateCtrl+F/Ctrl+BintoEnter/Leftsystem-wide. Works, but pollutes every other application (bash readline forward-char, tmux prefix, etc.), and is fragile. - Terminal-emulator-level keymap. Same downsides, narrower scope.
- Neither is a real substitute for first-class support, since the action name (
agentView:attach) carries meaning that a raw keystroke remap cannot.
Priority
High - Significant impact on productivity
Feature Category
Interactive mode (TUI)
Use Case Example
I run Claude Code inside neovim + tmux on Arch Linux. With several background agents in the agent view, I'm constantly switching between attaching to one, reading its peek panel, replying, and detaching. The arrow-key trip from the home row happens dozens of times per hour. Every other place I navigate (vim, tmux, fzf, telescope) uses home-row chords; the agent view is the lone exception, and it's currently unfixable because its context isn't in keybindings.json.
Related: #59324 (agent view keyboard parity), #9177 (generic configurable shortcuts — the mechanism this would plug into). Distinct from the NOT_PLANNED #4396, which was about j/k in slash-command selection menus and predates the agent view feature.
Additional Context
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗