Glob tool does not follow symbolic links

Open 💬 8 comments Opened Jan 6, 2026 by AlexanderBartash

Summary

The Glob tool does not traverse symbolic links to directories. When a symlink points to a directory containing files, patterns like symlink/* or symlink/**/* return "No files found".

Reproduction Steps

  1. Create a directory with files:

``bash
mkdir -p /tmp/test-dir
echo "test" > /tmp/test-dir/file.txt
``

  1. Create a symlink in your project:

``bash
ln -sf /tmp/test-dir symlink
``

  1. Try to glob through the symlink:
  • Glob pattern: symlink/*No files found
  • Glob pattern: symlink/*.txtNo files found
  • Glob pattern: symlink (the symlink itself) → No files found
  1. Compare with direct path:
  • Glob pattern: * in /tmp/test-dirFinds file.txt
  1. Compare with Read tool:
  • Read: <project>/symlink/file.txtWorks correctly

Expected Behavior

Glob should follow symlinks by default (similar to find -L, standard glob libraries, or ripgrep's default behavior), or provide an option to enable symlink following.

Actual Behavior

  • Glob ignores symlinked directories entirely
  • Cannot match files inside symlinked directories
  • Cannot even match the symlink name itself as a pattern

Use Case

In GitHub Actions workflows (e.g., claude-code-action), we create symlinks to temp directories containing contextual data (JIRA tickets, Confluence pages). The CLAUDE.md instructions reference these symlinked paths with glob patterns, which fail silently:

# In GitHub Actions workflow
- name: Create guideline symlinks
  run: |
    ln -sf "$RUNNER_TEMP/atlassian" 'atlassian'
<!-- In CLAUDE.md -->
Check if "atlassian" directory exists. If so, read atlassian/*.xml files...

This pattern works for the Read tool but fails for Glob, creating an inconsistency between tools.

Suggested Solution

Either:

  1. Follow symlinks by default (most intuitive, matches other tools)
  2. Add a followSymlinks: true parameter to the Glob tool
  3. Document the limitation clearly

Environment

  • Claude Code CLI (latest via npm)
  • Linux (Ubuntu)
  • Also likely affects macOS

View original on GitHub ↗

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