[FEATURE] Tab autocomplete inside bash mode (!) — files, paths, and command history

Resolved 💬 1 comment Opened May 26, 2026 by mishraprafful Closed Jun 27, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When I drop into bash mode in the Claude Code TUI by prefixing a line with !, none of the tab completion I rely on in my normal shell works. No file/path completion, no command history completion, no completion of command names on $PATH. This makes bash mode noticeably slower than just switching to a real terminal for anything beyond a one-word command — which defeats the main reason to have bash mode at all (staying in flow without context-switching out of Claude Code).

Concretely, today I have to either:

  • Type full paths by hand (error-prone, especially with deep node_modules/monorepo trees), or
  • Suspend my Claude Code session, run the command in a real shell, then come back.

The friction is small per command but compounds across a session.

Proposed Solution

Tab completion inside bash mode (! prefix) that covers, at minimum:

  1. Path completion for files and directories relative to the current working directory (the most valuable case).
  2. Command name completion against $PATH.
  3. History-based completion for recently run ! commands in the current session (and ideally across sessions).

Ideal UX: pressing <Tab> after partial input shows a completion menu inline (similar to how slash-command and @agent completion already work in the TUI), with <Tab>/arrow keys to cycle and <Enter> to accept. A toggle in settings (e.g. bashMode.tabCompletion: true) is fine if it needs to be opt-in.

Full shell-integrated completion (sourcing the user's zsh/bash completion functions, e.g. completions for git, kubectl, npm) would be the ideal endpoint, but a built-in subset covering paths + binaries + history would already remove most of the friction.

Alternative Solutions

  • Suspending the TUI and running the command in a real terminal — works but breaks flow.
  • PR #4943 adds external completion scripts for the claude CLI itself, which is a different problem (completing claude in your shell, not completing commands inside bash mode).
  • Asking Claude to run the command via a tool call — works for one-offs but is overkill for things I already know how to type.

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

  1. I'm reviewing a change Claude just made and want to cat a sibling file to compare.
  2. I type !cat src/components/Auth/, then press <Tab>.
  3. Today: nothing happens; I have to type the rest of the path by hand or scroll back to find it.
  4. With this feature: I get a completion menu of the directory contents and can pick the file in two keystrokes.

This pattern (one quick shell command to inspect state before responding to Claude) is the dominant use of bash mode for me, and it's exactly where the lack of tab completion bites hardest.

Additional Context

Prior closed/duplicate issues tracking this:

  • #18637 (closed NOT_PLANNED, auto-inactivity 2026-03-01) — was the canonical tracking issue
  • #60545, #17414, #15496 — closed as duplicates of #18637
  • #1196 — older closed bug about autocomplete corrupting bash mode commands

Filing fresh since #18637 is closed and locked. Happy to consolidate into an existing issue if one already exists that I missed.

View original on GitHub ↗

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