.claudeignore is not respected by Glob/Grep tools — only affects auto-context loading
Status Closed — duplicate
Reported on v2.1.101
Maintainer reply None cached
Activity 2 comments · opened Apr 11, 2026 · closed Apr 11, 2026
Summary
.claudeignore entries are ignored when Claude explicitly calls Glob or Grep tools.
The file only affects automatic context loading, not tool-based file searches.
Environment
- Claude Code version: 2.1.101
- OS: macOS 25.4.0 (Darwin)
- Shell: zsh
.claudeignore content
\\\`
Virtual environment — large, not needed for analysis
.venv/
venv/
__pycache__/
\\\`
Steps to Reproduce
- Add
.venv/to.claudeignore - Ask Claude to find test files (e.g., "run tests" or "find test files")
- Claude calls
Globwith pattern**/test_*.py - Results include
.venv/lib/.../test_*.pyfiles —.claudeignoreis not applied
Expected Behavior
Glob and Grep tools should respect .claudeignore and exclude matching paths from results.
Actual Behavior
.venv/ entries appear in Glob/Grep results despite being listed in .claudeignore.
Example paths returned:
.venv/lib/python3.14/site-packages/Cryptodome/SelfTest/Util/test_number.py.venv/lib/python3.14/site-packages/Cryptodome/SelfTest/Signature/test_eddsa.py.venv/lib/python3.14/site-packages/Cryptodome/SelfTest/Hash/test_SHA256.py
Impact
- Claude wastes context window on irrelevant third-party package files
- Test discovery may incorrectly include third-party package tests
- Users have no reliable way to exclude directories from Glob/Grep tool searches
.claudeignorebehavior is inconsistent and misleading — works for auto-context but not tool calls
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗