1Find files by name or path pattern. Use this instead of `find` command.
2
3<when_to_use>
4Use Glob when:
5- Finding files by name: "*.go", "config.*"
6- Finding files in specific directories: "src/**/*.ts"
7- Locating test files, configs, or specific extensions
8
9Do NOT use Glob when:
10- Searching file contents → use `grep`
11- Need file contents → use `view` after finding
12- Looking for symbol definitions → use `lsp_references`
13</when_to_use>
14
15<parameters>
16- pattern: Glob pattern to match (required)
17- path: Starting directory (default: current directory)
18</parameters>
19
20<pattern_syntax>
21- `*` matches any characters except path separator
22- `**` matches any characters including path separators
23- `?` matches single character
24- `{a,b}` matches alternatives
25- `[abc]` matches character class
26</pattern_syntax>
27
28<examples>
29`"*.go"` → Go files in current directory
30`"**/*.go"` → Go files anywhere in tree
31`"src/**/*.{ts,tsx}"` → TypeScript files in src
32`"**/test_*.py"` → Python test files anywhere
33`"config.*"` → Any file named config with any extension
34</examples>
35
36<output>
37- Returns file paths sorted by modification time (newest first)
38- Limited to 100 files
39- Hidden files (starting with '.') skipped
40</output>
41
42<tip>
43Combine with grep for efficient search: glob to find candidate files, grep to search their contents.
44</tip>