Sypha AI Docs
FeaturesTools

search_files

Execute optimized regular expression queries across your entire project for pattern discovery.

search_files

The search_files utility empowers Sypha to locate complex code patterns, specific text strings, or documentation markers throughout your workspace using high-performance regex.

Parameters

  • path (required): The root directory for the search operation.
  • regex (required): The search criteria (utilizes the high-speed Rust regex engine).
  • file_pattern (optional): A glob-style filter to isolate specific file types (e.g., **/*.mdx).

Functional Overview

This tool operates as an advanced "Global Find" utility. Managed by Ripgrep (rg) for industry-leading speed, results are delivered with precise line numbers and a surrounding context window to ensure the AI understands the match usage.

Common Applications

  • Structural Analysis: "Locate all instances where the initializeConnection method is invoked."
  • Internal Auditing: "Identify all source files currently importing the legacy-connector module."
  • Technical Debt Tracking: "Scan the service/ core for any remaining FIXME or TODO annotations."

Execution Example

Identifying specific library usage

<search_files>
  <path>backend/src</path>
  <regex>from ['"]zustand['"]</regex>
  <file_pattern>*.ts</file_pattern>
</search_files>

Strategy & Performance

  • Narrow Your Focus: To maintain context efficiency, results are capped at 300 entries. Utilize file_pattern or refine your regex if an initial search is too broad.
  • Data Truncation: For readability, exceptionally long lines (exceeding 500 characters) are automatically shortened in the output stream.

On this page