Tool

read

Read a file, a symbol, or a group of files at the level of detail your question needs.

Once you know where to look, read retrieves that part of the index. You can ask for a method body, the declarations in a directory, or a view of changes to a particular function. The address selects the source; the view selects what you learn about it.

Start with an address

An address can name one file or match many. A fragment narrows it to a symbol or line range. You can combine those choices: a glob can select service classes across a project, then a symbol fragment can select a method from each class. Addressing explains the grammar.

Let the response size choose the detail

Without an explicit view, RepoQL returns the richest representation that fits the token budget. A small file may fit in full. A larger selection may return declarations, clipped content, or headlines. Check what representation came back before assuming you have read the complete source.

If the response is too shallow, narrow the address or increase the budget. Asking for one method often provides more useful detail than giving a larger budget to an entire directory.

Choose a view for a specific question

Add a modifier after the address to ask for a particular view. structure shows declarations without bodies. history shows relevant commits. references shows indexed relationships such as calls, imports, and document links.

Text search and meaning search serve different questions. grep finds literal text, regex finds a text pattern, and find finds relevant passages within the selected files. similar compares stored embeddings with a seed file; it can suggest related tests, but it cannot prove test coverage.

Example: inspect a project before reading its files

Terminal

rql read "file:///src/cloud/website/** => tree: folders" --token-budget 800

This returns the website’s folder layout. Select one directory for a closer read, or use tree: headlines to see descriptions alongside filenames.

Parameters and views

MCP parameterUse
uriGlobRequired. One address, a glob, or several addresses separated by semicolons. A trailing modifier applies to the selection.
tokenBudgetOptional. Maximum rendered response size.
ViewWhat it returns
contentSource with line numbers. Resolves supported @ references in documents.
content: literalSource with references left untouched. Use this when preparing an edit.
content: previewA reference manifest and estimated assembly cost.
structureDeclarations, signatures, or headings.
headlineA short description for each file.
tree: folders / files / headlinesThe directory layout with the requested level of detail.
find: keywordsPassages related to the supplied terms.
grep: text / regex: patternMatching lines. Lowercase grep is case-insensitive; uppercase makes it case-sensitive.
similar: seed-uriSelected files ranked by stored-vector similarity to the seed.
references: destination-globIndexed reference edges, optionally filtered by destination.
history / history: topicGit commits affecting the selected files or symbols, optionally ranked by topic.
blameGit attribution for lines in the selection.
changesWorking-copy changes, grouped by staged, unstaged, and untracked.
where / where: remoteDisk paths or remote source URLs.
conceptsRepository concepts relevant to the selection.
question: questionA cloud-generated answer about the selected content, with citations.
lint: errors / warningsImported or generated diagnostics; warnings includes errors.
coverage: uncovered / contentCoverage gaps or source annotated with execution counts, when coverage data is available.

Available relationships and structure depend on the file format and analysis settings. Lint and coverage views report existing annotations; they do not run a linter or a test suite. Tree requests that need a larger budget report that requirement.

Further reference

In the installed manual: help:///tools/read.md, help:///tools/read-transclusion.md.