> For the complete documentation index, see [llms.txt](https://docs.pullrequest.com/the-pullrequest-reviewer-tools/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pullrequest.com/the-pullrequest-reviewer-tools/code-search-tool.md).

# Code Search Tool

## Using the Search Tool for Code Reviews

The Search tool on the reviewer platform, accessible via the magnified glass icon in the sidebar, can be used to search both the files involved in a code review job's diff and the entire repository.

We strongly encourage PullRequest reviewers to make regular use of the Search tool.

Its behavior is similar to that of a standard IDE. Use cases include things like looking up the definition of a method to ensure proper use on a file it's imported on.

<div align="left"><img src="/files/-M9-9GNBNtUHby9Gt6tA" alt=""></div>

## Diff File Results & Repository Results

Search results are split into 2 sections:

* **Files touched in this review**
* **Other files in this repository**

These are fairly self-descriptive. The **Files touched in this review** section will contain results limited only to the files involved in the code review job's diff while the **Other files in this repository** section will contain results from a query of the entire repository.

<div align="left"><img src="/files/-M9-Bsp20PXKAbzuKMKA" alt=""></div>

Selecting a result from **Other files in this repository** will render its file with the line number highlighted. Note that since the file is not part of the code review's diff, no inline comments can be inserted.

![](/files/-M9-C1jV5EQ-yZPcrRFh)

## Search Limitations

Diff file search results can be viewed for all code review jobs, however, ***some projects will not have repository search results enabled.***

When a search query of the entire repository cannot be executed, a message will appear in the **Other files in this repository** results section:

![](/files/-M9-FLCKV-8WDoA7odSS)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.pullrequest.com/the-pullrequest-reviewer-tools/code-search-tool.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
