Grep Tool - Search Inside Files with AI
Searches indexed file contents using FFF. Finds matching lines across multiple files, returning the file path, line number, and matching content. Supports regex, plain, and fuzzy modes, respects ignore files, and supports directory scoping.
What It Does
Searches indexed file contents using FFF. Finds matching lines across multiple files, returning the file path, line number, and matching content. Supports regex, plain, and fuzzy modes, respects ignore files, and supports directory scoping.
Why It Matters
When you need to find where a function is defined, track down an error message, locate a configuration value, or understand how a variable is used across a codebase - Grep is the tool. It gives the AI the ability to search through your code the way a developer would, but faster.
Example Prompts
Find everywhere we import the UserService class in this project Search for any hardcoded API keys or secrets in the codebase Find all TODO comments across all source files Show me every file that references the DATABASE_URL environment variable Find all functions that take more than 3 parameters in src/ Example Output
Grep: 'import.*UserService' in src/ Found 6 matches in 4 files: src/api/users.ts:3 import { UserService } from '../services/UserService' src/api/admin.ts:5 import { UserService } from '../services/UserService' src/tests/user.test.ts:2 import { UserService } from '../../services/UserService' ...
Safety & Control
Grep is a read-only search that reads file contents for pattern matching and does not modify files. Approval depends on your selected tool approval mode. Use a specific project or folder path instead of broad roots. Be mindful that search results may reveal sensitive content in files.
vs Other AI Apps
ChatGPT and Claude have no ability to search your codebase. You have to manually find relevant code and paste it into the conversation. Chapeta's Grep tool lets the AI search your files directly - it can find function definitions, trace variable usage, locate error messages, and understand codebases without you doing the legwork.
Related Tools
File Edit
Makes targeted edits to existing files on your Mac. Unlike File Write which repl...
File OperationsFile Read
Reads the contents of any file on your Mac and makes it available to the AI mode...
File OperationsGlob
Finds indexed files and directories with FFF. Use kind=glob for wildcards like *...