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 --versionin 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
- Open a Next.js project with app router structure
- Have directories like
src/app/users/[id]/page.tsxorsrc/app/blog/[slug]/page.tsx - Try to use @ mention to reference any file within
src/apporsrc/components - Notice that NO files from these directories appear in the picker
- Try @ mentioning files from
src/utilsorsrc/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/appandsrc/components(which contain dynamic route folders) are completely missing from @ mention picker - Files in
src/utilsandsrc/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)
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗