---
title: "Search and fetch"
description: "Search shared work from your agent session and fetch the original evidence."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.getopencrawl.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Search and fetch

## Search past chats

When a user asks why a launch was delayed, search for the words the team used. This query looks for both terms in past chats.

```sh
opencrawl search "launch signup" --source sessions --match all --json
```

## Find a passage

Use a project name, an issue ID, or a distinctive error message. Omit `--source sessions` to include memories and connected sources. Narrow by repository, date, or author when several conversations match. Use the passage ID from the result to fetch the original text.

## Read the surrounding messages

![A highlighted line in a stack of transcripts expands into the matching message with the messages before and after it.](https://docs.getopencrawl.com/images/docs/search-context.png)

For a session hit, fetch the passage with its neighbors. Replace `PASSAGE_ID` with the ID returned by search.

```sh
opencrawl fetch PASSAGE_ID --context --json
```

If you need a command’s output, add `--include-tool-outputs` to the search and context fetch. Cite the source passage so the reader can check your answer.

Source: https://docs.getopencrawl.com/search/index.mdx
