#### Agent

# Search

## Instant grep

The fastest way to find code is an exact match: a function name, variable, error string, or regex pattern. Agent uses grep automatically when you reference specific symbols.

Grok Build ships with [Instant Grep](https://cursor.com/changelog/2-1#instant-grep-beta), a custom search engine that outperforms `ripgrep` on large codebases. It runs automatically; no configuration needed.

Instant Grep supports full regex and word-boundary matching, so Agent can construct patterns like `import.*PaymentService` or `PaymentFailedError` to trace references across files.

## Privacy and security

Instant Grep builds and queries its index on your machine. Grok Build does not upload file paths or code to build a search index, and it does not store embeddings of your codebase for search.

When Agent opens a match, that file content can still be included in the model request. [Data Use](https://cursor.com/data-use) describes how Grok Build handles that data.

## Explore subagent

Agent can spawn an [Explore subagent](/build/agents-window/subagents) that runs in its own context window with a faster model. It executes many parallel searches without bloating the main conversation, returning only the relevant findings.

Agent uses the Explore subagent automatically when it decides a task benefits from broad search. You can also request it directly: "use a subagent to find all the places we validate user input."

This is useful for context management. Searching through many files generates a lot of context. The subagent keeps the main conversation focused by summarizing results instead of dumping raw file contents.

## FAQ

**Does Grok Build support multi-root workspaces?**

Yes. Grok Build supports [multi-root workspaces](https://code.visualstudio.com/docs/editor/workspaces#_multiroot-workspaces). Each workspace folder's context is available to Agent. Some features that rely on a single git root, like worktrees, are disabled for multi-root workspaces. Cloud Agents do not support multi-root workspaces.
