File indexing broken for Next.js app directories with dynamic routes (brackets in folder names)

Resolved 💬 6 comments Opened Aug 6, 2025 by mtaksa Closed Dec 5, 2025

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other:
  • Claude CLI version: <!-- run claude --version in terminal -->
  • Operating System: macOS 14.6 (Darwin 23.6.0)
  • Terminal: Terminal App

Bug Description

The @ mention file picker completely fails to index any files within directories that contain Next.js dynamic route folders (folders with brackets like [id], [username]). This was working perfectly an hour ago but broke after creating a new Claude Code instance. The issue only affects directories containing bracketed subdirectories - other directories work fine.

Steps to Reproduce

  1. Open a Next.js project with app router structure
  2. Have directories like src/app/users/[id]/page.tsx or src/app/blog/[slug]/page.tsx
  3. Try to use @ mention to reference any file within src/app or src/components
  4. Notice that NO files from these directories appear in the picker
  5. Try @ mentioning files from src/utils or src/services (no bracketed subdirs) - these work fine

Expected Behavior

All files in the project should be indexed and available via @ mention, including those in directories containing Next.js dynamic routes with brackets.

Actual Behavior

  • Files in src/app and src/components (which contain dynamic route folders) are completely missing from @ mention picker
  • Files in src/utils and src/services (no dynamic routes) work perfectly
  • This is a regression - it worked in the previous Claude Code instance from an hour ago

Additional Context

  • Project structure uses Next.js 15 with app router
  • Running find src/app -name "*.tsx" shows 50+ files that should be indexed but aren't
  • Cleared all caches with rm -rf ~/.cache/claude* - didn't help
  • The pattern is clear: any directory tree containing folders with brackets [param] fails to index
  • 557 total files in project (excluding node_modules, .next, etc)
  • File watcher limits are fine (kern.maxfilesperproc: 2200000)

View original on GitHub ↗

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