Get Raw Text Search Result
Use this skill when a memory-first gate reports a text search and the original grep or
rg output is needed.
Procedure
- Select the matching
{pattern, rawResultHash}entry fromtextSearchInput. The hash is a SHA-256 digest of the exact pattern text; a pattern with no capture (afindcall, for instance) carries no hash and has no raw output to fetch. - Run
python3 <path-to-this-skill>/scripts/get_raw_text_search.py --pattern-hash <hash>. For an exact pattern string, use--pattern <pattern>instead. - Parse the JSON response.
statusispending,ready,expired, orerror; a ready result containsstdout,stderr, andreturncode. - If the status is
pending, retry promptly. Results expire about 120 seconds after capture begins and are removed when fetched after expiry. Run the command from the same working directory as the original search; results are isolated by working directory.
Pitfalls
- Pass exactly one of
--patternand--pattern-hash. - Preserve the pattern exactly when using
--pattern; even whitespace changes its hash. - A grep exit code of 1 means no matches and is still a completed
readyresult. - Each stdout and stderr stream is limited to 1 MiB; the JSON marks truncated streams.
- The capture is best-effort and only starts for a standalone grep/rg command with literal operands on a first-sighting gate decision. Pipelines, compound commands, and shell-expanded operands are not captured. It is not a durable search history.
Gotchas
No environment-specific gotchas known.
Verification
Confirm the output is valid JSON and the returned hash matches the requested handle. For a
ready response, inspect returncode, stdout, and stderr before relying on the result.