← Back to Workflow
Hidden

Grep Search Skill

Critical bug documentation and workarounds for the built-in grep_search tool.

Grep Search Tool Protocol

This skill documents known bugs and mandatory workarounds for the AI's internal grep_search tool. Because grep_search is used universally to search codebases, logs, and files, these rules apply globally.

CRITICAL BUG: Single File Target Failure

The Bug: If you set the SearchPath argument of the grep_search tool to a direct, specific file path (e.g., C:\path\to\file.txt), the tool will silently fail and return No results found, even if the string exists in the file.

The Workaround: You MUST NEVER point SearchPath at a specific file. To search within a specific file, you must:

  1. Set SearchPath to the parent directory containing the file (e.g., C:\path\to\).
  2. Use the Includes array argument to filter for the exact filename (e.g., Includes: ["file.txt"]).

CRITICAL BUG: Minified JSON / Long Lines

The Bug: grep_search is a line-based text parser. If it is pointed at a file that contains extremely long lines (like a minified .json database or a single-line dump), the underlying grep engine will often silently truncate the output or drop the buffer, resulting in false negatives.

The Workaround: Do not use grep_search to find data inside large JSON databases or minified files. Instead, use a native script (like python -c "import json..." or powershell ConvertFrom-Json) to load and parse the object natively.

This is used in: