Master fs_search for blazing-fast code search (10-100x faster than grep). WHEN: User mentions "search", "find", "grep", "locate code/files", needs to discover patterns, asks "where is", "which files contain". WHEN NOT: Reading specific known file paths (use fs_read_file), listing directory contents (use fs_list_directory).
/plugin marketplace add cyrup-ai/kodegen-claude-plugin/plugin install kg@kodegenThis skill inherits all available tools. When active, it can use any tool Claude has access to.
mcp__plugin_kg_kodegen__fs_search is built on ripgrep - the fastest code search tool available (10-100x faster than grep). It automatically respects .gitignore, supports regex and literal search, handles multiline patterns, and can run searches in the background.
search_in)"content" (default): Search inside file contents
{search_in: "content", pattern: "fn getUserData"}"filenames": Search file names/paths only
{search_in: "filenames", pattern: "package.json"}return_only)"matches" (default): Full details with line numbers and matched content
"paths": Just unique file paths (like rg -l)
"counts": Match counts per file (like rg -c)
These combine independently: any search_in works with any return_only.
User: "find package.json" or "locate Cargo.toml" or "which files are *.rs"
Use:
{
"search_in": "filenames",
"pattern": "package.json"
}
{
"search_in": "filenames",
"pattern": "\\.rs$"
}
User: "where is getUserData function" or "find TODO comments"
Use:
{
"search_in": "content",
"pattern": "fn getUserData"
}
{
"search_in": "content",
"pattern": "TODO"
}
User: "which files have errors" or "list files with console.log"
Use:
{
"search_in": "content",
"pattern": "error",
"return_only": "paths"
}
{
"search_in": "content",
"pattern": "console\\.log",
"return_only": "paths"
}
User: "how many TODOs per file" or "count import statements"
Use:
{
"search_in": "content",
"pattern": "TODO",
"return_only": "counts"
}
{
"search_in": "content",
"pattern": "^import",
"return_only": "counts"
}
Set to true when searching for code with special regex characters:
// ❌ WRONG - regex interprets . and () as special chars
{"pattern": "toast.error('test')"}
// ✅ CORRECT - literal string match
{"pattern": "toast.error('test')", "literal_search": true}
// ❌ WRONG - brackets are regex character class
{"pattern": "array[0]"}
// ✅ CORRECT - literal bracket match
{"pattern": "array[0]", "literal_search": true}
Rule: If searching for actual code symbols like ., (, ), [, ], {, }, use literal_search: true.
Controls pattern matching boundaries:
null (default): Match anywhere (substring)
"test" matches in testing, attest, test()"word": Match whole words only (uses \b anchors)
"test" matches test() but NOT testing or attest"line": Match complete lines only (uses ^$ anchors)
// Match whole word "test" (not "testing")
{
"pattern": "test",
"boundary_mode": "word"
}
"sensitive": Exact case matching"insensitive": Case-insensitive search"smart": Insensitive if pattern is all lowercase, sensitive otherwise// Case-insensitive search
{
"pattern": "error",
"case_mode": "insensitive"
}
// Matches: error, Error, ERROR, ErRoR
Filter files by glob pattern:
// Only JavaScript and TypeScript
{"file_pattern": "*.{js,ts}"}
// Only Rust files
{"file_pattern": "*.rs"}
// Only Python test files
{"file_pattern": "test_*.py"}
Use ripgrep's built-in file type definitions:
// Only Rust and Python files
{"type": ["rust", "python"]}
// Exclude tests and JSON
{"type_not": ["test", "json"]}
Common types: rust, python, javascript, typescript, json, markdown, yaml, toml
IMPORTANT: This parameter ONLY works with search_in: "filenames". It has NO effect on content searches.
Control how filename patterns are interpreted:
// Auto-detection (default)
{
"search_in": "filenames",
"pattern": "*.md"
}
// → Auto-detected as Glob, matches: README.md, NOTES.md
// Force regex interpretation
{
"search_in": "filenames",
"pattern": "test.*",
"pattern_mode": "regex"
}
// → Regex mode, matches: test.js, test123.md, testing.txt
// Force substring (literal match)
{
"search_in": "filenames",
"pattern": "*.md",
"pattern_mode": "substring"
}
// → Substring mode, matches ONLY files literally named "*.md"
// Force glob interpretation
{
"search_in": "filenames",
"pattern": "lib",
"pattern_mode": "glob"
}
// → Glob mode, uses shell-style matching
Auto-Detection Priority: Regex > Glob > Substring
Detection Rules:
^, $, \., \d, \w, .*, .+, |, [...]+, {n,m}*, ?, **, {a,b}, [abc] (without regex markers)Common Use Cases:
// Find markdown files (auto-detected as glob)
{"search_in": "filenames", "pattern": "*.md"}
// → pattern_type: "glob"
// Find files starting with "test" (auto-detected as regex)
{"search_in": "filenames", "pattern": "^test"}
// → pattern_type: "regex"
// Find files containing "config" (auto-detected as substring)
{"search_in": "filenames", "pattern": "config"}
// → pattern_type: "substring"
// Override: match literal "*.md" filename
{"search_in": "filenames", "pattern": "*.md", "pattern_mode": "substring"}
// → pattern_type: "substring", matches file literally named "*.md"
Output Field: pattern_type
Every filename search response includes pattern_type showing how the pattern was interpreted:
{
"pattern": "*.rs",
"pattern_type": "glob",
"search_in": "filenames",
"results": [...]
}
This helps you understand:
pattern_modeCombine these for 10-100x speedup:
{
"path": "/large-monorepo",
"pattern": "config",
"max_depth": 3,
"max_filesize": 1048576,
"type_not": ["json", "lock"]
}
Why this works:
max_depth: 3-4 avoids deep dependency trees (node_modules, vendor, target)max_filesize: 1048576 (1MB) skips huge generated files (minified bundles, lock files)type or file_pattern reduces the number of files to searchPerformance gains:
max_depth alone: 10-25x fastermax_filesize alone: 10-30x fasterFor searches that might take a while:
{
"path": "/huge-repo",
"pattern": "deprecated",
"await_completion_ms": 10000,
"search": 0
}
Behavior:
{action: "READ", search: 0}Enable with multiline: true to search across lines:
{
"pattern": "struct Config \\{[\\s\\S]*?version",
"multiline": true
}
Matches:
struct Config {
port: u16,
version: String,
}
Use cases:
Extract specific parts instead of whole lines:
{
"pattern": "https?://[^\\s]+",
"only_matching": true
}
Returns just the URLs, not the entire lines containing them.
Perfect for extracting:
{
"pattern": "fn \\w+\\(",
"search_in": "content",
"file_pattern": "*.rs"
}
{
"pattern": "(TODO|FIXME)",
"search_in": "content",
"return_only": "paths"
}
{
"pattern": "\\.tsx?$",
"search_in": "filenames"
}
{
"pattern": "^import",
"return_only": "counts"
}
{
"pattern": "if (user?.role === 'admin')",
"literal_search": true
}
{
"pattern": "test",
"boundary_mode": "word"
}
{
"pattern": "(Error|panic!|unwrap|expect)",
"file_pattern": "*.rs"
}
{
"pattern": "(GET|POST|PUT|DELETE).*\\/api\\/",
"search_in": "content"
}
| Goal | Tool | Why |
|---|---|---|
| Find code pattern | fs_search (content) | Fast, regex support, respects .gitignore |
| Find specific file | fs_search (filenames) | Faster than glob when path unknown |
| List directory | fs_list_directory | Simple, one-level listing |
| Read known file | fs_read_file | Direct access, supports offset/length |
| Search + read | fs_search → fs_read_multiple_files | Parallel reads after discovery |
literal_search: truecase_mode: "insensitive"file_pattern or type isn't too restrictiveno_ignore: true to overridemax_depth: 3 to limit directory traversalmax_filesize: 1048576 to skip huge filesfile_pattern or type to filter file typesawait_completion_ms: 0. * + ? [ ] { } ( ) | ^ $literal_search: truemultiline: trueboundary_mode if neededpattern_mode: "regex", "glob", or "substring"search_in: "filenames", not content searchpattern_mode: "substring" or literal_search: true// Basic content search
{
"path": "/project",
"pattern": "getUserData"
}
// Find files by name
{
"path": "/project",
"search_in": "filenames",
"pattern": "config"
}
// Get file list only
{
"path": "/project",
"pattern": "TODO",
"return_only": "paths"
}
// Literal search (exact match)
{
"path": "/project",
"pattern": "array[0]",
"literal_search": true
}
// Performance optimized
{
"path": "/project",
"pattern": "error",
"max_depth": 3,
"max_filesize": 1048576,
"type": ["rust"]
}
literal_search: truesearch_in: "filenames" for file namesreturn_only: "paths" for file lists onlyno_ignore: true to overrideCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.