Glob tool description claims modification time sorting but doesn't deliver it

Resolved 💬 2 comments Opened Feb 7, 2026 by williamjameshandley Closed Mar 7, 2026

Description

The Glob tool's description states:

Returns matching file paths sorted by modification time

However, in practice the results are not sorted by modification time. When compared against ls -lt output on the same directory, the ordering is completely different.

Steps to Reproduce

  1. Have a directory with many files modified at different times (e.g. ~/.claude/plans/*.md)
  2. Use the Glob tool with pattern ~/.claude/plans/*.md
  3. Compare the order of results against ls -lt ~/.claude/plans/*.md

Expected Behavior

Files should be returned sorted by modification time (most recent first), as the description states.

Actual Behavior

Files are returned in a different order (appears to be alphabetical or some other ordering). The most recently modified file (polished-conjuring-waffle.md, modified today) was near the bottom of the Glob results, while ls -lt correctly placed it first.

Impact

When users rely on the documented sorting behavior to find recently modified files, they get incorrect results. This led to reading the wrong files when trying to find the most recently updated plan.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗