Feature request: keybinding action to attach the currently active IDE file

Resolved 💬 2 comments Opened Apr 7, 2026 by eger1393 Closed May 20, 2026

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:

  1. Manually type @ and the filename, or
  2. Press Esc to focus the footer → navigate → press Enter (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

  1. New action: chat:attachActiveFile in the Chat context
  2. Behavior: Query the connected IDE MCP server for the currently active file and add it as an @-reference to the current chat input
  3. 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) exposes executeCode and getDiagnostics but has no getActiveFile tool

Environment

  • Claude Code CLI running inside VS Code integrated terminal
  • OS: Windows 11
  • IDE: VS Code with Claude Code extension

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗