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:

  1. When typing just @, the file list correctly shows files from the current working directory
  2. 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

  1. Start Claude Code in directory A (e.g., /home/user/project/subdir)
  2. Change working directory to parent directory B (e.g., /home/user/project) using /add-dir .. and cd ..
  3. Type @ in the message input - observe that files from directory B are shown
  4. Type @c to 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.

View original on GitHub ↗

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