[BUG] /init silently misses source files in repos with many files due to Glob truncation
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?
Running /init in a project with many files silently omits some root-level source files from the generated CLAUDE.md.
The /init skill uses Glob internally with a default 250-result limit. When the result set exceeds that limit (e.g. because node_modules is installed), results are truncated with no warning, and files that fall beyond the cutoff are never read.
In my case: CLAUDE.md was first generated when the project was a single HTML file, created as Claude Chat artifact. The project later grew — unit tests (vitest), e2e tests (Playwright) and a core.js module were added, and npm install populated node_modules. Running /init again to update CLAUDE.md correctly retained the description of the original html file but omitted core.js entirely — the most important file in the project (data layer + compute logic, imported by both the app and the unit tests).
What Should Happen?
All source files in the project are considered when generating CLAUDE.md.
Error Messages/Logs
(none — the issue is silent omission, no error is shown)
Steps to Reproduce
- Create a project with a single html file (containing some business logic in JS) and run
/initto generate an initialCLAUDE.md - Extend the project: extract business logic to
core.jsfile and add more source files at the root level - Install npm dependencies (e.g. test frameworks), populating
node_moduleswith ~250+ files. It is important to have a big amount of.jsfiles in the project - Run
/initagain to updateCLAUDE.md - Observe that the newly added root-level source files (e.g. core.js) are missing from the updated
CLAUDE.mdwith no warning
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.158 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
_No response_