claude-code - 💡(How to fix) Fix [FEATURE] Expose AgentView as a rebindable context in keybindings.json (attach / detach actions)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

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.

Root Cause

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.

Fix Action

Fix / Workaround

ActionCurrent defaultNotes
agentView:selectPreviousUpMove selection up between rows
agentView:selectNextDownMove selection down between rows
agentView:attachEnter, RightAttach to the selected session
agentView:detachLeft (on empty input)Detach back to the table
agentView:peekToggleSpaceOpen/close peek panel
agentView:dispatchAndAttachShift+EnterDispatch and immediately attach
agentView:stopCtrl+XStop / delete session
agentView:pinCtrl+TPin/unpin
agentView:renameCtrl+RRename session
agentView:groupToggleCtrl+SToggle grouping by state/directory
agentView:reorderUp / DownShift+Up / Shift+DownReorder within group

Code Example

{
  "context": "AgentView",
  "bindings": {
    "ctrl+f": "agentView:attach",
    "ctrl+b": "agentView:detach",
    "j": "agentView:selectNext",
    "k": "agentView:selectPrevious"
  }
}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • 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:

ActionCurrent defaultNotes
agentView:selectPreviousUpMove selection up between rows
agentView:selectNextDownMove selection down between rows
agentView:attachEnter, RightAttach to the selected session
agentView:detachLeft (on empty input)Detach back to the table
agentView:peekToggleSpaceOpen/close peek panel
agentView:dispatchAndAttachShift+EnterDispatch and immediately attach
agentView:stopCtrl+XStop / delete session
agentView:pinCtrl+TPin/unpin
agentView:renameCtrl+RRename session
agentView:groupToggleCtrl+SToggle grouping by state/directory
agentView:reorderUp / DownShift+Up / Shift+DownReorder 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 translate Ctrl+F / Ctrl+B into Enter / Left system-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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Expose AgentView as a rebindable context in keybindings.json (attach / detach actions)