[BUG] Glob tool silently fails with absolute paths (macOS - cross-platform issue)

Status Fixed / completed
Maintainer reply None cached
Activity 6 comments · opened Dec 9, 2025 · closed Dec 14, 2025

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Glob fails silently when using absolute paths with wildcards in the pattern
parameter on macOS. This is the same issue as #10337 (Windows), proving it's not a
Windows-specific backslash escaping problem - it's a cross-platform bug in how Glob
handles absolute paths.

Working directory: /Users/alex/src/afk
File exists: /Users/alex/src/afk/docs/analysis/product-brief-afk-2025-12-09.md

Glob("/Users/alex/src/afk/docs/analysis/brief.md") → "No files found"
Glob("docs/analysis/brief.md") → finds the file

What Should Happen?

Either:

  1. Absolute paths should work in the pattern parameter, OR
  2. The tool should return an error/warning explaining that only relative paths are

supported

Silent failure is the worst outcome - agents make incorrect decisions based on
incomplete information.

Error Messages/Logs

No files found

  No error, no warning. Just empty results.

Steps to Reproduce

  1. Have a file at an absolute path, e.g. /Users/alex/src/project/docs/file.md
  2. Working directory is /Users/alex/src/project
  3. Run: Glob("/Users/alex/src/project/docs/*.md") → Returns "No files found"
  4. Run: Glob("docs/*.md") → Successfully finds the file

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.62 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Impact

In my case, a workflow missed an existing product brief document and incorrectly
reported a "greenfield project" with zero input documents. The agent proceeded with
wrong assumptions because Glob silently returned empty results.

Related Issues

  • #10337 - Same bug on Windows. That issue assumes backslash escaping is the cause,

but this macOS reproduction proves it's a fundamental issue with absolute paths, not
Windows-specific escaping.

View original on GitHub ↗

6 Comments

github-actions[bot] · 10 months ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/10337

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

aleksadvaisly · 10 months ago

I can confirm, it doesn't work on MacOS (newest 2.0.62 (Claude Code)). I had few files and none of them was found using:

⏺ Search(pattern: "/Users/developer/Projects2/system/docs/migration_*_howto.md")
⎿  Found 0 files

⏺ Search(pattern: "/Users/developer/Projects2/system/docs/howto.md")
⎿  Found 0 files

Claude had to try once more with following:

⏺ Bash(ls -la /Users/developer/Projects2/system/docs/*.md 2>/dev/null | head -20)

So in the end it achieves goal, but wastes time, context and credits at the same time

For me this is like "one million dollar" waste due to "thank you" prompt problem

I guess wildcard can't be in the middle of filename. Wildcard is treated as token, not a part of filename. I guess ? doesn't work either. Looks like regression, due to missing unit tests.

n0cloud · 10 months ago

I can confirm on linux too.

● Search(pattern: "**/*epic*")
  ⎿  Found 8 files (ctrl+o to expand)

● Search(pattern: "**/epics/**")
  ⎿  Found 12 files (ctrl+o to expand)

● Search(pattern: "**/epic*.md", path: "~/projects/redacted")
  ⎿  Found 7 files (ctrl+o to expand)

● Search(pattern: "**/epics/**/*.md", path: "~/projects/redacted")
  ⎿  Found 12 files (ctrl+o to expand)

● Search(pattern: "/home/nocloud/projects/redacted/**/epic*.md")
  ⎿  Found 0 files 

● Search(pattern: "/home/nocloud/projects/redacted/**/*epic*.md")
  ⎿  Found 0 files 

● Search(pattern: "/home/nocloud/projects/redacted/docs/**/*.md")
  ⎿  Found 0 files 
alexeyv · 10 months ago

And here is an example of shenanigans that this leads to. Which makes me think that the severity of this problem, for my situation at least, is high, borderline critical.

⏺ Good. Now let me execute the discover_inputs protocol to load project documents,
  then begin Step 1.

⏺ Search(pattern: "/Users/alex/src/afk/docs/*prd*.md")
  ⎿  Found 0 files

⏺ Search(pattern: "/Users/alex/src/afk/docs/*prd*/*.md")
  ⎿  Found 0 files

⏺ Search(pattern: "/Users/alex/src/afk/docs/*epic*.md")
  ⎿  Found 0 files

⏺ Search(pattern: "/Users/alex/src/afk/docs/*epic*/*.md")
  ⎿  Found 0 files

⏺ Search(pattern: "/Users/alex/src/afk/docs/*architecture*.md")
  ⎿  Found 0 files

⏺ Search(pattern: "/Users/alex/src/afk/docs/*architecture*/*.md")
  ⎿  Found 0 files

⏺ Search(pattern: "/Users/alex/src/afk/docs/*ux*.md")
  ⎿  Found 0 files

⏺ Search(pattern: "/Users/alex/src/afk/docs/*ux*/*.md")
  ⎿  Found 0 files

⏺ Search(pattern: "/Users/alex/src/afk/docs/tech-spec*.md")
  ⎿  Found 0 files

⏺ Search(pattern: "/Users/alex/src/afk/docs/index.md")
  ⎿  Found 0 files
  ⎿  Interrupted · What should Claude do instead?

> You aren't finding anything because Anthropic broke the Globe tool. Use Bash with
`find` or `rg`.

⏺ Got it. Let me use bash to find the project documents.

⏺ Bash(find /Users/alex/src/afk/docs -type f -name "*.md" 2>/dev/null | head -50)
  ⎿  /Users/alex/src/afk/docs/project_coxt.md
     /Users/alex/src/afk/docs/prd.md
     /Users/alex/src/afk/docs/architecture.md
     … +6 lines (ctrl+o to expand)

⏺ Found them. Now loading the core project documents:
alexeyv · 10 months ago

This appears to be fixed in Claude Code v2.0.69. Tested with multiple absolute path + wildcard patterns and all returned correct results. Thanks for the fix!

github-actions[bot] · 9 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.