[BUG] /init silently misses source files in repos with many files due to Glob truncation

Resolved 💬 0 comments Opened May 31, 2026 by wirelessMousetail Closed Jun 23, 2026

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

  1. Create a project with a single html file (containing some business logic in JS) and run /init to generate an initial CLAUDE.md
  2. Extend the project: extract business logic to core.js file and add more source files at the root level
  3. Install npm dependencies (e.g. test frameworks), populating node_modules with ~250+ files. It is important to have a big amount of .js files in the project
  4. Run /init again to update CLAUDE.md
  5. Observe that the newly added root-level source files (e.g. core.js) are missing from the updated CLAUDE.md with 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_

View original on GitHub ↗