How can I add multiple files as context at once?

Resolved 💬 16 comments Opened Jul 19, 2025 by isCopyman Closed Jan 25, 2026

Hi, I'm using the Claude Code in VS Code.

When I try to add multiple files to the chat context, it doesn't seem to work. I select several files in the explorer (using Shift-click), then drag and drop them into the chat, but only a single file is added.

Is there a way to add a selection of multiple files to the context in one action? This would be a very useful feature for asking questions about code that spans across different files.

View original on GitHub ↗

16 Comments

kurutah · 11 months ago

+1

mrfarmani · 11 months ago

+1

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/4663
  2. https://github.com/anthropics/claude-code/issues/2888
  3. https://github.com/anthropics/claude-code/issues/3308

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

coygeek · 11 months ago

You're right, it's a bit counter-intuitive that dragging a selection of files doesn't work. It seems to only register the single file your cursor is over when you drop it.

After digging into the documentation and playing around with it, I found that the intended way to add multiple files to the context at once is by using @ mentions directly in the chat prompt.

Here’s how you can do it:

  1. Start typing your question in the chat.
  2. When you want to reference a file, type @ and begin typing the file's name. Claude will show you an autocomplete list of files in your project.
  3. Select the file you want.
  4. You can then continue typing your prompt and add more files by repeating the @ mention.

For example, you could write a prompt like this:

> Can you refactor the login logic? I think the relevant files are @src/api/auth.js, @src/components/LoginForm.jsx, and @src/store/userSlice.js.

This will pull the full contents of all three files into the context for that single request. It's super useful for questions that span multiple parts of the codebase.

There's also a keyboard shortcut, Option+Cmd+K (on Mac) or Alt+Ctrl+K (on Windows/Linux), which will insert an @ reference to the file you currently have active in your editor. Open a file in VS Code, use the shortcut, which will paste in the file inside your Claude Code session. Repeat for 2nd file, and so on.

Hope this helps! It's a really powerful feature once you get used to the @ workflow.

gogata05 · 9 months ago

+1

derek-knox · 9 months ago
You're right, it's a bit counter-intuitive that dragging a selection of files doesn't work. It seems to only register the single file your cursor is over when you drop it. After digging into the documentation and playing around with it, I found that the intended way to add multiple files to the context at once is by using @ mentions directly in the chat prompt. Here’s how you can do it: 1. Start typing your question in the chat. 2. When you want to reference a file, type @ and begin typing the file's name. Claude will show you an autocomplete list of files in your project. 3. Select the file you want. 4. You can then continue typing your prompt and add more files by repeating the @ mention. For example, you could write a prompt like this: > Can you refactor the login logic? I think the relevant files are @src/api/auth.js, @src/components/LoginForm.jsx, and @src/store/userSlice.js. This will pull the full contents of all three files into the context for that single request. It's super useful for questions that span multiple parts of the codebase. There's also a keyboard shortcut, Option+Cmd+K (on Mac) or Alt+Ctrl+K (on Windows/Linux), which will insert an @ reference to the file you currently have active in your editor. Open a file in VS Code, use the shortcut, which will paste in the file inside your Claude Code session. Repeat for 2nd file, and so on. Hope this helps! It's a really powerful feature once you get used to the @ workflow.

@coygeek Yea, that makes sense. From a DX perspective that is just painful in comparison to drag-and-drop.

Here's a sample of how it works in VS Code Copilot compared to Claude Code VS Code UI. The greater the number of files the more DX-friendly it is to drag-and-drop. This workflow is ideal compared to @ mention so would be ace if it was prioritized!

https://github.com/user-attachments/assets/82245542-8ed2-4881-89ce-f2b0651cde74

MiqueVzvsky · 9 months ago

Any changes related to implementing this function? It doesn’t seem complicated to add, but it’s fairly important.

dabit1belmond · 8 months ago

+1

I think claude code should check how copilot is doing somethings. I have just paid for a claude code subscription after working with copilot for 2 months. I can say that copilot makes things a bit easier in some case like this one we are discussing. Also the interactive review after changes, opening all modified files is very useful (although I would add the option of enabling/disabling the feature)

derek-knox · 8 months ago
Also the interactive review after changes

+1, still use Copilot in many cases for this DX

fwiw This issue might be worth closing as both Claude and Claude VS Code support dragging and dropping multiple files. In the latter we don't get the same nice UX chips like Copilot but the drag-and-drop of multiple open file tabs into Claude VS Code UI does work (just @ inlines all the file paths)

alexcodito · 8 months ago

TIL: You can drop multiple files into the Claude VS Code editor at once by holding Shift before dropping them. As the person above said, the paths become inlined with an @ prefix and it doesn't use pretty chips like Copilot, but at least it can be done.

github-actions[bot] · 7 months ago

This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.

isCopyman · 6 months ago

!Image
Actually, this still doesn't work

isCopyman · 6 months ago
TIL: You can drop multiple files into the Claude VS Code editor at once by holding Shift before dropping them. As the person above said, the paths become inlined with an @ prefix and it doesn't use pretty chips like Copilot, but at least it can be done.

not work. see my GIF

github-actions[bot] · 5 months ago

This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.

marcindulak · 5 months ago

This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.