[BUG] VSCode Extension Does Not Respect .gitignore_global When Linking Files With @

Status Closed — not planned
Maintainer reply ✓ Yes — hackyon-anthropic
Activity 10 comments · opened Oct 27, 2025 · closed Feb 5, 2026
💡 Likely answer: A maintainer (hackyon-anthropic, collaborator) responded on this thread — see the highlighted reply below.

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_global 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_global 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_global when adding files to the context with @ from both the terminal and VSCode extensions

Error Messages/Logs

Steps to Reproduce

  1. Create ~/.gitignore_global, add files to it, and set that as global with git config --global core.excludesFile ~/.gitignore_global
  2. Create files that are ignored (in my case it is files created by the local history extension)
  3. Start a chat with cmd+esc in VSCode, using the extension UI (not terminal UI)
  4. Add a file with @ and see that the extension suggests files that are gitignored

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.27 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

10 Comments

tyler-ball · 11 months ago

I don't have the ability to reopen https://github.com/anthropics/claude-code/issues/10213 so filed a new issue

github-actions[bot] · 11 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/10213
  2. https://github.com/anthropics/claude-code/issues/1248
  3. https://github.com/anthropics/claude-code/issues/8481

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

hackyon-anthropic collaborator · 11 months ago

Does this work for your .gitignore or is it just this special .gitignore_global file? Can you check what your Claude Code: Do Not Exclude Search Patterns setting is?

tyler-ball · 11 months ago

The vscode extension does correctly exclude items listed in .gitignore. My Claude Code: Do Not Exclude Search Patterns setting is unchecked (the default).

tyler-ball · 11 months ago

If supporting core.excludesFile git setting becomes an option y'all want to support, I also propose looking for .gitignore files in parent directories and reading those. That would be another way to have developer-environment-specific files that need to be ignored

github-actions[bot] · 10 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.

hackyon-anthropic collaborator · 9 months ago

i will add a check for core.excludesFile. we normally look for the global git ignore in .config/git/ignore but we just didn't respect when folks have another value for core.excludesFile. should be available in a release later this week or early next week!

github-actions[bot] · 8 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 · 8 months ago

Was this released? Please first release, place the comment in the changelog linking to this issue, and then consider adding a note to this issue.

Nevertheless, 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] · 8 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.