Support absolute paths and `~` expansion in `@` file mentions/fuzzy search

Open 💬 1 comment Opened Feb 17, 2026 by KaminariOS

What feature would you like to see?

Support absolute paths and ~ (home) expansion in @ file mentions / fuzzy file search in Codex TUI (and ideally aligned behavior in app-server fuzzy search).

Examples that should work:

  • @/home/alice/project/src/main.rs
  • @~/project/src/main.rs
  • @~/project/src/mai (fuzzy completion)

Why this matters

Today, @ search works well for relative-in-workspace paths, but fails for common path forms users type from shell habit:

  • absolute filesystem paths
  • home-relative paths using ~

This creates friction when referencing files outside current relative context or when users naturally paste absolute paths from terminal/editor.

Current behavior (from source)

From codex-rs current main:

  • @token query is forwarded as raw text (no path normalization / tilde expansion).
  • file-search indexes and returns relative paths from search roots.
  • selected popup match inserts that relative path.

So @~/... is treated literally and absolute-prefix query matching is not first-class.

Suggested behavior

  1. Recognize and normalize path-like @ queries before fuzzy matching:
  • expand ~ to user home
  • detect absolute paths
  • normalize separators and dot segments
  1. Resolve query against active search roots:
  • if query points inside a configured root, fuzzy-match the relative suffix within that root
  • if query resolves outside current roots, either:
  • show a clear "outside search roots" message, or
  • optionally propose/add as an extra search root (future enhancement)
  1. Preserve current behavior for plain fuzzy tokens (non path-like input).

Nice-to-have

  • Add tests for:
  • @~/... expansion
  • absolute path inside root
  • absolute path outside root
  • mixed separator cases (Windows + POSIX)
  • Align app-server fuzzy file search semantics with TUI for consistency.

Additional information

Related existing issues around @ search UX:

  • #1261 (support @ fuzzy file search)
  • #2867 (default list UX)
  • #8863 (directory selection)
  • #2952 (gitignore scope)

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗