claude-code - 💡(How to fix) Fix [FEATURE] Tab autocomplete inside bash mode (!) — files, paths, and command history [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

  • Type full paths by hand (error-prone, especially with deep node_modules/monorepo trees), or

Fix Action

Fixed

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing requests and this feature hasn't been requested yet
  • 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [FEATURE] Tab autocomplete inside bash mode (!) — files, paths, and command history [1 pull requests]