Skip to content
BENIBIX Learn

Glob Tool

AI⌨️ Claude CodeBuilt-in Tools

Also known as Glob, **/*.js, File name pattern

The tool that finds files whose names match a pattern.

Think of it like

It is like asking for all the books with blue covers.

Example

Jack asks where the tests are. Claude searches for the pattern **/*.test.ts and gets a list of every test file in the project.

Why it matters

Finding the right files is the first step of almost any change.

Definition

The Glob tool finds files by their names, using a pattern such as **/*.js for every JavaScript file. It lists up to 100 files, newest first. It does not skip the files your .gitignore hides. On Windows it is on by default. On macOS and Linux, Claude Code leaves it out and Claude uses the find command through Bash instead. You get it back by naming it in --allowedTools.

Example code

bash
claude --allowedTools "Glob" "Grep"
Bring Glob and Grep back on macOS or Linux.
Glob finds files by name, as the first step.

Common mistake

Expecting it to search inside files. Glob matches names only. Grep looks inside.

Key takeaways

  1. 1
    Names only. Not contents.
  2. 2
    Up to 100 files. Newest first.
  3. 3
    Off by default. On macOS and Linux.

Compare

Learn it properly