extract_relevant_context
Extract and package only the code files most relevant to a given task or bug report using semantic ranking, within a token budget. Read-only operation with secret redaction, returns formatted Markdown.
Instructions
Performs semantic relevance ranking to extract and package code files pertinent to a specific user coding task or bug report within a token budget.
Behavior: Read-only operation. Zero file modifications, zero persistent side-effects, and zero network calls. Applies automatic secret redaction. Returns formatted Markdown.
When to use: Use this when given a specific feature request, issue, or debugging objective to gather only the essential source code.
When NOT to use: Do NOT use this for full-repository structural overviews (use get_codebase_map instead), or to inspect single file outlines (use read_file_outline instead).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Natural language task description, bug report, or feature prompt used for semantic and citation-based file scoring. | |
| rootDir | No | Path to repository root directory. Defaults to current working directory ("."). | |
| maxTokens | No | Maximum token budget ceiling (1,000 to 128,000; default: 40000). Files with highest relevance scores are packed first until budget is exhausted. |