Troubleshooting

Atlas glob tool: "glob path must be a directory: <path>"

Updated 7 min read

Atlas glob fails with "glob path must be a directory: <path>" because GlobTool stats the resolved search path and rejects it when the type is File, since the path is the search root and not the pattern. The fix is to pass the directory to search in `path`, and the file pattern in `pattern`. To match a single file, use a pattern like `**/name.ts` from the project root rather than putting the filename in `path`. You can also omit `path` entirely to search from the instance directory, and if what you actually want is to search file contents rather than names, use grep instead of glob.

Why does Atlas say "glob path must be a directory"

Atlas says "glob path must be a directory: <path>" because GlobTool stats the resolved search path and rejects it when the type is File. GlobTool takes 2 parameters, `path` and `pattern`: `path` is the search root glob walks from, and a file is not a place you can walk from.

The mistake is a role confusion between two parameters. GlobTool takes a root and a pattern: the root says where to look, the pattern says what to match. When a filename lands in the root slot, glob is being asked to enumerate the contents of a file as if it were a directory, which is meaningless. Rather than returning an empty list and letting you wonder why your file was not found, GlobTool stats the path, sees a File, and says so. The message names the path it stated, so the offending argument is right there in the error, which makes this one of the faster tool errors to diagnose.

How to fix the Atlas glob path error

Fix the Atlas glob error by moving the filename out of `path` and into `pattern`. Pass the directory to search in `path`, and the file pattern in `pattern`. To find 1 specific file, use a pattern like `**/name.ts` from the project root and leave `path` as a directory or omit it.

The `**/name.ts` form is the one to memorize, because it covers the case people are usually trying to express when they put a filename in `path`. The `**/` prefix means any depth of directory, so the pattern finds the file wherever it lives in the tree without you needing to know its parent. That is almost always what you wanted: you know the filename, you do not know the folder, and that is exactly the gap glob was built to close. Omitting `path` entirely is the simplest correct call when you have no reason to narrow the root. The search then starts from the instance directory, and the pattern does all the work.

When to omit the Atlas glob path parameter

Omit the `path` parameter in Atlas glob whenever you do not need to scope the search root. With `path` omitted, glob searches from the instance directory, and the pattern alone decides what matches. 1 fewer argument means 1 fewer chance to pass the wrong kind of value.

Setting `path` is worth doing when the repository is large and you know the file lives under one package or one subtree, because narrowing the root makes the search cheaper and the results more relevant. Setting it out of habit, on a call where you do not actually know the directory, is how a filename ends up in the root slot in the first place. The rule of thumb: set `path` only when you can name the directory with confidence. Otherwise leave it out and let the pattern find the file. Atlas indexes code by AST declarations using tree-sitter, not blind line windows, so once glob hands you a real path, the deeper search tools have plenty to work with.

Should I use glob or grep in Atlas

Use Atlas glob when you are looking for files by name, and use grep when you are looking for code by content. Those are 2 different questions, and passing a filename to glob's `path` parameter usually means you wanted to look inside that file, which is grep's job.

The distinction is worth internalizing because it eliminates the error entirely rather than fixing it after the fact. Glob answers "where is the file called X". Grep answers "which lines say X". If your goal is to find a function definition, a config key, or an error string, glob is the wrong door no matter how you shape the arguments, and grep gets you there in one call. Atlas searches code with hybrid semantic and keyword retrieval fused by reciprocal rank fusion, so content search is a first-class capability rather than a fallback. Reach for names with glob, contents with grep, and the "glob path must be a directory" error stops appearing.

How to verify the Atlas glob fix worked

Verify the Atlas glob fix by re-running the tool. A correctly shaped call returns a list of matching file paths and does not print "glob path must be a directory: <path>". If the call succeeds but returns 0 files, the arguments are now valid and the pattern is simply not matching.

Those are two different states and it is worth telling them apart. A rejected call means the search root was wrong. An empty result means the search root was fine and the pattern found no files, which points at the pattern rather than the path. Widen the pattern, add a `**/` prefix so it matches at any depth, or drop the `path` scope so the search covers the whole instance directory. If a pattern that should obviously match still returns nothing, check that the file is not excluded by a permission rule, since every Atlas tool call is permission-gated against allow, ask, and deny rules before it runs.

How to fix it

  1. 01Pass the directory to search in `path`, and the file pattern in `pattern`. The two parameters have different jobs and are not interchangeable.
  2. 02To match a single file, use a pattern like `**/name.ts` from the project root instead of naming the file in `path`.
  3. 03Omit `path` entirely to search from the instance directory when you do not need to scope the search root.
  4. 04Use grep instead if you want to search file contents rather than names.
  5. 05Re-run glob and confirm the tool returns matching file paths.

Frequently asked questions

what does glob path must be a directory mean in Atlas
Atlas's GlobTool stats the resolved search path and rejects it when the type is File. The `path` parameter is the search root, so passing a filename to it is invalid.
how do I search for one specific file with Atlas glob
Use a pattern like `**/name.ts` from the project root. Put the filename in `pattern`, not in `path`, and leave `path` as a directory or omit it entirely.
what is the difference between path and pattern in Atlas glob
`path` is the directory glob searches from, the search root. `pattern` is the file glob it matches names against. Putting a filename in `path` produces the glob path must be a directory error.
can I omit the path parameter in Atlas glob
Yes. Omit `path` entirely to search from the instance directory. That is the simplest correct call when you do not need to narrow the search root.
should I use glob or grep to search code in Atlas
Use glob to find files by name and grep to search file contents. If you want to search inside a file rather than locate it, grep is the right tool.
why does my Atlas glob return no results after I fixed the path
A valid call that returns nothing means the pattern is not matching, not that the path is wrong. Widen the pattern, add a `**/` prefix so it matches at any depth, or remove the `path` scope.
how do I confirm my Atlas glob call is fixed
Re-run it. A correctly shaped call returns matching file paths and no longer prints glob path must be a directory: <path>.

Try Atlas in your terminal

The terminal-native AI coding agent. Free core, single binary.

Install Atlas

Related guides

Atlas with Mistral 7B v0.3 (Ollama): The Predictable Local Baseline in 2026

Run Atlas on Mistral 7B v0.3 (Ollama): a 4.4GB Apache 2.0 model with a 32K context, free self-hosted. Setup, tradeoffs, and when to pick a stronger coder.

Atlas with Mixtral 8x22B: The Largest Open MoE of Its Era in 2026

Mixtral 8x22B scaled the MoE idea in April 2024: 64,000 tokens at $2.00 / 1M input tokens and $6.00 / 1M output tokens. Atlas setup, self-hosting, and honest limits.

Atlas for Quarkus in 2026

Atlas is a terminal-native AI coding agent for Quarkus in 2026. It reads CDI beans and JAX-RS resources, then runs ./mvnw test behind a permission prompt.

Atlas vs. Goose: Choosing Your AI Coding Agent in 2026

Compare Atlas and Goose for 2026. Atlas offers terminal-native TUI and code-specialized features. Goose provides shareable Recipes and 70+ MCP extensions for general agentic workflows.

Atlas for Spring in 2026

Atlas, the terminal native AI coding agent, empowers Spring developers in 2026 with intelligent code assistance, secure local embeddings, and transparent review processes for enhanced productivity.

Write Unit Tests for Untested Code with Atlas in 2026

How to write unit tests for untested code with Atlas in 2026: the lsp tool enumerates exported symbols, grep copies repo conventions, and bash actually runs the suite.

Atlas with Llama 4 Maverick: 1M Context on Open Weights in 2026

Llama 4 Maverick gives Atlas a 1M token context on open weights at $0.24 / $0.97 per Mtok on Bedrock or $0.20 / $0.80 on DeepInfra. Setup, tradeoffs, and fit.

Document a Module with a README Using Atlas (2026 Workflow)

How to document a module with a README using Atlas in 2026: the lsp tool's documentSymbol enumerates the real exports, read supplies the behavior, write emits the README.

Browse this resource hub