[FEATURE]

Resolved 💬 1 comment Opened May 3, 2026 by NorbertHanni Closed Jun 1, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

On Windows, Claude Code's internal grep/search operations are significantly slowed down by corporate antivirus real-time scanning. When Claude Code's bundled ripgrep walks large folders like node_modules or .nuget_packages — which can contain thousands of binary and JS files — the AV intercepts every file open syscall and scans the bytes in real-time. In a corporate environment, antivirus policy is enforced centrally by IT security and individual developers cannot add exclusions or modify AV rules. This makes every codebase search inside Claude Code unnecessarily slow, breaking the development flow.

Proposed Solution

Claude Code should inject --glob exclusion patterns directly into its internal ripgrep calls, without touching any project file. Two options:

LLM-driven — Claude already knows the context of the search. It can decide on the fly which folders are irrelevant (e.g. node_modules, bin, obj, .nuget_packages) and append the appropriate --glob "!folder/**" flags automatically when calling ripgrep.
Persistent exclusion list — Claude Code stores a per-project exclusion list in its own settings (e.g. .claude/settings.json), and injects the --glob flags on every grep call. The user can review or edit it, and it shows up in tool call logs so the exclusions are transparent.
Either way, no project file is created or modified, the exclusions are visible in the tool call logs, and the AV never sees the excluded folders.

Alternative Solutions

AV exclusions — blocked by corporate IT security policy, not available to developers.
Manual .ignore file — creating a .ignore file in the project root with the large folders listed works as a partial workaround, but requires knowing that Claude Code uses ripgrep, that ripgrep respects .ignore files, and which folders are worth excluding. This is non-obvious and undocumented. It must be done manually on every new project.
--glob CLI parameters — ripgrep supports --glob "!folder/**" exclusions on the command line, but Claude Code calls ripgrep internally so developers have no way to pass parameters to it directly. This is exactly why the fix must come from inside Claude Code.
No other workaround exists — since the AV hooks at the OS filesystem driver level, no alternative tool (findstr, PowerShell Select-String, etc.) avoids the scanning.

Priority

Medium - Would be very helpful

Feature Category

Performance and speed

Use Case Example

Environment: corporate Windows machine, centrally managed antivirus, node_modules (~300 npm packages) and .nuget_packages (1.1 GB NuGet cache) present in the project root.

Without the fix:

I ask Claude Code: "Find all usages of IEntities in the codebase."
Claude Code calls its internal ripgrep across the entire project folder.
ripgrep walks every file — including 10,000+ files in .nuget_packages and hundreds in node_modules.
The corporate AV intercepts every file open syscall and scans in real-time.
The search takes ~33 seconds and returns 48 matches.
With --glob exclusions injected by Claude Code:

Same request.
Claude Code calls ripgrep with --glob "!.nuget_packages/" --glob "!node_modules/" --glob "!bin/" --glob "!obj/".
ripgrep only walks source files — a few hundred .cs and .razor files.
The AV has nothing to scan — the large binary/JS folders are never opened.
The search takes ~18 seconds — and with a proper exclusion list that is the current best achievable result, but the expectation with no AV interference would be under 1 second.
Note: The 33s → 18s improvement was measured using a .ignore file workaround. The --glob injection approach would achieve the same result natively.

Additional Context

The performance impact is not limited to grep/search operations. The antivirus scans on every file operation Claude Code performs — reads, writes, edits, glob/directory traversal, and builds. On a 15-project solution this means constant background AV load throughout the entire session: every time Claude Code reads a .cs file, edits a .razor, or triggers a dotnet build that compiles DLLs into bin/obj, the AV intercepts and scans in real-time. The node_modules and .nuget_packages folders amplify this significantly because they contain 19,000+ files that ripgrep, Glob, and file tree exploration all walk through unnecessarily. The real ask is therefore broader than grep exclusions: Claude Code should never touch node_modules, .nuget_packages, bin, and obj folders for any operation — grep, Glob, Read, file tree exploration — unless the user explicitly asks it to. These folders should be treated as opaque build artifacts at the system level, not just in search. This would eliminate the majority of AV interference and make Claude Code significantly more responsive in corporate Windows environments where AV policy cannot be modified.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗