[BUG] VS Code Extension cannot detect files in subdirectories of large codebases

Resolved 💬 3 comments Opened Nov 27, 2025 by Divyanshubansaldb Closed Nov 30, 2025

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?

The Claude Code VS Code extension can see files in the root directory of large codebases, but cannot detect or access files located in subdirectories. This only occurs with larger projects - smaller codebases work fine.

Observed behavior:

  • Terminal-based Claude Code (CLI) can see all files including subdirectories perfectly
  • VS Code Extension shows root files but subdirectory contents are invisible via the @ symbol or file browse
  • This suggests the issue is specific to the Extension's indexing/workspace traversal

Example structure where bug occurs:

my-large-repo/
├── root-file.py    ← visible and accessible ✓
├── apps/
│   └── backend/    ← NOT visible ✗
│       └── src/
│           └── main.py
├── packages/
│   └── utils/      ← NOT visible ✗
│       └── helpers.js
└── node_modules/   (large folder that may choke indexer)

What Should Happen?

The VS Code Extension should be able to see and access all files in subdirectories of the workspace, matching the behavior of the Terminal/CLI version. The extension should:

  1. Properly index subdirectories even in large monorepos
  2. Make files accessible via the @ mention feature
  3. Allow browsing and selecting files from nested folders in the UI
  4. Maintain parity with the CLI tool's file visibility across all workspace paths

Error Messages/Logs

Steps to Reproduce

  1. Open a large monorepo/codebase in VS Code (e.g., with multiple top-level folders like apps/, packages/, services/, or with node_modules/)
  2. Open the Claude Code Extension panel on the right side
  3. Try to find files from subdirectories using the @ mention feature - only root files appear
  4. Compare this with the CLI: Run claude in terminal from the repo root and try /workspace or list files - all subdirectories are visible
  5. Observe: CLI sees all files, but VS Code Extension UI shows only root-level files

Workaround observed:

  • Opening VS Code on a specific subfolder (e.g., code apps/backend) makes the extension see files correctly (extension treats that subfolder as the root)

Claude Model

None

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

1.0.x or higher (latest)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Root Cause Analysis

This appears to be due to the VS Code Extension's workspace indexing strategy:

  1. CLI vs Extension difference: The CLI indexes files on-demand as needed, while the Extension pre-indexes the workspace upfront
  2. Large codebase limits: The Extension likely has a hard cap on file count or indexing depth to prevent VS Code crashes
  3. Likely culprits: Presence of large node_modules/, dist/, build/, or generated code folders in the monorepo causes the indexer to hit its limits before reaching subdirectories

Impact

  • Severely limits Extension usability in large projects (common in production environments)
  • Creates workflow friction: users must switch to CLI for large repos, defeating the purpose of the UI extension
  • Inconsistent behavior between CLI and UI is confusing

Related observations

  • Smaller projects work fine (no size constraint hit)
  • Workaround of opening VS Code on specific subfolders works but is not scalable
  • This likely affects any monorepo with significant file count

View original on GitHub ↗

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