@-mention file picker shows node_modules in pnpm workspaces despite .gitignore exclusion

Resolved 💬 3 comments Opened May 8, 2026 by phallguy Closed May 11, 2026

Summary

The @ file mention picker in Claude Code does not filter out node_modules/ directories in pnpm workspace repos, even though they are excluded by .gitignore.

Steps to Reproduce

  1. Open a pnpm workspace repository (multiple packages under packages/)
  2. Root .gitignore contains node_modules/ (matches all nested node_modules directories per git semantics)
  3. Type @ in the Claude Code prompt to open the file picker
  4. Observe node_modules/ directories appearing in picker results (at root and/or inside packages/)

Expected Behavior

The file picker should apply .gitignore rules the same way git does — node_modules/ in the root .gitignore excludes all nested node_modules/ directories, and none of them should appear in the picker.

Actual Behavior

Nested node_modules/ directories (e.g. packages/foo/node_modules/) appear in the @ file picker even though the root .gitignore contains node_modules/.

Environment

  • OS: macOS (Darwin 25.3.0)
  • Repo structure: pnpm workspace (packages/ with multiple sub-packages, each with their own node_modules/)
  • respectGitignore setting: not set (defaults to true)
  • No project-level settings.json overrides

Notes

The root .gitignore entry node_modules/ is valid git syntax that matches nested directories. git status and git ls-files correctly exclude them. The file picker appears to only check the root-level .gitignore against root-level paths, missing nested matches.

View original on GitHub ↗

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