Feature request: keybinding action to attach the currently active IDE file
Summary
Add a new keybinding action (e.g. chat:attachActiveFile) that attaches the currently active file from the connected IDE as context to the chat input — equivalent to typing @filename.
Motivation
When running Claude Code from an integrated VS Code terminal, the footer already displays the currently open file (e.g. ⧉ In settings.json), which means the IDE MCP server is actively communicating this information. However, there is no keybinding action to quickly attach this file as context to the current message.
Current workflow
The only way to reference the active file is:
- Manually type
@and the filename, or - Press
Escto focus the footer → navigate → pressEnter(inconsistent and doesn't always work)
Desired workflow
A single keybinding (e.g. ctrl+shift+a) mapped to a new action like chat:attachActiveFile that instantly attaches the currently active IDE file as message context.
Proposed solution
- New action:
chat:attachActiveFilein theChatcontext - Behavior: Query the connected IDE MCP server for the currently active file and add it as an
@-reference to the current chat input - No default binding required — users can assign it in
~/.claude/keybindings.json:
``json``
{
"context": "Chat",
"bindings": {
"ctrl+shift+a": "chat:attachActiveFile"
}
}
Context
- The IDE integration already tracks the active file (shown in the footer via
⧉ In <filename>) - The keybinding system currently only supports a fixed set of predefined actions — there is no way to run arbitrary commands or insert text into the input
- The IDE MCP server (
mcp__ide) exposesexecuteCodeandgetDiagnosticsbut has nogetActiveFiletool
Environment
- Claude Code CLI running inside VS Code integrated terminal
- OS: Windows 11
- IDE: VS Code with Claude Code extension
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗