claude-code - 💡(How to fix) Fix [BUG] /init silently misses source files in repos with many files due to Glob truncation

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

(none — the issue is silent omission, no error is shown)

Root Cause

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.

Code Example

(none — the issue is silent omission, no error is shown)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] /init silently misses source files in repos with many files due to Glob truncation