[BUG] VSCode Extension Ignores .gitignore When Linking Files With `@`
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When using the VSCode extension, trying to add files as context with @ looks up files that are in my .gitignore config:
<img width="662" height="404" alt="Image" src="https://github.com/user-attachments/assets/d537a953-23b8-4ad4-a6e4-4045f5648650" />
When I try the same in claude code in the terminal I do not get this issue (.gitignore is respected). This is in the same repo for both:
<img width="362" height="186" alt="Image" src="https://github.com/user-attachments/assets/72e4b1a5-d6ce-45bd-a010-f8c7e7ad809a" />
What Should Happen?
Claude should respect my .gitignore when adding files to the context with @ from both the terminal and VSCode extensions
Error Messages/Logs
Steps to Reproduce
- Create
.gitignoreand add files to it - Create files that are ignored (in my case it is files created by the local history extension)
- Start a chat with
cmd+esc - Add a file with
@and see that the extension suggests files that are in the gitignore
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
v2.0.26
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗