Skip to content

Support shell-like path autocomplete directly in the composer #14673

Open

Description

@oxysoft

Summary

Codex should support shell-like path autocomplete directly in the composer when the user types path-shaped tokens such as:

  • /...
  • ~/...
  • ../...
  • ./...

This should feel like a first-class terminal/editor affordance, not something limited to @ file mentions.

Problem

There are already path-adjacent behaviors in Codex, but they feel fragmented:

What still seems missing is one coherent composer-level behavior:

If the user is literally typing a path in the message body, Codex should help complete it.

Today that shell reflex is broken or at least not clearly supported in a consistent way.

Requested behavior

When the caret is inside a path-like token in the composer, Codex should offer path completion.

Examples:

  • typing ~/Doc should suggest ~/Documents/...
  • typing /home/al should suggest matching filesystem paths
  • typing ../src/om should suggest matching relative paths
  • typing ./references/ should enumerate entries under that directory

This should work for common path forms:

  • absolute paths
  • ~ home-relative paths
  • relative paths
  • dot-segment paths

UX notes

  • the completion surface should feel shell-like and low-friction
  • path normalization / tilde expansion should be predictable
  • directory completions should clearly distinguish files vs directories
  • completion should not be restricted to @ mentions if the user is plainly typing a path inline

Tab / keybinding behavior

This likely needs to be designed together with #12939.

If Tab is used for path completion, it should not accidentally queue/send prompts.

Possible solutions:

  • use Tab for completion when the caret is inside a path-like token
  • otherwise preserve the existing queue behavior
  • or make the binding configurable / mode-aware

Why this matters

This is basic terminal/editor parity.

Users constantly type paths from shell habit. When Codex lives in a terminal and yet does not meet that reflex cleanly, the product feels behind obvious expectations.

The terminal composer should feel like a place where file paths are native objects.

Related issues

Invitation

Would be good to discuss:

  • whether this should share one backend with @ mention completion
  • what the right completion UI is when both file mentions and plain inline paths are possible
  • how Tab / Shift+Tab / alternate completion keys should behave

Activity

  1. oxysoft commented on Mar 14, 2026

    @oxysoft
    Author

    Related tracker context:

    Those issues cover nearby fragments. This issue is the broader composer-level ask: shell-like path completion for inline path-shaped tokens such as /..., ~/..., ../..., and ./..., not just @ mention flows.

  2. added
    enhancement
    CLI
    TUI
    on Mar 14, 2026
  3. github-actions commented on Mar 14, 2026

    @github-actions
    Contributor
  4. parasyte commented on Mar 14, 2026

    @parasyte

    The heuristic for this feature request is incomplete. If I start typing src/, it would be a path that does not match the proposed patterns. The @ prefix is an inexpensive alternative to heuristic logic that doesn't have false negatives, and false positives are trivially dismissed.

    On the UX of tab completing paths, the problem I have with the existing implementation is not the @ prefix, it's that tab only selects whatever path is currently highlighted in the selector! Shell path completion does incremental segment-based completion. And that's very important for deep and wide directory structures. Scrolling a selection menu dozens of times trying to find exactly the right file is tedious. Typing out a multi-segment prefix just to filter the selection box down enough that the tab key becomes useful is also annoying.

    A nice-to-have in this area is fuzzy search matched by Levenshtein or Jaro-Winkler distance to gracefully handle typos and transpositions. But I can do without it if completion is improved.

  5. removed
    CLI
    on Mar 14, 2026
  6. are-scenic commented on May 8, 2026

    @are-scenic

    I’m hitting a related @ mention workflow issue.

    When typing @ and selecting a directory from the completion menu, pressing Enter or Tab accepts the directory but exits/hides the @ mention mode. That makes it awkward to keep building a deeper path.

    Example workflow:

    1. Type @Doc
    2. Select Documents/
    3. Press Tab or Enter
    4. The mention/completion mode closes, so continuing into Documents/ObsidianVault/... is not convenient

    The workaround is to move back to the beginning of the partial path and add @ again so Codex treats the path as an indexed file reference.

    Expected behavior: accepting a directory completion should keep mention/path-completion mode active, probably inserting a trailing / and showing entries inside that directory. This would make @ file references usable for deep paths without repeatedly restarting mention mode.

  7. Timothy-W-Hilton commented on May 20, 2026

    @Timothy-W-Hilton

    I’m hitting a related @ mention workflow issue.

    When typing @ and selecting a directory from the completion menu, pressing Enter or Tab accepts the directory but exits/hides the @ mention mode. That makes it awkward to keep building a deeper path.

    Example workflow:

    1. Type `@Doc`
    
    2. Select `Documents/`
    
    3. Press `Tab` or `Enter`
    
    4. The mention/completion mode closes, so continuing into `Documents/ObsidianVault/...` is not convenient
    

    The workaround is to move back to the beginning of the partial path and add @ again so Codex treats the path as an indexed file reference.

    Expected behavior: accepting a directory completion should keep mention/path-completion mode active, probably inserting a trailing / and showing entries inside that directory. This would make @ file references usable for deep paths without repeatedly restarting mention mode.

    I think the core issue here is that completion is not iterative.

    Current behavior:

    1. Type a partial path after @
    2. Completion menu appears
    3. Select a directory
    4. Press Tab

    At that point:

    • the completion is inserted
    • the leading @ disappears
    • completion mode exits

    This makes descending a directory tree awkward because continuing completion requires:

    1. moving back to the beginning of the path
    2. re-inserting @
    3. re-triggering completion

    In practice, reaching a deep path can require several rounds of this.

    What I expected instead was normal shell/editor-style path completion semantics:

    • accepting a directory completion preserves completion state
    • repeated Tab continues completion deeper into the tree
    • completion remains active while editing the path

    For example, after completing:
    @src/components

    I would expect to be able to continue with:
    /but

    and immediately continue tab-completing from there, without restarting completion from the beginning of the path.

  8. skytwosea commented on May 28, 2026

    @skytwosea

    @Timothy-W-Hilton This is the core issue for me as well.

    When navigating through nested directories, the tab behaviour should, at minimum:

    • if current selection is a directory, use tab to append it to the @ file mention, and present that directory's contents as tab-completable so one can keep building out the filepath
    • if current selection is a directory, use enter to append it to the @ file mention, and exit the file navigator
    • if current selection is a file, use tab or enter to append it to the @ file mention, and exit the file navigator

    @parasyte mentions fuzzy matching - that would be a blessed add-on as well.

    This seems so basic at first blush. The current implementation feels like trying to drive a car with a floppy, loose chain for a steering-wheel. Tabbing one's way through filepath completion is pretty basic stuff for anyone used to working in a shell - it's not some novel feature to present as an extra nicety, it's basic ingrained-habit necessity.

    edit: I'm probably quite late in learning this, but there is a workflow behaviour that allows for filepath building. Consider the following filepath:

    plans/very_large_refactor/service_xyz_blah/04A_long_complex_phase_with_desc.md

    If one types a part of each word and then a forward slash, the navigator keeps building forward. So, for the following prompt, one can type the following:

    Please read the planning document at @pla/very_lar/service_xy/04A

    and then the file navigator will highlight the target file 04A_long_complex_phase_with_desc.md (assuming one has typed enough to uniquely identify it). Then, tab or enter selects it which fully expands the completed (relative) path in the prompt.

    It's ugly, but it works.

    I still would like to request sensible tab behaviour in filepath navigation/completion.

  9. bpawlakj commented on Oct 1, 2026

    @bpawlakj

    Adding user-reported feedback supporting this feature request: directory navigation and path autocomplete outside the current workspace in the CLI composer.

    Component: Codex CLI
    Installed CLI version: 0.159.3
    Platform: macOS

    Problem

    When working across related repositories, I want to select a sibling or parent directory directly from the active CLI session. The user reports that the composer autocomplete does not provide an interactive way to browse directories above the current project or complete paths to sibling repositories. Manually typing or pasting paths makes this workflow cumbersome.

    Example workflow

    1. Start Codex in /path/to/projects/app.
    2. In the composer, try to navigate to ../shared-library/ or another sibling directory using path autocomplete.
    3. Select that directory as context for the current conversation.

    Requested behavior, supporting this issue and related issue #11996

    • Provide directory entries as well as files in path completion.
    • Support completion and navigation for ../ paths and absolute paths, subject to the existing read permissions.
    • Allow selecting a directory as context and completing paths within it.
    • Offer an in-session command or picker to attach an additional workspace directory, with the usual permission checks.
    • Keep context selection separate from permission grants; selecting a path should not silently expand write access.

    Why this matters

    This would make cross-repository work easier without leaving the session or manually copying filesystem paths. The user reports being accustomed to this workflow in Claude Code and GitHub Copilot CLI.

    Current workaround

    Manually provide a path in the prompt, or restart/resume with --add-dir when additional write access is needed. Neither provides interactive directory navigation in the composer.

    Evidence scope

    This is user-reported usability feedback, not an independently reproduced automated test. No private repository details, logs, screenshots, or session transcript are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TUIenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions