Skip to content

1.113.0 regression: unbounded ripgrep processes freeze macOS when worktrees exist #305544

Description

@hatpick

Description

After upgrading to VS Code 1.113.0, opening a workspace that contains git worktrees (under .claude/worktrees/) causes an unbounded number of rg (ripgrep) processes to spawn, consuming all CPU and freezing macOS. Rolling back to 1.112.0 resolves the issue completely.

Environment

  • VS Code version: 1.113.0 (cfbea10)
  • OS: macOS (Darwin 25.4.0, Apple Silicon arm64)
  • Extensions: GitHub Copilot + standard built-in extensions
  • Workspace: pnpm monorepo with git worktrees under .claude/worktrees/ (each worktree has its own node_modules, dist, lib)

Reproduction

  1. Have a monorepo with git worktrees under a subdirectory (e.g., .claude/worktrees/<branch-name>)
  2. Open the root workspace in VS Code 1.113.0
  3. Observe via Activity Monitor or ps aux | grep rg that dozens of rg processes spawn continuously
  4. System becomes unresponsive (95%+ CPU utilization, near 0% idle)

Root cause investigation

1.113.0 shipped several changes that interact with worktree scanning:

Git extension changes

  • Git - update DotGit file watcher to ignore worktree index.lock files #303504 ("Git: update DotGit file watcher to ignore worktree index.lock files"): Changed the DotGit file watcher regex in extensions/git/src/repository.ts from:

    !/\/\.git(\/index\.lock)?$|\/\.watchman-cookie-/
    

    to:

    !/\/\.git(\/index\.lock|\/worktrees\/[^/]+\/index\.lock)?$|\/\.watchman-cookie-/
    

    This alters which worktree file events pass through the watcher filter, potentially allowing more events to trigger git status refreshes and downstream rg invocations.

  • Git - optimize worktree ignored-path computation #303955 ("Git: optimize worktree ignored-path computation"): Changed the early-exit condition in _getWorktreeIncludePaths() from checking gitIgnoredFiles to gitIgnoredPaths. While the output set should be identical, this function determines which directories are fed to ripgrep for worktree scanning.

Copilot Chat: new Search Subagent

Combined effect

The Git extension's worktree watcher changes may allow more file events to trigger repository scans. Simultaneously, the new Copilot search subagent introduces additional workspace.findFiles calls. In a workspace with git worktrees (each containing node_modules, build output, etc.), this creates a feedback loop of unbounded rg process spawning, consistent with #303190.

Workaround

Rolling back to 1.112.0 resolves the issue. The following settings may mitigate on 1.113.0 (not fully verified):

{
  "files.watcherExclude": {
    "**/.claude/worktrees/**": true
  },
  "git.ignoredRepositories": [".claude/worktrees"],
  "search.ripgrep.maxThreads": 4
}

Related issues

Activity

  1. hatpick commented on Apr 1, 2026

    @hatpick
    Author

    Any progress here? vscode is not usable in the last week, even downgrading to 1.112 is not helping as I originally thought.

  2. vemvcs commented on Apr 9, 2026

    @vemvcs

    I found the following:

    #303190 (comment)

  3. osortega commented on May 14, 2026

    @osortega
    Contributor

    This is probably happenig from extensions triggering findFiles see #303190 (comment), but vemvcs is right, the fix that went in before that flipped the default to be --no-ignore seems like a bug in VS Code core.

    That said, it might be a bit risky to just go ahead and flip that to start respecting what the extension is requesting since it would cause a lot of unexpected behavior change.

    To address this I created this PR with the intention of:
    When search.experimental.useIgnoreFilesInFindFiles is ON:

    1. If the extension passed an explicit value then use it (including if it passes exclude === null to bypass .gitignore)
    2. Fall back to the user setting

    Could you please help me verify this in insiders once this lands?

  4. added this to the 1.121.0 milestone on May 14, 2026
  5. added
    unreleased
    on May 14, 2026
  6. osortega commented on May 14, 2026

    @osortega
    Contributor

    Reopening until we confirm verification and decide on the correct default

  7. removed
    unreleased
    on May 14, 2026
  8. vemvcs commented on May 15, 2026

    @vemvcs

    Thank you!

  9. added
    bug
    on May 18, 2026
  10. vemvcs commented on Jul 15, 2026

    @vemvcs

    Hi Osvaldo Ortega (@osortega) ! Thanks again for #316349 .

    The useIgnoreFilesInFindFiles flag, being experimental, cannot be used in extensions published in official channels.

    It's been a couple months now - perhaps by now the flag can be made official?

    Thanks - V

  11. nickolas52468 commented on Aug 14, 2026

    @nickolas52468

    The infinity loop is causing high usage of RAM on Windows too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions