Glob Tool - Claude Code
File discovery via pattern matching across the repository.
Glob finds files by path pattern. It's the fastest way to answer "where are all the X files?" in a repo.
What it does
Glob accepts shell-style patterns like **/*.ts or src/components/*.tsx and returns matching paths. It's fast, respects .gitignore, and works well as a pre-step before a Grep or a batch of Reads. You can scope it to a subdirectory to narrow the search.
When to use it
- Locating all files of a type (
**/*.md,**/*.yaml). - Finding the right entry point before reading.
- Generating a worklist for a large refactor.
- Confirming a file was actually written.
Gotchas
- Glob does not search file contents - use Grep for that.
- Patterns are case-sensitive on most filesystems.
- Hidden files (
.env, dotfiles) need an explicit pattern like.*or**/.*.
Official docs: https://code.claude.com/docs/en/tools-reference.md
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
Was this helpful?




