Glob is not a replacement for find

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

I’m on windows 11 connected to a remotessh session on an Ubuntu machine

Glob tool returns false negatives for existing tracked files (.pdf, .png, .zip), but at the system level instructions theses instructions exist:

Search/read constraints:

  • MUST avoid find and grep; use rg and Glob.
  • MUST avoid cat/head/tail; use ReadFile.
  • If tempted to use grep, stop and use rg first.

Summary
In Cursor agent tooling, Glob reports no matches for files that definitely exist on disk and are tracked by git. This is reproducible in the same directory where Glob successfully returns .properties files, which indicates extension/type-specific false negatives.

Environment

OS: Linux (6.8.0-101-generic)
Workspace: <project_root>
Tooling: Cursor coding agent tools (Glob, ReadFile, shell checks)
Repro Steps

Verify files exist:

ls -l “<project_root>/src/main/resources”
Confirm presence of:

postcard_guideline_6x4_ca.pdf
android-chrome-192x192.png
favicon_io.zip
keystore.p12
Verify tracked by git:

git -C “<project_root>” ls-files –
“src/main/resources/postcard_guideline_6x4_ca.pdf”
“src/main/resources/android-chrome-192x192.png”
“src/main/resources/favicon_io.zip”
“src/main/resources/keystore.p12”
Run Glob queries (via agent tool):

target: <project_root>/src/main/resources, pattern: *.pdf
target: <project_root>/src/main/resources, pattern: postcard_guideline_6x4_ca.pdf
target: <project_root>/src/main/resources, pattern: *.png
target: <project_root>/src/main/resources, pattern: *.zip
Observe: all above return 0 files found.

Control test:

target: <project_root>, pattern: *.properties
returns expected files from same resources directory.
Expected
Glob should return all existing files matching the requested pattern, regardless of extension type.

Actual
Glob returns false negatives for at least .pdf, .png, .zip in this repo/session while returning .properties correctly.

Impact
High. This can cause agents/developers to incorrectly conclude files are missing. It is unsafe for “absence” assertions and can lead to incorrect debugging decisions.

Workaround
Use direct filesystem verification (ls, direct path reads) before asserting absence; do not rely on Glob negatives for non-text/binary extensions.

Evidence Paths

Existing file example:
<project_root>/src/main/resources/postcard_guideline_6x4_ca.pdf
Directory with affected files:
<project_root>/src/main/resources

Steps to Reproduce

Repro Steps

Verify files exist:

ls -l “<project_root>/src/main/resources”
Confirm presence of:

postcard_guideline_6x4_ca.pdf
android-chrome-192x192.png
favicon_io.zip
keystore.p12
Verify tracked by git:

git -C “<project_root>” ls-files –
“src/main/resources/postcard_guideline_6x4_ca.pdf”
“src/main/resources/android-chrome-192x192.png”
“src/main/resources/favicon_io.zip”
“src/main/resources/keystore.p12”
Run Glob queries (via agent tool):

target: <project_root>/src/main/resources, pattern: *.pdf
target: <project_root>/src/main/resources, pattern: postcard_guideline_6x4_ca.pdf
target: <project_root>/src/main/resources, pattern: *.png
target: <project_root>/src/main/resources, pattern: *.zip
Observe: all above return 0 files found.

Control test:

target: <project_root>, pattern: *.properties
returns expected files from same resources directory.

Expected Behavior

Expected
Glob should return all existing files matching the requested pattern, regardless of extension type.

Actual
Glob returns false negatives for at least .pdf, .png, .zip in this repo/session while returning .properties correctly.

Screenshots / Screen Recordings

Operating System

Linux

Version Information

Version: 2.6.11 (user setup)
VSCode Version: 1.105.1
Commit: 8c95649f251a168cc4bb34c89531fae7db4bd990
Date: 2026-03-03T18:57:48.001Z
Build Type: Stable
Release Track: Default
Electron: 39.6.0
Chromium: 142.0.7444.265
Node.js: 22.22.0
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200

For AI issues: which model did you use?

Auto currently using GPT-5.3-codex

For AI issues: add Request ID with privacy disabled

e2c452d7-a77c-408d-a038-0fab5298b985

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report. This is actually expected behavior. The Glob tool relies on Cursor’s codebase index, and binary file types like .pdf, .png, .zip, .jpg, and so on are excluded from indexing by default.

You can see the full default ignore list in the docs: Ignore files | Cursor Docs

To get Glob to find these files, add negation patterns to your .cursorignore in the project root:

!*.pdf
!*.png
!*.zip
!*.p12

This should override the default exclusion and make them visible to the Glob tool.

That said, your point is valid. If the agent is told to use Glob instead of find while Glob silently excludes binary types, it can lead to incorrect “file not found” results. Until you confirm the negation patterns work in your setup, using ls or find in the terminal to check for binary files is a reasonable fallback.

Let me know if adding the negation patterns fixes it.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.