File completion (@) filters using wrong directory after working directory change
Resolved 💬 3 comments Opened Nov 18, 2025 by gl-spratt Closed Jan 20, 2026
Bug Description
When the working directory is changed during a Claude Code session (e.g., using /add-dir), the file completion feature using @ behaves inconsistently:
- When typing just
@, the file list correctly shows files from the current working directory - However, when typing additional characters to filter (e.g.,
@c), the completion system incorrectly reverts to showing files from the original working directory where Claude Code was started
Steps to Reproduce
- Start Claude Code in directory A (e.g.,
/home/user/project/subdir) - Change working directory to parent directory B (e.g.,
/home/user/project) using/add-dir ..andcd .. - Type
@in the message input - observe that files from directory B are shown - Type
@cto filter - observe that completion now shows files from directory A instead of B
Expected Behavior
File completion should consistently use the current working directory throughout the filtering process. Both the initial @ listing and subsequent filtered results should show files from the same directory.
Actual Behavior
The initial @ listing shows files from the current working directory, but filtering reverts to the original working directory, making it impossible to autocomplete file references in the new directory.
Environment
- OS: Fedora Linux 43
- Claude Code version: Latest (as of 2025-11-18)
Workaround
Users can manually type file paths without autocomplete, or use relative paths from the original directory.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗