@file picker shows incorrect relative paths in git repo subdirectories

Resolved 💬 3 comments Opened Jan 16, 2026 by unthingable Closed Jan 20, 2026

Description

When working in a subdirectory of a git repository, the @ file autocomplete displays paths with incorrect ../ prefixes that don't resolve to the actual files being matched.

Environment

  • OS: macOS (Darwin 24.6.0)
  • Shell: zsh

Reproduction Steps

  1. Have a git repository with nested subdirectories (monorepo structure):

``
/repo-root/ # git root
└── a/b/c/ # working directory (3 levels deep)
└── reference/ # target directory
└── subdir/
``

  1. Launch Claude Code from the nested subdirectory:

``bash
cd /repo-root/a/b/c
claude
``

  1. Type @re to autocomplete a reference to the local reference/ directory

Expected Behavior

Autocomplete should show:

+ reference/
+ reference/subdir/

Or equivalently:

+ ./reference/
+ ./reference/subdir/

Actual Behavior

Autocomplete shows paths with inverted ../ depth:

+ ../../../reference/
+ ../../../reference/subdir/

The number of ../ segments (3) matches the depth from git root to cwd, suggesting the path computation is using git root as a reference point incorrectly.

Note: The correct files are being found (the subdirectories match what exists locally), but the displayed paths are wrong and would resolve to a non-existent location at the git root level.

Workarounds

  • Use absolute paths: @/full/path/to/reference/
  • Type the path manually without relying on autocomplete: @./reference/

Additional Context

  • The local directory structure has a .claude/ folder with settings.local.json
  • Multiple CLAUDE.md files exist in the repo hierarchy (git root, intermediate dirs, and cwd)
  • The git repo is a monorepo with multiple projects

View original on GitHub ↗

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