[FEATURE] @ autocomplete should fall back to filesystem when git index is unavailable

Resolved 💬 3 comments Opened Mar 11, 2026 by dprothero Closed Mar 15, 2026

Summary

The @ file path autocomplete in the CLI is currently limited to files tracked by git. This means:

  1. Outside a git repo: only directories are suggested, no files
  2. Inside a git repo: only tracked files are suggested — .gitignored files (e.g., .env, node_modules/*, build outputs) are not available
  3. Files outside the repo: not reachable via @ autocomplete even when added via /add-dir

Expected Behavior

When the git file index doesn't cover a path, @ autocomplete should fall back to filesystem-based completion (similar to shell TAB completion). This would allow referencing:

  • Files in non-git directories
  • .gitignored files within a repo
  • Files outside the current repo (especially those in directories added via /add-dir)

Current Workaround

Manually type or paste the full file path.

Environment

  • Claude Code CLI v2.1.68 on macOS (Darwin 25.2.0)

View original on GitHub ↗

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