1Fast content search tool that finds files containing specific text or patterns, returning matching file paths sorted by modification time (newest first).
 2
 3WHEN TO USE THIS TOOL:
 4
 5- Use when you need to find files containing specific text or patterns
 6- Great for searching code bases for function names, variable declarations, or error messages
 7- Useful for finding all files that use a particular API or pattern
 8
 9HOW TO USE:
10
11- Provide a regex pattern to search for within file contents
12- Set literal_text=true if you want to search for the exact text with special characters (recommended for non-regex users)
13- Optionally specify a starting directory (defaults to current working directory)
14- Optionally provide an include pattern to filter which files to search
15- Results are sorted with most recently modified files first
16
17REGEX PATTERN SYNTAX (when literal_text=false):
18
19- Supports standard regular expression syntax
20- 'function' searches for the literal text "function"
21- 'log\..\*Error' finds text starting with "log." and ending with "Error"
22- 'import\s+.\*\s+from' finds import statements in JavaScript/TypeScript
23
24COMMON INCLUDE PATTERN EXAMPLES:
25
26- '\*.js' - Only search JavaScript files
27- '\*.{ts,tsx}' - Only search TypeScript files
28- '\*.go' - Only search Go files
29
30LIMITATIONS:
31
32- Results are limited to 100 files (newest first)
33- Performance depends on the number of files being searched
34- Very large binary files may be skipped
35- Hidden files (starting with '.') are skipped
36
37IGNORE FILE SUPPORT:
38
39- Respects .gitignore patterns to skip ignored files and directories
40- Respects .crushignore patterns for additional ignore rules
41- Both ignore files are automatically detected in the search root directory
42
43CROSS-PLATFORM NOTES:
44
45- Uses ripgrep (rg) command if available for better performance
46- Falls back to built-in Go implementation if ripgrep is not available
47- File paths are normalized automatically for cross-platform compatibility
48
49TIPS:
50
51- For faster, more targeted searches, first use Glob to find relevant files, then use Grep
52- When doing iterative exploration that may require multiple rounds of searching, consider using the Agent tool instead
53- Always check if results are truncated and refine your search pattern if needed
54- Use literal_text=true when searching for exact text containing special characters like dots, parentheses, etc.