fs.glob
Usage
fs.glob(pattern)
pattern- A path pattern supporting
*,?, and character classes such as[a-z]. Wildcards do not cross directory separators. Recursive**matching is not supported.
Returns a sorted list of matching paths, or an empty list if nothing matches.
Relative patterns return paths relative to the script's working directory;
absolute patterns, and patterns that start with ~, return absolute paths. Returned paths use forward slashes.
Hidden files are included when they match. Invalid patterns fail; directory
read errors are ignored, matching Go's filesystem glob behavior.
for path in fs.glob(".claude/agents/*.md"):
print(path)
A leading ~ expands to the home directory. Relative paths resolve against the
script's working directory, including when called from a loaded module. Absolute
paths are used as given. These functions
inspect the local filesystem; they do not isolate access to the repository.
Calls honor cancellation before and after the filesystem operation.
See reading files and Git hooks.