Search
redctx_searchFind lines in redacted project context matching a literal substring or Python regex, returning grep-style results with optional surrounding context lines.
Instructions
Find lines of redacted text containing query (a literal substring, or a Python regex with regex) and return grep-style lines @p_<id>:<line>:<redacted path>:<text> (context lines use - after the id), or No matches.. Use it for exact words, identifiers or patterns and to see nearby lines; use redctx_retrieve instead for ranked passages answering a multi-word question. Matching runs on redacted output, so raw sensitive values never match; search for a placeholder such as [PERSON_<hex>] copied from earlier output to find every mention of that exact value. Forms the operator declared as aliases of one entity share its hex and add a form suffix, as in [PERSON_<hex>.<form>] or [EMAIL_<hex>.<form>]: search for [PERSON_<hex> without the closing bracket to find every person-typed form, or for the bare <hex> to find every form. Output stops at max_results lines with [TRUNCATED]; the call fails after 30 s, when a file in scope exceeds the server's per-file byte limit (5 MB by default), or when the scope exceeds its total byte limit (50 MB by default), so narrow paths or glob on large roots.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| glob | No | Shell-style patterns matched against each file's root-relative path, for example `*.md` or `notes/*.txt`; a file is kept if it matches any pattern. `*` also matches `/`, so `*.md` matches at every depth. Default `[]` means no filter. Applied within `paths`. | |
| paths | No | Files or directories to include: root-relative paths or `@p_<id>` references from earlier output. Directories are walked recursively, skipping excluded, protected, symlinked and binary files. Default `[]` means the whole root. With `glob`, only files under these paths that also match a glob are used. | |
| query | Yes | Text to find within a single line of redacted output: a literal substring, or a regex when `regex` is true. May be a placeholder copied from earlier output. | |
| regex | No | Treat `query` as a Python regular expression matched per line. Default false. Invalid patterns fail with `Invalid regex.`; patterns prone to catastrophic backtracking, such as nested quantifiers, are rejected. | |
| context | No | Lines to include before and after each match. Default 0. Context lines count toward `max_results`. | |
| ignore_case | No | Match case-insensitively, for literal and regex queries alike. Default true. | |
| max_results | No | Maximum output lines (matches plus context lines) before the output stops with `[TRUNCATED]`. Default 200. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The tool output, identical to the text content block and already redacted: sensitive values appear as deterministic `[CATEGORY_<hex>]` placeholders (forms declared as aliases of one entity share its hex and add a form suffix, `[CATEGORY_<hex>.<form>]`) and files as `@p_<id>` references. When the result has `isError: true`, this is a fixed error message instead, such as a limit error or the notice that context access is blocked until the operator repairs the local redaction config. | |
| receipt | Yes | Redaction statistics for this call only; never contains original values. |